-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (29 loc) · 695 Bytes
/
Copy pathMakefile
File metadata and controls
37 lines (29 loc) · 695 Bytes
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
GHCFLAGS=-W -Werror
BINARIES=Cat.out Wc.out \
Mem1.debug.ps \
Mem1.ps \
Mem2.debug.ps \
Mem2.ps \
Mem3.debug.ps \
Mem3.ps \
MutualTailRecursion.ps \
ProblemThirtyEight.debug.out
.PHONY: all
all: lint $(BINARIES) test
# Profile with ./ProgramName +RTS -h -p; hp2ps ProgName.hp
%.debug.out: %.hs
ghc $(GHCFLAGS) -prof -fprof-auto -rtsopts $^ -o "$@"
%.out: %.hs
ghc $(GHCFLAGS) -O2 -rtsopts $^ -o "$@" && strip $@
%.ps: %.out
rm -f "$<".hp ; ./"$<" +RTS -h; hp2ps -c "$<".hp ; mv "$*".out.ps "$@"
%.prof: %.out
./"$<" +RTS -p
.PHONY: lint
lint:
hlint .
.PHONY: test
test: $(BINARIES)
./testsuite/runtests.sh
clean:
rm -f *~ $(BINARIES) *.o *.prof *.hi *.hp *.ps *.aux *.out