]> gitweb.michael.orlitzky.com - dead/lwn-epub.git/blobdiff - makefile
Don't crash if the config file doesn't exist.
[dead/lwn-epub.git] / makefile
index 1528ed3ad58404d9f2abf6c7fcff25012ff83db7..ec658b07233d557c7bc4e2297927025376f6c5c0 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,6 +1,11 @@
 .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)
+
+$(BIN): src/*.hs
        runghc Setup.hs clean
        runghc Setup.hs configure --user --flags=${FLAGS}
        runghc Setup.hs build
@@ -18,3 +23,9 @@ doc: src_html
        runghc Setup.hs haddock --internal    \
                                --executables \
                                --hyperlink-source
+
+dist/build/autogen: $(BIN)
+
+
+test: dist/build/autogen
+       runghc -i"src" -i"dist/build/autogen" test/TestSuite.hs