X-Git-Url: http://gitweb.michael.orlitzky.com/?p=spline3.git;a=blobdiff_plain;f=makefile;h=850626fdc4261e8c46133b28d1c1fd3dd07baa50;hp=dd568009a096c934169f861d0be3664004273048;hb=0d037f5f0829d9ee7fcccc58570305623665f52e;hpb=492841535e7a02ef7aa8a53070c45be373da171e diff --git a/makefile b/makefile index dd56800..850626f 100644 --- a/makefile +++ b/makefile @@ -1,49 +1,62 @@ -GHC_WARNINGS := -Wall -GHC_WARNINGS += -fwarn-hi-shadowing -GHC_WARNINGS += -fwarn-missing-signatures -GHC_WARNINGS += -fwarn-name-shadowing -GHC_WARNINGS += -fwarn-orphans -GHC_WARNINGS += -fwarn-type-defaults +BIN = dist/build/spline3/spline3 +DOCTESTS_BIN = dist/build/doctests/doctests +TESTSUITE_BIN = dist/build/testsuite/testsuite -BIN := spline3 - -.PHONY : test doc src_html +.PHONY : test publish_doc doc dist hlint $(BIN): src/*.hs - ghc -O2 $(GHC_WARNINGS) --make -o bin/${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 -all: $(BIN) test_src +$(TESTSUITE_BIN): src/*.hs test/TestSuite.hs + runghc Setup.hs configure --user --flags=${FLAGS} --enable-tests + runghc Setup.hs build -test_src: src/Tests/*.hs - ghc -O2 $(GHC_WARNINGS) --make -o bin/${BIN} src/*.hs src/Tests/*.hs +llvm: src/*.hs + FLAGS="llvm" make profile: src/*.hs - ghc -O2 $(GHC_WARNINGS) -prof -auto-all --make -o bin/$(BIN) src/*.hs + runghc Setup.hs configure --user --enable-executable-profiling + runghc Setup.hs build + +hpc: src/*.hs + FLAGS="hpc" make clean: - rm -f bin/$(BIN) - rm -f src/*.hi - rm -f src/*.o - rm -f src/Tests/*.hi - rm -f src/Tests/*.o + runghc Setup.hs clean + rm -f dist/ rm -f *.prof - rm -rf doc/* - -test: - runghc -i"src" test/TestSuite.hs - - -src_html: - util/hscolour_srcs - - -DOCS := -i /usr/share/doc/ghc-6.12.3/html/libraries/base-4.2.0.2/base.haddock -DOCS += -i /usr/share/doc/storable-complex-0.2.1/html/storable-complex.haddock -DOCS += -i /usr/share/doc/hmatrix-0.10.0.1/html/hmatrix.haddock - -doc: src_html - haddock $(DOCS) --html --use-unicode \ - --odir=doc/ --title="spline3" \ - --source-module="src/%{MODULE/.//}.html" \ - --source-entity="src/%{MODULE/.//}.html#%{NAME}" \ - src/*.hs src/Tests/*.hs + rm -rf .hpc + +test: $(BIN) $(DOCTESTS_BIN) $(TESTSUITE_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 + runghc Setup.hs configure --user --flags=${FLAGS} + runghc Setup.hs hscolour --executables + runghc Setup.hs haddock --internal \ + --executables \ + --hyperlink-source + +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) + +hlint: + hlint --ignore="Use camelCase" \ + --ignore="Redundant bracket" \ + --color \ + src