-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
42 lines (30 loc) · 1.46 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
42
GHCFLAGS=-Wall -fno-warn-tabs -fno-warn-name-shadowing -XHaskell2010
HLINTFLAGS=-XHaskell2010 -XCPP -i 'Use camelCase' -i 'Use String' -i 'Use string literal' -i 'Use list comprehension'
VERSION=0.5.1
.PHONY: all clean doc install test
all: report.html test doc dist/build/libHSunexceptionalio-$(VERSION).a dist/unexceptionalio-$(VERSION).tar.gz
install: dist/build/libHSunexceptionalio-$(VERSION).a
cabal install
report.html: UnexceptionalIO.hs
-hlint $(HLINTFLAGS) --report UnexceptionalIO.hs
doc: dist/doc/html/unexceptionalio/index.html README
test: UnexceptionalIO.hs tests/suite.hs
runhaskell -- $(GHCFLAGS) -fno-warn-missing-methods -fno-warn-missing-fields tests/suite.hs
README: unexceptionalio.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/unexceptionalio/index.html: dist/setup-config UnexceptionalIO.hs
cabal haddock --hyperlink-source
dist/setup-config: unexceptionalio.cabal
cabal configure
clean:
find -name '*.o' -o -name '*.hi' | xargs $(RM)
$(RM) report.html
$(RM) -r dist dist-ghc
dist/build/libHSunexceptionalio-$(VERSION).a: unexceptionalio.cabal dist/setup-config UnexceptionalIO.hs
cabal build --ghc-options="$(GHCFLAGS)"
dist/unexceptionalio-$(VERSION).tar.gz: unexceptionalio.cabal dist/setup-config UnexceptionalIO.hs README
cabal check
cabal sdist