]> gitweb.michael.orlitzky.com - spline3.git/blob - makefile
spline3.cabal: bump version to 1.0.2
[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 -Wno-missing-kind-signatures \
21 -rtsopts \
22 -threaded
23
24 .PHONY : test doc dist hlint
25
26 $(BIN): $(PN).cabal $(SRCS)
27 runghc Setup.hs configure --user --prefix=/
28 runghc Setup.hs build --ghc-options="${HCFLAGS}"
29
30 $(DOCTESTS_BIN): $(SRCS) test/Doctests.hs
31 runghc Setup.hs configure --user --prefix=/ --enable-tests
32 runghc Setup.hs build --ghc-options="${HCFLAGS}"
33
34 $(TESTSUITE_BIN): $(SRCS) test/TestSuite.hs
35 runghc Setup.hs configure --user --prefix=/ --enable-tests
36 runghc Setup.hs build --ghc-options="${HCFLAGS}"
37
38 clean:
39 runghc Setup.hs clean
40 rm -rf dist/
41 rm -f *.prof
42 rm -f .hpc
43
44 check: $(PN).cabal $(TESTSUITE_BIN) $(DOCTESTS_BIN) $(BIN)
45 runghc Setup.hs test
46
47 dist:
48 runghc Setup.hs configure --prefix=/
49 TAR_OPTIONS="--format=ustar" runghc Setup.hs sdist
50
51 doc: dist/doc
52
53 dist/doc: $(PN).cabal $(SRCS)
54 runghc Setup.hs configure --user --prefix=/
55 runghc Setup.hs haddock --all \
56 --hyperlink-source \
57 --haddock-options="--ignore-all-exports"
58
59 hlint:
60 hlint --ignore="Use camelCase" \
61 --ignore="Redundant bracket" \
62 --color \
63 src