This repository has been archived by the owner on Oct 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
68 lines (51 loc) · 1.47 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
65
66
67
68
all: build
marquised: dist/build/marquised/marquised
data: dist/build/data/data
#
# Setup
#
ifdef V
MAKEFLAGS=-R
else
MAKEFLAGS=-s -R
REDIRECT=2>/dev/null
endif
.PHONY: all build test
#
# Build rules. This just wraps Cabal doing its thing in a Haskell
# language-specific fashion.
#
build: dist/setup-config tags
@/bin/echo -e "CABAL\tbuild"
cabal build
test: dist/setup-config tags
@/bin/echo -e "CABAL\ttest"
cabal test
dist/setup-config: marquise.cabal Setup.hs
cabal configure \
--enable-tests \
--enable-benchmarks \
-v0 2>/dev/null || /bin/echo -e "CABAL\tinstall --only-dependencies" && cabal install --only-dependencies --enable-tests --enable-benchmarks
@/bin/echo -e "CABAL\tconfigure"
cabal configure \
--enable-tests \
--enable-benchmarks \
--disable-library-profiling \
--disable-executable-profiling
SOURCES=$(shell find src -name '*.hs' -type f)\
$(shell find lib -name '*.hs' -type f)
# 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 $@)
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:
cabal clean
-rm src/Package.hs