makefile: rename the test target to "check" as in autotools.
[haeredes.git] / makefile
1 PN = haeredes
2 BIN = dist/build/$(PN)/$(PN)
3 SRCS = $(shell find src/ -type f -name '*.hs')
4
5 .PHONY : dist hlint
6
7 $(BIN): $(PN).cabal $(SRCS)
8 runghc Setup.hs configure --user
9 runghc Setup.hs build
10
11 doc: $(PN).cabal $(SRCS)
12 runghc Setup.hs haddock --all \
13 --hyperlink-source \
14 --haddock-options="--ignore-all-exports"
15
16
17 #
18 # Tests
19 #
20 TESTSUITE_BIN = dist/build/testsuite/testsuite
21 DOCTESTS_BIN = dist/build/doctests/doctests
22 TEST_SRCS := $(shell find test/ -type f -name '*.hs')
23
24 $(TESTSUITE_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
25 runghc Setup.hs configure --user --enable-tests --prefix=/
26 runghc Setup.hs build
27
28
29 $(DOCTESTS_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
30 runghc Setup.hs configure --user --enable-tests
31 runghc Setup.hs build
32
33 check: $(BIN) $(TESTSUITE_BIN) $(DOCTESTS_BIN)
34 runghc Setup.hs test
35
36
37 #
38 # Misc
39 #
40
41 dist:
42 runghc Setup.hs configure
43 TAR_OPTIONS="--format=ustar" runghc Setup.hs sdist
44
45 hlint:
46 hlint --ignore="Use camelCase" \
47 --ignore="Redundant bracket" \
48 --color \
49 src
50
51 clean:
52 runghc Setup.hs clean
53 find ./ -name '*.prof' -delete
54 find ./ -name '*.o' -delete
55 find ./ -name '*.hi' -delete