Using a Makefile with cabal?
I'm working on a toy project as a way to move my enjoyment of Haskell from
theoretical to the practical, make myself more comfortable with cabal,
HUnit, etc.
I just added a Makefile to my project:
test: dist/build
cabal-dev test
dist/build: dist/setup-config src/*.hs tests/*.hs
cabal-dev build
dist/setup-config: ToyProject.cabal
cabal-dev configure --enable-tests
Because:
cabal-dev install --enable-tests seemed like overkill (and was warning me
about re-installs)
cabal-dev configure --enable-tests && cabal-dev build && cabal-dev test
was doing unnecessary work, and keeping state about whether I needed to
reconfigure was boring
and both were a lot of typing
I'm concerned that I might be recreating functionality with Make that
cabal or cabal-dev already gives me, but I'm not familiar enough with
either to know whether that is true, and if it is, how I'd do it.
Is a Makefile appropriate here, or is there a more direct way to do this
just using cabal/cabal-dev?
No comments:
Post a Comment