]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - makefile
spline3.cabal: bump version to 1.0.2
[spline3.git] / makefile
index 367819017a7f02c93d7bc754888fe40906413c58..9fdfc33ef76b81490f9851f87112e72349278571 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,61 +1,63 @@
+PN = spline3
+BIN = dist/build/$(PN)/$(PN)
+SRCS := $(shell find src/ -type f -name '*.hs')
+
 BIN           = dist/build/spline3/spline3
 DOCTESTS_BIN  = dist/build/doctests/doctests
 TESTSUITE_BIN = dist/build/testsuite/testsuite
 
-.PHONY : test publish_doc doc src_html hlint
-
-$(BIN): src/*.hs
-       runghc Setup.hs clean
-       runghc Setup.hs configure --user --flags=${FLAGS}
-       runghc Setup.hs build
-
-$(DOCTESTS_BIN): src/*.hs test/Doctests.hs
-       runghc Setup.hs configure --user --flags=${FLAGS} --enable-tests
-       runghc Setup.hs build
-
-$(TESTSUITE_BIN): src/*.hs test/TestSuite.hs
-       runghc Setup.hs configure --user --flags=${FLAGS} --enable-tests
-       runghc Setup.hs build
-
-llvm: src/*.hs
-       FLAGS="llvm" make
-
-profile: src/*.hs
-       runghc Setup.hs configure --user --enable-executable-profiling
-       runghc Setup.hs build
-
-hpc: src/*.hs
-       FLAGS="hpc" make
+# Append these warnings to the HCFLAGS environment variable that gets
+# passed as options to GHC. We want to see the warnings while developing
+# but don't want them hard-coded in the cabal file for end users.
+HCFLAGS += -Weverything \
+           -Wno-implicit-prelude \
+           -Wno-safe \
+           -Wno-unsafe \
+           -Wno-all-missed-specialisations \
+           -Wno-prepositive-qualified-module \
+           -Wno-missing-safe-haskell-mode \
+           -Wno-missing-deriving-strategies \
+           -Wno-missing-kind-signatures \
+           -rtsopts \
+           -threaded
+
+.PHONY : test doc dist hlint
+
+$(BIN): $(PN).cabal $(SRCS)
+       runghc Setup.hs configure --user --prefix=/
+       runghc Setup.hs build --ghc-options="${HCFLAGS}"
+
+$(DOCTESTS_BIN): $(SRCS) test/Doctests.hs
+       runghc Setup.hs configure --user --prefix=/ --enable-tests
+       runghc Setup.hs build --ghc-options="${HCFLAGS}"
+
+$(TESTSUITE_BIN): $(SRCS) test/TestSuite.hs
+       runghc Setup.hs configure --user --prefix=/ --enable-tests
+       runghc Setup.hs build --ghc-options="${HCFLAGS}"
 
 clean:
        runghc Setup.hs clean
-       rm -f dist/
+       rm -rf dist/
        rm -f *.prof
-       rm -rf .hpc
+       rm -f .hpc
 
-test: $(BIN) $(DOCTESTS_BIN) $(TESTSUITE_BIN)
+check:  $(PN).cabal $(TESTSUITE_BIN) $(DOCTESTS_BIN) $(BIN)
        runghc Setup.hs test
 
-src_html:
-       util/hscolour_srcs
+dist:
+       runghc Setup.hs configure --prefix=/
+       TAR_OPTIONS="--format=ustar" runghc Setup.hs sdist
 
-# Neither 'haddock' nor 'hscolour' seem to work properly.
-doc: src/*.hs
-       runghc Setup.hs configure --user --flags=${FLAGS}
-       runghc Setup.hs hscolour --executables
-       runghc Setup.hs haddock --internal    \
-                               --executables \
-                               --hyperlink-source
+doc: dist/doc
 
-SSH_USER=root@michael.orlitzky.com
-PUBLIC_DOCDIR=/var/www/orlitzky.com/michael/public/spline3/
-publish_doc: doc
-       rsync -avz -e ssh               \
-       ./dist/doc/html/spline3/spline3 \
-       $(SSH_USER):$(PUBLIC_DOCDIR)
+dist/doc: $(PN).cabal $(SRCS)
+       runghc Setup.hs configure --user --prefix=/
+       runghc Setup.hs haddock --all \
+                                --hyperlink-source \
+                                --haddock-options="--ignore-all-exports"
 
 hlint:
        hlint --ignore="Use camelCase"     \
-             --ignore="Redundant bracket" \
-             --color                      \
-             src
+              --ignore="Redundant bracket" \
+              --color                     \
+              src