X-Git-Url: http://gitweb.michael.orlitzky.com/?p=spline3.git;a=blobdiff_plain;f=makefile;h=3862b333e3dbf6fd4de745e560814c56554969bf;hp=402f95667a4c404a13787998e0f9a88d56366521;hb=83ef0aaeae074756e4ee90d72d3e27e74e136061;hpb=a680bef0a99be6555dc0ddfed2ee0080cbf6f0b9 diff --git a/makefile b/makefile index 402f956..3862b33 100644 --- a/makefile +++ b/makefile @@ -1,90 +1,70 @@ -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 -GHC_WARNINGS += -fwarn-tabs -GHC_WARNINGS += -fwarn-incomplete-record-updates -GHC_WARNINGS += -fwarn-monomorphism-restriction -GHC_WARNINGS += -fwarn-unused-do-bind - -BIN := spline3 -TMPDIR := /tmp -GHC_OPTS := $(GHC_WARNINGS) \ - -odir $(TMPDIR) \ - -hidir $(TMPDIR) \ - --make \ - -rtsopts \ - -o bin/${BIN} - - -.PHONY : test publish_doc doc src_html hlint - -$(BIN): src/*.hs - ghc -O2 $(GHC_OPTS) src/*.hs - -all: $(BIN) test_src - -test_src: src/Tests/*.hs - ghc -O2 $(GHC_OPTS) src/*.hs src/Tests/*.hs - -profile: src/*.hs - ghc -O2 $(GHC_OPTS) -prof -auto-all src/*.hs +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 doc dist hlint + +$(BIN): $(PN).cabal $(SRCS) + runghc Setup.hs configure \ + --user \ + --prefix=/ \ + --flags=${FLAGS} + runghc Setup.hs build + +$(DOCTESTS_BIN): $(SRCS) test/Doctests.hs + runghc Setup.hs configure \ + --user \ + --prefix=/ \ + --flags=${FLAGS} \ + --enable-tests + runghc Setup.hs build + +$(TESTSUITE_BIN): $(SRCS) test/TestSuite.hs + runghc Setup.hs configure \ + --user \ + --prefix=/ \ + --flags=${FLAGS} \ + --enable-tests + runghc Setup.hs build + +llvm: $(PN).cabal $(SRCS) + FLAGS="llvm" make + +profile: $(SRCS) + runghc Setup.hs configure \ + --user \ + --prefix=/ \ + --enable-executable-profiling + runghc Setup.hs build clean: - rm -f bin/$(BIN) - rm -f $(TMPDIR)/*.hi - rm -f $(TMPDIR)/*.o + runghc Setup.hs clean + rm -rf dist/ rm -f *.prof - rm -rf doc/html/* - -test: - runghc -i"src" test/TestSuite.hs - - -src_html: - util/hscolour_srcs - - -DOCS := -i /usr/share/doc/ghc-*/html/libraries/base-*/base.haddock -DOCS += -i /usr/share/doc/ghc-*/html/libraries/ghc-prim-*/ghc-prim.haddock -DOCS += -i /usr/share/doc/ghc-*/html/libraries/haskell98-*/haskell98.haddock -DOCS += -i /usr/share/doc/storable-complex-*/html/storable-complex.haddock -DOCS += -i /usr/share/doc/quickcheck-*/html/QuickCheck.haddock -DOCS += -i /usr/share/doc/hmatrix-*/html/hmatrix.haddock -DOCS += -i /usr/share/doc/hunit-*/html/HUnit.haddock - + rm -f .hpc -HTMLS := /usr/share/doc/ghc-*/html/libraries/base-*/*.html -HTMLS += /usr/share/doc/ghc-*/html/libraries/ghc-prim-*/*.html -HTMLS += /usr/share/doc/ghc-*/html/libraries/haskell98-*/*.html -HTMLS += /usr/share/doc/quickcheck-*/html/*.html -HTMLS += /usr/share/doc/hunit-*/html/*.html -HTMLS += /usr/share/doc/storable-complex-*/html/*.html -HTMLS += /usr/share/doc/hmatrix-*/html/*.html +test: $(PN).cabal $(TESTSUITE_BIN) $(DOCTESTS_BIN) $(BIN) + runghc Setup.hs test -HSCOLOUR_SRCS := /usr/share/doc/ghc-*/html/libraries/base-*/src/* -HSCOLOUR_SRCS += /usr/share/doc/ghc-*/html/libraries/ghc-prim-*/src/* -HSCOLOUR_SRCS += /usr/share/doc/ghc-*/html/libraries/haskell98-*/src/* -HSCOLOUR_SRCS += /usr/share/doc/hmatrix-*/html/src/* +dist: + runghc Setup.hs configure --prefix=/ + TAR_OPTIONS="--format=ustar" runghc Setup.hs sdist -doc: src_html - cp -n $(HTMLS) ./doc/html/ - cp -n $(HSCOLOUR_SRCS) ./doc/html/src/ - haddock $(DOCS) --html --use-unicode \ - --odir=doc/html/ --title="spline3" \ - --source-module="src/%{MODULE/.//}.html" \ - --source-entity="src/%{MODULE/.//}.html#%{NAME}" \ - src/*.hs src/Tests/*.hs +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 ./doc/html/ $(SSH_USER):$(PUBLIC_DOCDIR) +dist/doc: $(PN).cabal $(SRCS) + runghc Setup.hs configure --user --prefix=/ --flags=${FLAGS} + runghc Setup.hs hscolour --all + 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