]> gitweb.michael.orlitzky.com - dead/lwn-epub.git/blobdiff - makefile
Add a trailing newline to the Misc module.
[dead/lwn-epub.git] / makefile
index 15a218731a0df652788f2621855f3f9532eb7ced..3ae65f2b7d4f7973445e7cf2d80ecc3f631354b2 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,6 +1,12 @@
 .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)
+SRCS = $(shell find src/ -name '*.hs')
+
+$(BIN): $(SRCS)
        runghc Setup.hs clean
        runghc Setup.hs configure --user --flags=${FLAGS}
        runghc Setup.hs build
@@ -19,5 +25,8 @@ doc: src_html
                                --executables \
                                --hyperlink-source
 
-test:
-       runghc -i"src" test/TestSuite.hs
+dist/build/autogen: $(BIN)
+
+
+test: dist/build/autogen
+       runghc -i"src" -i"dist/build/autogen" test/TestSuite.hs