]> gitweb.michael.orlitzky.com - spline3.git/blob - makefile
Add the section (2.9) tests.
[spline3.git] / makefile
1 BIN := spline3
2 TMPDIR := /tmp
3
4 GHC_WARNINGS := -Wall
5 GHC_WARNINGS += -fwarn-hi-shadowing
6 GHC_WARNINGS += -fwarn-missing-signatures
7 GHC_WARNINGS += -fwarn-name-shadowing
8 GHC_WARNINGS += -fwarn-orphans
9 GHC_WARNINGS += -fwarn-type-defaults
10 GHC_WARNINGS += -fwarn-tabs
11 GHC_WARNINGS += -fwarn-incomplete-record-updates
12 GHC_WARNINGS += -fwarn-monomorphism-restriction
13 GHC_WARNINGS += -fwarn-unused-do-bind
14
15 OPTIMIZATIONS := -O2
16 OPTIMIZATIONS += -fexcess-precision
17 OPTIMIZATIONS += -fno-spec-constr-count
18
19 GHC_OPTS := $(OPTIMIZATIONS) \
20 $(GHC_WARNINGS) \
21 -odir $(TMPDIR) \
22 -hidir $(TMPDIR) \
23 --make \
24 -rtsopts \
25 -threaded \
26 -o bin/${BIN}
27
28
29 .PHONY : test publish_doc doc src_html hlint
30
31 $(BIN): src/*.hs
32 ghc -optc-O3 -optc-march=native $(GHC_OPTS) src/*.hs
33
34 llvm: src/*.hs
35 ghc -fllvm $(GHC_OPTS) src/*.hs
36
37 all: $(BIN) test_src
38
39 test_src: src/Tests/*.hs
40 ghc $(GHC_OPTS) src/*.hs src/Tests/*.hs
41
42 profile: src/*.hs
43 ghc -optc-O3 -optc-march=native $(GHC_OPTS) -prof -auto-all -caf-all src/*.hs
44
45 profile-llvm: src/*.hs
46 ghc -fllvm $(GHC_OPTS) -prof -auto-all -caf-all src/*.hs
47
48 clean:
49 rm -f bin/$(BIN)
50 rm -f $(TMPDIR)/*.hi
51 rm -f $(TMPDIR)/*.o
52 rm -f *.prof
53 rm -rf doc/html/*
54
55 test:
56 runghc -i"src" test/TestSuite.hs
57
58
59 src_html:
60 util/hscolour_srcs
61
62
63 DOCS := -i /usr/share/doc/ghc-*/html/libraries/base-*/base.haddock
64 DOCS += -i /usr/share/doc/ghc-*/html/libraries/ghc-prim-*/ghc-prim.haddock
65 DOCS += -i /usr/share/doc/ghc-*/html/libraries/haskell98-*/haskell98.haddock
66 DOCS += -i /usr/share/doc/storable-complex-*/html/storable-complex.haddock
67 DOCS += -i /usr/share/doc/quickcheck-*/html/QuickCheck.haddock
68 DOCS += -i /usr/share/doc/hmatrix-*/html/hmatrix.haddock
69 DOCS += -i /usr/share/doc/hunit-*/html/HUnit.haddock
70
71
72 HTMLS := /usr/share/doc/ghc-*/html/libraries/base-*/*.html
73 HTMLS += /usr/share/doc/ghc-*/html/libraries/ghc-prim-*/*.html
74 HTMLS += /usr/share/doc/ghc-*/html/libraries/haskell98-*/*.html
75 HTMLS += /usr/share/doc/quickcheck-*/html/*.html
76 HTMLS += /usr/share/doc/hunit-*/html/*.html
77 HTMLS += /usr/share/doc/storable-complex-*/html/*.html
78 HTMLS += /usr/share/doc/hmatrix-*/html/*.html
79
80 HSCOLOUR_SRCS := /usr/share/doc/ghc-*/html/libraries/base-*/src/*
81 HSCOLOUR_SRCS += /usr/share/doc/ghc-*/html/libraries/ghc-prim-*/src/*
82 HSCOLOUR_SRCS += /usr/share/doc/ghc-*/html/libraries/haskell98-*/src/*
83 HSCOLOUR_SRCS += /usr/share/doc/hmatrix-*/html/src/*
84
85 doc: src_html
86 cp -n $(HTMLS) ./doc/html/
87 cp -n $(HSCOLOUR_SRCS) ./doc/html/src/
88 haddock $(DOCS) --html --use-unicode \
89 --odir=doc/html/ --title="spline3" \
90 --source-module="src/%{MODULE/.//}.html" \
91 --source-entity="src/%{MODULE/.//}.html#%{NAME}" \
92 src/*.hs src/Tests/*.hs
93
94 SSH_USER=root@michael.orlitzky.com
95 PUBLIC_DOCDIR=/var/www/orlitzky.com/michael/public/spline3/
96 publish_doc: doc
97 rsync -avz -e ssh ./doc/html/ $(SSH_USER):$(PUBLIC_DOCDIR)
98
99 hlint:
100 hlint --ignore="Use camelCase" \
101 --ignore="Redundant bracket" \
102 --color \
103 src