-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (49 loc) · 1.44 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
all: build
.PHONY: all build test
build: dist/setup-config tags
@/bin/echo -e "CABAL\tbuild"
cabal build
check: test
test: dist/setup-config tags
@/bin/echo -e "CABAL\ttest"
cabal test
dist/setup-config: nagios-check.cabal
cabal configure \
--enable-tests \
--disable-benchmarks \
-v0 2>/dev/null || /bin/echo -e "CABAL\tinstall --only-dependencies" && cabal install --only-dependencies --enable-tests --disable-benchmarks
@/bin/echo -e "CABAL\tconfigure"
cabal configure \
--enable-tests \
--disable-benchmarks \
--disable-library-profiling \
--disable-executable-profiling
# This will match writer-test/writer-test, so we have to strip the directory
# portion off. Annoying, but you can't use two '%' in a pattern rule.
dist/build/%: dist/setup-config tags $(SOURCES)
@/bin/echo -e "CABAL\tbuild $@"
cabal build $(notdir $@)
#
# Build ctags file
#
SOURCES=$(shell find lib -name '*.hs' -type f) \
$(shell find tests -name '*.hs' -type f) \
$(shell find lib -name '*.hs' -type f)
HOTHASKTAGS=$(shell which hothasktags 2>/dev/null)
CTAGS=$(if $(HOTHASKTAGS),$(HOTHASKTAGS),/bin/false)
tags: $(SOURCES)
if [ "$(HOTHASKTAGS)" ] ; then /bin/echo -e "CTAGS\ttags" ; fi
-$(CTAGS) $^ > tags $(REDIRECT)
format: $(SOURCES)
stylish-haskell -i $^
clean:
@/bin/echo -e "CABAL\tclean"
-cabal clean >/dev/null
@/bin/echo -e "RM\ttemporary files"
-rm -f tags
-rm -f *.prof
-rm -f lib/Package.hs
doc:
cabal haddock
install:
cabal install