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