]> gitweb.michael.orlitzky.com - haeredes.git/blob - makefile
haeredes.cabal: update to v0.5.3.
[haeredes.git] / makefile
1 PN = haeredes
2 BIN = dist/build/$(PN)/$(PN)
3 SRCS = $(shell find src/ -type f -name '*.hs')
4
5 # Append these warnings to the HCFLAGS environment variable that gets
6 # passed as options to GHC. We want to see the warnings while developing
7 # but don't want them hard-coded in the cabal file for end users.
8 HCFLAGS += -Weverything \
9 -Wno-implicit-prelude \
10 -Wno-safe \
11 -Wno-unsafe \
12 -Wno-all-missed-specialisations \
13 -rtsopts \
14 -threaded
15
16 .PHONY : dist hlint
17
18 $(BIN): $(PN).cabal $(SRCS)
19 runghc Setup.hs configure --user
20 runghc Setup.hs build --ghc-options="${HCFLAGS}"
21
22 doc: $(PN).cabal $(SRCS)
23 runghc Setup.hs haddock --all \
24 --hyperlink-source \
25 --haddock-options="--ignore-all-exports"
26
27
28 #
29 # Tests
30 #
31 TESTSUITE_BIN = dist/build/testsuite/testsuite
32 DOCTESTS_BIN = dist/build/doctests/doctests
33 TEST_SRCS := $(shell find test/ -type f -name '*.hs')
34
35 $(TESTSUITE_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
36 runghc Setup.hs configure --user --enable-tests --prefix=/
37 runghc Setup.hs build --ghc-options="${HCFLAGS}"
38
39
40 $(DOCTESTS_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
41 runghc Setup.hs configure --user --enable-tests
42 runghc Setup.hs build --ghc-options="${HCFLAGS}"
43
44 check: $(BIN) $(TESTSUITE_BIN) $(DOCTESTS_BIN)
45 runghc Setup.hs test
46
47
48 #
49 # Misc
50 #
51
52 dist:
53 runghc Setup.hs configure
54 TAR_OPTIONS="--format=ustar" runghc Setup.hs sdist
55
56 hlint:
57 hlint --ignore="Use camelCase" \
58 --ignore="Redundant bracket" \
59 --color \
60 src
61
62 clean:
63 runghc Setup.hs clean
64 find ./ -name '*.prof' -delete
65 find ./ -name '*.o' -delete
66 find ./ -name '*.hi' -delete