diff options
author | Stephen Paul Weber <singpolyma@singpolyma.net> | 2011-08-10 19:14:54 -0500 |
---|---|---|
committer | Stephen Paul Weber <singpolyma@singpolyma.net> | 2011-08-10 19:14:54 -0500 |
commit | d807b5d3368e6295e8c9a4bac8647d40c2933dd2 (patch) | |
tree | f69224eab323302e39a4e8df8537f3868d480469 /Makefile | |
parent | 2da339aed62d75647dc052e978b099ed2dac05ac (diff) |
Build more stuff with make
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 34 |
1 files changed, 29 insertions, 5 deletions
@@ -1,15 +1,23 @@ | |||
1 | GHCFLAGS=-Wall -XNoCPP -fno-warn-name-shadowing -XHaskell98 | 1 | GHCFLAGS=-Wall -XNoCPP -fno-warn-name-shadowing -XHaskell98 |
2 | HLINTFLAGS=-XHaskell98 -XNoCPP -i 'Use camelCase' -i 'Use String' -i 'Use head' -i 'Use string literal' -i 'Use list comprehension' --utf8 | 2 | HLINTFLAGS=-XHaskell98 -XNoCPP -i 'Use camelCase' -i 'Use String' -i 'Use head' -i 'Use string literal' -i 'Use list comprehension' --utf8 |
3 | 3 | ||
4 | .PHONY: all cleas | 4 | .PHONY: all clean doc install |
5 | 5 | ||
6 | all: verify report.html README | 6 | all: sign verify report.html doc dist/build/libHSopenpgp-0.1.a dist/openpgp-0.1.tar.gz |
7 | |||
8 | install: dist/build/libHSopenpgp-0.1.a | ||
9 | cabal install | ||
10 | |||
11 | sign: examples/sign.hs | ||
12 | ghc --make $(GHCFLAGS) -o $@ $^ | ||
7 | 13 | ||
8 | verify: examples/verify.hs | 14 | verify: examples/verify.hs |
9 | ghc --make $(GHCFLAGS) -o $@ $^ | 15 | ghc --make $(GHCFLAGS) -o $@ $^ |
10 | 16 | ||
11 | report.html: | 17 | report.html: examples/* Data/* Data/OpenPGP/* |
12 | hlint $(HLINTFLAGS) --report Data examples | 18 | hlint $(HLINTFLAGS) --report Data examples || true |
19 | |||
20 | doc: dist/doc/html/openpgp/index.html README | ||
13 | 21 | ||
14 | README: openpgp.cabal | 22 | README: openpgp.cabal |
15 | tail -n+$$(( `grep -n ^description: $^ | head -n1 | cut -d: -f1` + 1 )) $^ > .$@ | 23 | tail -n+$$(( `grep -n ^description: $^ | head -n1 | cut -d: -f1` + 1 )) $^ > .$@ |
@@ -17,6 +25,22 @@ README: openpgp.cabal | |||
17 | printf ',s/ //g\n,s/^.$$//g\nw\nq\n' | ed $@ | 25 | printf ',s/ //g\n,s/^.$$//g\nw\nq\n' | ed $@ |
18 | $(RM) .$@ | 26 | $(RM) .$@ |
19 | 27 | ||
28 | dist/doc/html/openpgp/index.html: dist/setup-config Data/OpenPGP.hs Data/OpenPGP/Crypto.hs | ||
29 | cabal haddock --hyperlink-source | ||
30 | |||
31 | dist/setup-config: | ||
32 | cabal configure | ||
33 | |||
20 | clean: | 34 | clean: |
21 | find -name '*.o' -o -name '*.hi' | xargs $(RM) | 35 | find -name '*.o' -o -name '*.hi' | xargs $(RM) |
22 | $(RM) verify | 36 | $(RM) sign verify |
37 | $(RM) -r dist | ||
38 | |||
39 | # The following need to be changed on version change | ||
40 | |||
41 | dist/build/libHSopenpgp-0.1.a: openpgp.cabal dist/setup-config Data/BaseConvert.hs Data/OpenPGP.hs Data/OpenPGP/Crypto.hs | ||
42 | cabal build | ||
43 | |||
44 | dist/openpgp-0.1.tar.gz: openpgp.cabal dist/setup-config Data/BaseConvert.hs Data/OpenPGP.hs Data/OpenPGP/Crypto.hs README | ||
45 | cabal check | ||
46 | cabal sdist | ||