-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
68 lines (52 loc) · 1.74 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: production
# Deps must be manually installed once.
deps: lib-she
production: cabal-install
debug: cabal-install-debug
test:
mkdir -p tmp
cd src && runhaskell PatternUnify/Test.lhs 2>&1 | tee ../tmp/test.out
! grep FAIL tmp/test.out
######################################################################
cabal-install: src/dist
cabal-install-debug: src/prof-dist
SOURCE = $(shell find src -name '*.lhs')
CABAL_INSTALL = \
( cd src \
&& cabal install $(CABAL_OPTIONS) ) \
|| { touch --date "@0" $@ ; \
exit 42 ; }
src/dist: CABAL_OPTIONS += -O
src/dist: $(SOURCE)
$(CABAL_INSTALL)
# Build in a non-default dir, so that we can have debug and non-debug
# versions compiled at the same time.
#
# Added '--disable-optimization' because '-O' messes with
# 'Debug.Trace.trace' and other 'unsafePerformIO' hacks.
src/prof-dist: CABAL_OPTIONS += --ghc-options="-fprof-auto" --builddir=prof-dist --disable-optimization
src/prof-dist: $(SOURCE)
$(CABAL_INSTALL)
######################################################################
clean:
-rm -rf src/dist src/prof-dist
lib/she.git:
git clone git@github.com:ntc2/she.git lib/she.git
lib-she: lib/she.git
-cd lib/she.git \
&& cabal install
######################################################################
# Before reinstalling all my libraries with profiling support I needed
# to use the --only install here (which prevents cabal from doing
# automatic dependency resolution) to avoid problems with conflicting
# reinstalls of Replib or unbound.
#
# Leaving these around in case those problems come back, in which case
# `make cabal-only-install` should be used.
cabal-only-install: cabal-build
cd src \
&& cabal --only install
cabal-build:
cd src \
&& cabal configure \
&& cabal build