-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (55 loc) · 1.52 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
69
70
all: ghc-build proof-trees
################################################################
# GHC
GHC = ghc -Wall
OUT = tmp
# Build everything, even if it's not all used in 'Test' yet.
.PHONY: ghc-build
ghc-build:
mkdir -p $(OUT) && \
$(GHC) \
-main-is Data.Function.Decorator.Test \
-isrc \
-outputdir $(OUT) \
-o $(OUT)/Test \
$(shell find src -name '*.hs')
.PHONY: ghc-build-opt
ghc-build-opt: GHC := $(GHC) -O2
ghc-build-opt: OUT := $(OUT)/opt
ghc-build-opt: ghc-build
################################################################
# Cabal sandbox
.cabal-sandbox cabal.sandbox.config:
cabal sandbox init
.PHONY: cabal-sandbox-install
cabal-sandbox-install: .cabal-sandbox cabal.sandbox.config
cabal install $(CABAL_OPTS)
.PHONY: cabal-sandbox-install-prof
cabal-sandbox-install-prof: \
CABAL_OPTS += --ghc-options="-fprof-auto" \
--builddir=prof-dist \
--disable-optimization
cabal-sandbox-install-prof: cabal-sandbox-install
################################################################
# Misc
# Does not work for literate Haskell; see spire.git/Makefile if you
# need that.
.PHONY: tags
tags: tmp
-rm tmp/TAGS
cd tmp \
&& find ../src \
-name '*.hs' -print \
| xargs hasktags --etags
# Print the module names corresponding to the source files.
.PHONY: modules
modules:
find src -name '*.hs' | sed -re 's|src/|import |' -e 's|/|.|g' -e 's/.hs//'
.PHONY: clean
clean:
-rm -rf tmp
tmp:
mkdir -p tmp
# Build the proof-trees code.
proof-trees:
$(MAKE) -C experiments/proof-trees