]> gitweb.michael.orlitzky.com - numerical-analysis.git/blobdiff - makefile
Fix a bug in the relative error.
[numerical-analysis.git] / makefile
index 8b9c250c4dcb7f623801e1f1543c2f697fab3d98..a333c588cff7bbf37dba22cb19c22827a874e6d3 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,25 +1,25 @@
-BIN           = dist/build/numerical-analysis/numerical-analysis
+# There's only 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)
 DOCTESTS_BIN  = dist/build/doctests/doctests
+SRCS = $(shell find src/ -name '*.hs')
 
 .PHONY : test publish_doc doc dist hlint
 
-$(BIN): src/*.hs
-       runghc Setup.hs clean
-       runghc Setup.hs configure --user --flags=${FLAGS}
+$(BIN): $(PN).cabal $(SRCS)
+       runghc Setup.hs configure --user
        runghc Setup.hs build
 
-$(DOCTESTS_BIN): src/*.hs test/Doctests.hs
-       runghc Setup.hs configure --user --flags=${FLAGS} --enable-tests
+$(DOCTESTS_BIN): $(SRCS) test/Doctests.hs
+       runghc Setup.hs configure --user --enable-tests
        runghc Setup.hs build
 
 
-profile: src/*.hs
+profile: $(PN).cabal $(SRCS)
        runghc Setup.hs configure --user --enable-executable-profiling
        runghc Setup.hs build
 
-hpc: src/*.hs
-       FLAGS="hpc" make
-
 clean:
        runghc Setup.hs clean
        rm -f dist/
@@ -30,17 +30,12 @@ clean:
 test: $(BIN) $(DOCTESTS_BIN)
        runghc Setup.hs test
 
-dist:
-       runghc Setup.hs configure
-       runghc Setup.hs sdist
 
-# Neither 'haddock' nor 'hscolour' seem to work properly.
-doc: src/*.hs
+doc: $(SRCS)
        runghc Setup.hs configure --user --flags=${FLAGS}
-       runghc Setup.hs hscolour --executables
-       runghc Setup.hs haddock --internal    \
-                               --executables \
-                               --hyperlink-source
+       runghc Setup.hs hscolour --all
+       runghc Setup.hs haddock  --all \
+                                 --haddock-options="--ignore-all-exports"
 
 hlint:
        hlint --ignore="Use camelCase"     \