Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c75a327037
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 60 lines (41 sloc) 1.918 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
GHCFLAGS=-Wall -XNoCPP -fno-warn-name-shadowing -XHaskell98
HLINTFLAGS=-XHaskell98 -XNoCPP -i 'Use camelCase' -i 'Use String' -i 'Use head' -i 'Use string literal' -i 'Use list comprehension' --utf8
VERSION=0.3

.PHONY: all clean doc install debian test

all: sign verify keygen test report.html doc dist/build/libHSopenpgp-Crypto-$(VERSION).a dist/openpgp-Crypto-$(VERSION).tar.gz

install: dist/build/libHSopenpgp-Crypto-$(VERSION).a
cabal install

debian: debian/control

test: tests/suite
tests/suite

sign: examples/sign.hs Data/OpenPGP/Crypto.hs
ghc --make $(GHCFLAGS) -o $@ $^

verify: examples/verify.hs Data/OpenPGP/Crypto.hs
ghc --make $(GHCFLAGS) -o $@ $^

keygen: examples/keygen.hs Data/OpenPGP/Crypto.hs
ghc --make $(GHCFLAGS) -o $@ $^

tests/suite: tests/suite.hs Data/OpenPGP/Crypto.hs
ghc --make $(GHCFLAGS) -o $@ $^

report.html: examples/*.hs Data/OpenPGP/Crypto.hs tests/suite.hs
-hlint $(HLINTFLAGS) --report Data examples

doc: dist/doc/html/openpgp-Crypto/index.html README

README: openpgp-Crypto.cabal
tail -n+$$(( `grep -n ^description: $^ | head -n1 | cut -d: -f1` + 1 )) $^ > .$@
head -n+$$(( `grep -n ^$$ .$@ | head -n1 | cut -d: -f1` - 1 )) .$@ > $@
-printf ',s/ //g\n,s/^.$$//g\nw\nq\n' | ed $@
$(RM) .$@

dist/doc/html/openpgp-Crypto/index.html: dist/setup-config Data/OpenPGP/Crypto.hs
cabal haddock --hyperlink-source

dist/setup-config: openpgp-Crypto.cabal
cabal configure

clean:
find -name '*.o' -o -name '*.hi' | xargs $(RM)
$(RM) sign verify keygen tests/suite report.html
$(RM) -r dist dist-ghc

debian/control: openpgp-Crypto.cabal
cabal-debian --update-debianization

dist/build/libHSopenpgp-Crypto-$(VERSION).a: openpgp-Crypto.cabal dist/setup-config Data/OpenPGP/Crypto.hs
cabal build --ghc-options="$(GHCFLAGS)"

dist/openpgp-Crypto-$(VERSION).tar.gz: openpgp-Crypto.cabal dist/setup-config Data/OpenPGP/Crypto.hs README
cabal check
cabal sdist
Something went wrong with that request. Please try again.