-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
41 lines (29 loc) · 1.42 KB
/
Makefile
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
GHCFLAGS=-Wall -fno-warn-name-shadowing -XHaskell98 -O2
HLINTFLAGS=-XHaskell98 -XCPP -i 'Use camelCase' -i 'Use String' -i 'Use head' -i 'Use string literal' -i 'Use list comprehension' --utf8
VERSION=0.3
.PHONY: all shell clean doc install
all: report.html doc dist/build/libHSripple-$(VERSION).a dist/ripple-$(VERSION).tar.gz
install: dist/build/libHSripple-$(VERSION).a
cabal install
shell:
ghci $(GHCFLAGS)
report.html: Ripple/Amount.hs Ripple/Seed.hs Ripple/Transaction.hs Ripple/WebSockets.hs
-hlint $(HLINTFLAGS) --report $^
doc: dist/doc/html/ripple/index.html README
README: ripple.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\n,s/\\\\\\//\\//g\nw\nq\n' | ed $@
$(RM) .$@
dist/doc/html/ripple/index.html: dist/setup-config Ripple/Amount.hs Ripple/Seed.hs Ripple/Transaction.hs Ripple/WebSockets.hs
cabal haddock --hyperlink-source
dist/setup-config: ripple.cabal
cabal configure
clean:
find -name '*.o' -o -name '*.hi' | xargs $(RM)
$(RM) -r dist
dist/build/libHSripple-$(VERSION).a: dist/setup-config Ripple/Amount.hs Ripple/Seed.hs Ripple/Transaction.hs Ripple/WebSockets.hs
cabal build --ghc-options="$(GHCFLAGS)"
dist/ripple-$(VERSION).tar.gz: README dist/setup-config Ripple/Amount.hs Ripple/Seed.hs Ripple/Transaction.hs Ripple/WebSockets.hs
cabal check
cabal sdist