-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (27 loc) · 1.29 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
GHCFLAGS=-Wall -XNoCPP -fno-warn-name-shadowing -XHaskell98 -O2
HLINTFLAGS=-XHaskell98 -XNoCPP -i 'Use camelCase' -i 'Use String' -i 'Use head' -i 'Use string literal' -i 'Use list comprehension' --utf8
VERSION=0.6
.PHONY: all clean doc install
all: report.html doc dist/build/routeGenerator/routeGenerator dist/routeGenerator-$(VERSION).tar.gz
install: dist/build/routeGenerator/routeGenerator
cabal install
report.html: routeGenerator.hs
-hlint $(HLINTFLAGS) --report $^
doc: dist/doc/html/routeGenerator/index.html README
README: route-generator.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/routeGenerator/index.html: dist/setup-config routeGenerator.hs
-cabal haddock --hyperlink-source --executables
dist/setup-config: route-generator.cabal
cabal configure
clean:
find -name '*.o' -o -name '*.hi' | xargs $(RM)
$(RM) -r dist dist-ghc
dist/build/routeGenerator/routeGenerator: route-generator.cabal dist/setup-config routeGenerator.hs
cabal build --ghc-options="$(GHCFLAGS)"
dist/routeGenerator-$(VERSION).tar.gz: route-generator.cabal dist/setup-config README routeGenerator.hs
cabal check
cabal sdist