]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blob - makefile
Add more files to 'make clean'.
[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 --executables
20 runghc Setup.hs haddock --internal \
21 --executables \
22 --hyperlink-source
23
24 #
25 # Testing.
26 #
27
28 TESTSUITE_BIN = dist/build/testsuite/testsuite
29 TEST_SRCS := $(shell find test/ -type f -name '*.hs')
30 $(TESTSUITE_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
31 runghc Setup.hs configure --user --enable-tests --prefix=/
32 runghc Setup.hs build
33
34 test: $(BIN) $(TESTSUITE_BIN)
35 runghc Setup.hs test
36
37
38 #
39 # Misc.
40 #
41 dist:
42 runghc Setup.hs configure --prefix=/
43 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 rm -f *.log
54 rm -f *.xml
55 rm *.prof
56 rm -rf tmp
57 rm -f schemagen/*.dtd
58 find ./ -name '*.o' -delete
59 find ./ -name '*.hi' -delete
60
61
62 #
63 # Schema generation.
64 #
65
66 XMLS := $(shell find schemagen/ -type f -name '*.xml')
67 XMLTYPES := $(shell find schemagen/ -mindepth 1 -maxdepth 1 -type d)
68 DTDS := $(addsuffix .dtd, $(XMLTYPES))
69
70 # We have to depend on *every* XML file here, since pattern matching
71 # and path globs don't play well together. The use of "%" on the right
72 # is a trick to make the ".dtd"-less path available in the rule via
73 # $<. Its use is legitimate since we do sort of depend on the
74 # directory existing.
75 $(DTDS): %.dtd: % $(XMLS)
76 schema-learn $</*.xml > $@
77
78 schema: $(DTDS)