X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=makefile;h=df34c79710162399f5bc13263f6624b0708f2d76;hb=401406065b2329ffb591ff952d46b1a4d9207c52;hp=075277a4e50bcc5c7e494e31c3aa115a6a9e95c0;hpb=3f7a07312dfbdae0d71b2c0d181c93df9ffe53b4;p=dead%2Fhtsn-import.git diff --git a/makefile b/makefile index 075277a..df34c79 100644 --- a/makefile +++ b/makefile @@ -1,39 +1,43 @@ -PN = htsn-rdbms-import +PN = htsn-import BIN = dist/build/$(PN)/$(PN) -TESTSUITE_BIN = dist/build/testsuite/testsuite +SRCS := $(shell find src/ -type f -name '*.hs') .PHONY : dist hlint -$(BIN): $(PN).cabal src/*.hs src/TSN/*.hs - runghc Setup.hs clean +$(BIN): $(PN).cabal $(SRCS) runghc Setup.hs configure --user --prefix=/ runghc Setup.hs build -profile: $(PN).cabal src/*.hs src/TSN/*.hs - runghc Setup.hs clean - runghc Setup.hs configure --user --enable-executable-profiling --prefix=/ +profile: $(PN).cabal $(SRCS) + runghc Setup.hs configure --user \ + --enable-executable-profiling \ + --prefix=/ runghc Setup.hs build -doc: $(PN).cabal src/*.hs src/TSN/*.hs +doc: $(PN).cabal $(SRCS) runghc Setup.hs configure --user --prefix=/ runghc Setup.hs hscolour --executables runghc Setup.hs haddock --internal \ --executables \ --hyperlink-source -clean: - runghc Setup.hs clean - rm -f *.log - rm -f *.xml - rm -rf tmp +# +# Testing. +# -$(TESTSUITE_BIN): $(PN).cabal src/*.hs test/TestSuite.hs +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 test: $(BIN) $(TESTSUITE_BIN) runghc Setup.hs test + +# +# Misc. +# dist: runghc Setup.hs configure --prefix=/ runghc Setup.hs sdist @@ -43,3 +47,32 @@ hlint: --ignore="Redundant bracket" \ --color \ src + +clean: + runghc Setup.hs clean + rm -f *.log + rm -f *.xml + rm -rf tmp + rm -f schemagen/*.dtd + find ./ -name '*.prof' -delete + 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)