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