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 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"
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=/
37 test: $(BIN) $(TESTSUITE_BIN)
45 runghc Setup.hs configure --prefix=/
46 TAR_OPTIONS="--format=ustar" runghc Setup.hs sdist
49 hlint --ignore="Use camelCase" \
50 --ignore="Redundant bracket" \
60 find ./ -name '*.prof' -delete
61 find ./ -name '*.o' -delete
62 find ./ -name '*.hi' -delete
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))
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
78 $(DTDS): %.dtd: % $(XMLS)
79 schema-learn $</*.xml > $@