cabal-version:       2.2
name:                hocd
version:             0.1.0.0
synopsis:            OpenOCD Haskell interface
description:         Support for OpenOCDs TCL interface
homepage:            https://github.com/DistRap/hocd
license:             BSD-3-Clause
license-file:        LICENSE
author:              sorki
maintainer:          srk@48.io
copyright:           2023 sorki
category:            Embedded
build-type:          Simple

extra-source-files:
    LICENSE
    README.md

extra-doc-files:
    CHANGELOG.md

flag build-readme
  default:
    False
  description:
    Build README.lhs example

library
  ghc-options:         -Wall
  hs-source-dirs:      src
  exposed-modules:     HOCD
                     , HOCD.Command
                     , HOCD.Error
                     , HOCD.Monad
                     , HOCD.Types
  build-depends:       base >= 4.7 && < 5
                     , binary
                     , bytestring
                     , data-default-class
                     , exceptions
                     , mtl
                     , network
                     , network-run
                     , transformers
                     , text
  default-language:    Haskell2010

executable hocd-read-mem
  hs-source-dirs:      app
  main-is:             Main.hs
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                     , hocd
                     , text
  default-language:    Haskell2010

executable hocd-readme
  if !flag(build-readme)
    buildable: False
  build-depends:
      base >=4.12 && <5
    , hocd
  build-tool-depends:
      markdown-unlit:markdown-unlit
  default-language: Haskell2010
  main-is: README.lhs
  ghc-options: -pgmL markdown-unlit -Wall

test-suite hocd-tests
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             Spec.hs
  other-modules:       ParseSpec
  build-tool-depends:
    hspec-discover:hspec-discover
  build-depends:       base >= 4.7 && < 5
                     , hocd
                     , hspec
  default-language:    Haskell2010

source-repository head
  type:     git
  location: https://github.com/DistRap/hocd