]> gitweb.michael.orlitzky.com - hath.git/blobdiff - makefile
PHONY the dist make target.
[hath.git] / makefile
index 46c4826c8ef6e1e513aeb2330b7ee0642153c02d..2061f444e91d607cb8ef8f8d5bb98c66422dd353 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,15 +1,36 @@
-BIN=hath
+BIN           = dist/build/hath/hath
+TESTSUITE_BIN = dist/build/testsuite/testsuite
 
-all: $(BIN)
+.PHONY : test dist
 
 $(BIN): src/*.hs
-       ghc -O2 -Wall --make -o bin/${BIN} src/*.hs
+       runghc Setup.hs clean
+       runghc Setup.hs configure --user
+       runghc Setup.hs build
 
 profile: src/*.hs
-       ghc -O2 -Wall -prof -auto-all --make -o bin/$(BIN) src/*.hs
+       runghc Setup.hs clean
+       runghc Setup.hs configure --user --enable-executable-profiling
+       runghc Setup.hs build
+
+doc: src/*.hs
+       runghc Setup.hs configure --user
+       runghc Setup.hs hscolour --executables
+       runghc Setup.hs haddock --internal    \
+                               --executables \
+                               --hyperlink-source
 
 clean:
-       rm -f bin/$(BIN)
-       rm -f src/*.hi
-       rm -f src/*.o
-       rm -f *.prof
+       runghc Setup.hs clean
+
+
+$(TESTSUITE_BIN): src/*.hs test/TestSuite.hs
+       runghc Setup.hs configure --user --flags=${FLAGS} --enable-tests
+       runghc Setup.hs build
+
+test: $(BIN) $(TESTSUITE_BIN)
+       runghc Setup.hs test
+
+dist:
+       runghc Setup.hs configure
+       runghc Setup.hs sdist