X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Flwn-epub.git;a=blobdiff_plain;f=makefile;h=9a1337225a32b22b7e4f2fe014495b56271c2c45;hp=15a218731a0df652788f2621855f3f9532eb7ced;hb=refs%2Ftags%2Fv0.0.1;hpb=14bff4a492037f8921a5993931d0fc4363207b20 diff --git a/makefile b/makefile index 15a2187..9a13372 100644 --- a/makefile +++ b/makefile @@ -1,16 +1,29 @@ .PHONY : test publish_doc doc src_html hlint -lwn-epub: src/*.hs +# There's onlt one '$' in the awk script, but we have to double-money +# it for make. +PN = $(shell grep 'name:' *.cabal | awk '{ print $$2 }') +BIN = dist/build/$(PN)/$(PN) +TESTSUITE_BIN = dist/build/testsuite/testsuite +SRCS = $(shell find src/ -name '*.hs') + +$(BIN): $(SRCS) runghc Setup.hs clean runghc Setup.hs configure --user --flags=${FLAGS} runghc Setup.hs build +$(TESTSUITE_BIN): src/*.hs test/TestSuite.hs + runghc Setup.hs configure --user --flags=${FLAGS} --enable-tests + runghc Setup.hs build + clean: runghc Setup.hs clean rm -f dist/ rm -f *.prof rm -rf .hpc +install: $(BIN) + runghc Setup.hs install # Neither 'haddock' nor 'hscolour' seem to work properly. doc: src_html @@ -19,5 +32,5 @@ doc: src_html --executables \ --hyperlink-source -test: - runghc -i"src" test/TestSuite.hs +test: $(BIN) $(TESTSUITE_BIN) + runghc Setup.hs test