]> gitweb.michael.orlitzky.com - spline3.git/blob - makefile
spline3.cabal: update to v1.0.1.
[spline3.git] / makefile
1 PN = spline3
2 BIN = dist/build/$(PN)/$(PN)
3 SRCS := $(shell find src/ -type f -name '*.hs')
4
5 BIN = dist/build/spline3/spline3
6 DOCTESTS_BIN = dist/build/doctests/doctests
7 TESTSUITE_BIN = dist/build/testsuite/testsuite
8
9 # Append these warnings to the HCFLAGS environment variable that gets
10 # passed as options to GHC. We want to see the warnings while developing
11 # but don't want them hard-coded in the cabal file for end users.
12 HCFLAGS += -Weverything \
13 -Wno-implicit-prelude \
14 -Wno-safe \
15 -Wno-unsafe \
16 -Wno-all-missed-specialisations \
17 -Wno-prepositive-qualified-module \
18 -Wno-missing-safe-haskell-mode \
19 -Wno-missing-deriving-strategies \
20 -rtsopts \
21 -threaded
22
23 .PHONY : test doc dist hlint
24
25 $(BIN): $(PN).cabal $(SRCS)
26 runghc Setup.hs configure --user --prefix=/
27 runghc Setup.hs build --ghc-options="${HCFLAGS}"
28
29 $(DOCTESTS_BIN): $(SRCS) test/Doctests.hs
30 runghc Setup.hs configure --user --prefix=/ --enable-tests
31 runghc Setup.hs build --ghc-options="${HCFLAGS}"
32
33 $(TESTSUITE_BIN): $(SRCS) test/TestSuite.hs
34 runghc Setup.hs configure --user --prefix=/ --enable-tests
35 runghc Setup.hs build --ghc-options="${HCFLAGS}"
36
37 clean:
38 runghc Setup.hs clean
39 rm -rf dist/
40 rm -f *.prof
41 rm -f .hpc
42
43 check: $(PN).cabal $(TESTSUITE_BIN) $(DOCTESTS_BIN) $(BIN)
44 runghc Setup.hs test
45
46 dist:
47 runghc Setup.hs configure --prefix=/
48 TAR_OPTIONS="--format=ustar" runghc Setup.hs sdist
49
50 doc: dist/doc
51
52 dist/doc: $(PN).cabal $(SRCS)
53 runghc Setup.hs configure --user --prefix=/
54 runghc Setup.hs haddock --all \
55 --hyperlink-source \
56 --haddock-options="--ignore-all-exports"
57
58 hlint:
59 hlint --ignore="Use camelCase" \
60 --ignore="Redundant bracket" \
61 --color \
62 src