2 BIN = dist/build/$(PN)/$(PN)
3 SRCS := $(shell find src/ -type f -name '*.hs')
7 $(BIN): $(PN).cabal $(SRCS)
8 runghc Setup.hs configure --user --prefix=/
11 # The $(BIN) dependency means that we should build once normally
12 # before attempting the profiling build (this is required for some
14 profile: $(PN).cabal $(SRCS) $(BIN)
15 runghc Setup.hs configure --user \
16 --enable-executable-profiling \
20 dist/doc: $(PN).cabal $(SRCS)
21 runghc Setup.hs configure --user --prefix=/
22 runghc Setup.hs hscolour --all
23 runghc Setup.hs haddock --all \
25 --haddock-options="--ignore-all-exports"
30 # The MLB schema is identical to the regular one.
31 doc/dbschema/MLB_earlylineXML.png: doc/dbschema/earlylineXML.png
39 TESTSUITE_BIN = dist/build/testsuite/testsuite
40 TEST_SRCS := $(shell find test/ -type f -name '*.hs')
41 $(TESTSUITE_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
42 runghc Setup.hs configure --user --enable-tests --prefix=/
45 test: $(BIN) $(TESTSUITE_BIN)
53 # Only generate MLB_earlylineXML.png long enough to create
55 dist: doc/dbschema/MLB_earlylineXML.png
56 runghc Setup.hs configure --prefix=/
57 TAR_OPTIONS="--format=ustar" runghc Setup.hs sdist
61 hlint --ignore="Use camelCase" \
62 --ignore="Redundant bracket" \
72 find ./ -name '*.prof' -delete
73 find ./ -name '*.o' -delete
74 find ./ -name '*.hi' -delete
81 XMLS := $(shell find schemagen/ -type f -name '*.xml')
82 XMLTYPES := $(shell find schemagen/ -mindepth 1 -maxdepth 1 -type d)
83 DTDS := $(addsuffix .dtd, $(XMLTYPES))
85 # We have to depend on *every* XML file here, since pattern matching
86 # and path globs don't play well together. The use of "%" on the right
87 # is a trick to make the ".dtd"-less path available in the rule via
88 # $<. Its use is legitimate since we do sort of depend on the
90 $(DTDS): %.dtd: % $(XMLS)
91 schema-learn $</*.xml > $@