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