]> gitweb.michael.orlitzky.com - haeredes.git/blob - makefile
haeredes.cabal: no period in synopsis
[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 -Wno-prepositive-qualified-module \
14 -Wno-missing-safe-haskell-mode \
15 -Wno-missing-deriving-strategies \
16 -Wno-missing-kind-signatures \
17 -rtsopts \
18 -threaded
19
20 .PHONY : dist hlint
21
22 $(BIN): $(PN).cabal $(SRCS)
23 runghc Setup.hs configure --user
24 runghc Setup.hs build --ghc-options="${HCFLAGS}"
25
26 doc: $(PN).cabal $(SRCS)
27 runghc Setup.hs haddock --all \
28 --hyperlink-source \
29 --haddock-options="--ignore-all-exports"
30
31
32 #
33 # Tests
34 #
35 TESTSUITE_BIN = dist/build/testsuite/testsuite
36 DOCTESTS_BIN = dist/build/doctests/doctests
37 TEST_SRCS := $(shell find test/ -type f -name '*.hs')
38
39 $(TESTSUITE_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
40 runghc Setup.hs configure --user --enable-tests --prefix=/
41 runghc Setup.hs build --ghc-options="${HCFLAGS}"
42
43
44 $(DOCTESTS_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
45 runghc Setup.hs configure --user --enable-tests
46 runghc Setup.hs build --ghc-options="${HCFLAGS}"
47
48 check: $(BIN) $(TESTSUITE_BIN) $(DOCTESTS_BIN)
49 runghc Setup.hs test
50
51
52 #
53 # Misc
54 #
55
56 dist:
57 runghc Setup.hs configure
58 TAR_OPTIONS="--format=ustar" runghc Setup.hs sdist
59
60 hlint:
61 hlint --ignore="Use camelCase" \
62 --ignore="Redundant bracket" \
63 --color \
64 src
65
66 clean:
67 runghc Setup.hs clean
68 find ./ -name '*.prof' -delete
69 find ./ -name '*.o' -delete
70 find ./ -name '*.hi' -delete