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