X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=makefile;h=1a585c0d9b6cf308ca68432d02c434b872b86a14;hb=c4f82d3ee2488f8574e4719ec3c0f99b52ff649b;hp=07530a6efb6c04cf9ecf92040b64b4b4e61b04d1;hpb=76cf3eee776d35ba2b18dd0d07df7496a083ae3a;p=dead%2Fhtsn-import.git diff --git a/makefile b/makefile index 07530a6..1a585c0 100644 --- a/makefile +++ b/makefile @@ -1,19 +1,17 @@ PN = htsn-import BIN = dist/build/$(PN)/$(PN) -TESTSUITE_BIN = dist/build/testsuite/testsuite SRCS := $(shell find src/ -type f -name '*.hs') -TEST_SRCS := $(shell find test/ -type f -name '*.hs') .PHONY : dist hlint $(BIN): $(PN).cabal $(SRCS) - runghc Setup.hs clean runghc Setup.hs configure --user --prefix=/ runghc Setup.hs build profile: $(PN).cabal $(SRCS) - runghc Setup.hs clean - runghc Setup.hs configure --user --enable-executable-profiling --prefix=/ + runghc Setup.hs configure --user \ + --enable-executable-profiling \ + --prefix=/ runghc Setup.hs build doc: $(PN).cabal $(SRCS) @@ -23,12 +21,12 @@ doc: $(PN).cabal $(SRCS) --executables \ --hyperlink-source -clean: - runghc Setup.hs clean - rm -f *.log - rm -f *.xml - rm -rf tmp +# +# Testing. +# +TESTSUITE_BIN = dist/build/testsuite/testsuite +TEST_SRCS := $(shell find test/ -type f -name '*.hs') $(TESTSUITE_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS) runghc Setup.hs configure --user --enable-tests --prefix=/ runghc Setup.hs build @@ -36,6 +34,10 @@ $(TESTSUITE_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS) test: $(BIN) $(TESTSUITE_BIN) runghc Setup.hs test + +# +# Misc. +# dist: runghc Setup.hs configure --prefix=/ runghc Setup.hs sdist @@ -45,3 +47,32 @@ hlint: --ignore="Redundant bracket" \ --color \ src + +clean: + runghc Setup.hs clean + rm -f *.log + rm -f *.xml + rm *.prof + rm -rf tmp + rm -f schemagen/*.dtd + find ./ -name '*.o' -delete + find ./ -name '*.hi' -delete + + +# +# Schema generation. +# + +XMLS := $(shell find schemagen/ -type f -name '*.xml') +XMLTYPES := $(shell find schemagen/ -mindepth 1 -maxdepth 1 -type d) +DTDS := $(addsuffix .dtd, $(XMLTYPES)) + +# We have to depend on *every* XML file here, since pattern matching +# and path globs don't play well together. The use of "%" on the right +# is a trick to make the ".dtd"-less path available in the rule via +# $<. Its use is legitimate since we do sort of depend on the +# directory existing. +$(DTDS): %.dtd: % $(XMLS) + schema-learn $ $@ + +schema: $(DTDS)