]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blob - makefile
Try to clean up the makefile 'doc' target.
[dead/htsn-import.git] / makefile
1 PN = htsn-import
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 --prefix=/
9 runghc Setup.hs build
10
11 profile: $(PN).cabal $(SRCS)
12 runghc Setup.hs configure --user \
13 --enable-executable-profiling \
14 --prefix=/
15 runghc Setup.hs build
16
17 doc: $(PN).cabal $(SRCS)
18 runghc Setup.hs configure --user --prefix=/
19 runghc Setup.hs hscolour --all
20 runghc Setup.hs haddock --all \
21 --hyperlink-source
22
23 #
24 # Testing.
25 #
26
27 TESTSUITE_BIN = dist/build/testsuite/testsuite
28 TEST_SRCS := $(shell find test/ -type f -name '*.hs')
29 $(TESTSUITE_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
30 runghc Setup.hs configure --user --enable-tests --prefix=/
31 runghc Setup.hs build
32
33 test: $(BIN) $(TESTSUITE_BIN)
34 runghc Setup.hs test
35
36
37 #
38 # Misc.
39 #
40 dist:
41 runghc Setup.hs configure --prefix=/
42 runghc Setup.hs sdist
43
44 hlint:
45 hlint --ignore="Use camelCase" \
46 --ignore="Redundant bracket" \
47 --color \
48 src
49
50 clean:
51 runghc Setup.hs clean
52 rm -f *.log
53 rm -f *.xml
54 rm -rf tmp
55 rm -f schemagen/*.dtd
56 find ./ -name '*.prof' -delete
57 find ./ -name '*.o' -delete
58 find ./ -name '*.hi' -delete
59
60
61 #
62 # Schema generation.
63 #
64
65 XMLS := $(shell find schemagen/ -type f -name '*.xml')
66 XMLTYPES := $(shell find schemagen/ -mindepth 1 -maxdepth 1 -type d)
67 DTDS := $(addsuffix .dtd, $(XMLTYPES))
68
69 # We have to depend on *every* XML file here, since pattern matching
70 # and path globs don't play well together. The use of "%" on the right
71 # is a trick to make the ".dtd"-less path available in the rule via
72 # $<. Its use is legitimate since we do sort of depend on the
73 # directory existing.
74 $(DTDS): %.dtd: % $(XMLS)
75 schema-learn $</*.xml > $@
76
77 schema: $(DTDS)