X-Git-Url: http://gitweb.michael.orlitzky.com/?p=spline3.git;a=blobdiff_plain;f=makefile;h=3862b333e3dbf6fd4de745e560814c56554969bf;hp=7bbd4672c3c2f31012b099f5fdb2d76f279ea8d3;hb=83ef0aaeae074756e4ee90d72d3e27e74e136061;hpb=c5d0d16488499cc4ac6378217d6ac071baeb458b diff --git a/makefile b/makefile index 7bbd467..3862b33 100644 --- a/makefile +++ b/makefile @@ -1,49 +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 +PN = spline3 +BIN = dist/build/$(PN)/$(PN) +SRCS := $(shell find src/ -type f -name '*.hs') -BIN := spline3 +BIN = dist/build/spline3/spline3 +DOCTESTS_BIN = dist/build/doctests/doctests +TESTSUITE_BIN = dist/build/testsuite/testsuite -.PHONY : test doc src_html +.PHONY : test doc dist hlint -$(BIN): src/*.hs - ghc -O2 $(GHC_WARNINGS) --make -o bin/${BIN} src/*.hs +$(BIN): $(PN).cabal $(SRCS) + runghc Setup.hs configure \ + --user \ + --prefix=/ \ + --flags=${FLAGS} + runghc Setup.hs build -all: $(BIN) test_src +$(DOCTESTS_BIN): $(SRCS) test/Doctests.hs + runghc Setup.hs configure \ + --user \ + --prefix=/ \ + --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 +$(TESTSUITE_BIN): $(SRCS) test/TestSuite.hs + runghc Setup.hs configure \ + --user \ + --prefix=/ \ + --flags=${FLAGS} \ + --enable-tests + runghc Setup.hs build -profile: src/*.hs - ghc -O2 $(GHC_WARNINGS) -prof -auto-all --make -o bin/$(BIN) src/*.hs +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 src/*.hi - rm -f src/*.o - rm -f src/Tests/*.hi - rm -f src/Tests/*.o + runghc Setup.hs clean + rm -rf dist/ rm -f *.prof - rm -rf doc/html/* - -test: - runghc -i"src" test/TestSuite.hs + rm -f .hpc +test: $(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 +doc: dist/doc -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 +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" -doc: src_html - 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 +hlint: + hlint --ignore="Use camelCase" \ + --ignore="Redundant bracket" \ + --color \ + src