forked from singpolyma/cheogram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (29 loc) · 1.19 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 -Wno-tabs -fno-warn-name-shadowing -XHaskell2010 -O2
HLINTFLAGS=-XHaskell2010 -XCPP -i 'Use camelCase' -i 'Use String' -i 'Use head' -i 'Use string literal' -i 'Use list comprehension' --utf8
VERSION=0.6
.PHONY: all shell clean doc install
all: report.html doc dist/build/libHScheogram-$(VERSION).a dist/cheogram-$(VERSION).tar.gz
install: dist/build/libHScheogram-$(VERSION).a
cabal install
shell:
ghci $(GHCFLAGS)
report.html: Main.hs
-hlint $(HLINTFLAGS) --report $^
doc: dist/doc/html/cheogram/index.html README
README: cheogram.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/cheogram/index.html: dist/setup-config Main.hs
cabal haddock --hyperlink-source
dist/setup-config: cheogram.cabal
cabal configure
clean:
find -name '*.o' -o -name '*.hi' | xargs $(RM)
$(RM) -r dist
dist/build/libHScheogram-$(VERSION).a: dist/setup-config Main.hs
cabal build --ghc-options="$(GHCFLAGS)"
dist/cheogram-$(VERSION).tar.gz: README dist/setup-config Main.hs
cabal check
cabal sdist