-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (31 loc) · 1.08 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
probatsrc = subs/probat/*.d
# sadly the order matters
gllsrc = src/gll.d src/grammar.d src/data.d src/util.d
testsrc = tests/*d
main = src/main.d
testmain = tests/testmain.d
DC ?= dmd
commonflags = -Isubs
testflags = -debug -unittest -g
releaseflags = -release -O -inline -noboundscheck
devflags = -debug -g
.PHONY: test runtest release dev
dev: build/dev
build/dev: $(gllsrc) $(probatsrc) ${main}
- mkdir build 2> /dev/null
${DC} $(commonflags) $(devflags) -ofbuild/dev -odbuild $(FLAGS) ${gllsrc} ${main}
test: build/test
build/test: $(gllsrc) $(testsrc)
- mkdir build 2> /dev/null
${DC} -ofbuild/test -odbuild $(commonflags) $(testflags) $(FLAGS) $(gllsrc) $(testsrc) ${probatsrc}
runtest: build/test
build/test $(P)
release: build/release
build/release: $(gllsrc) $(main)
- mkdir build 2> /dev/null
${DC} $(commonflags) -ofbuild/gllgen -od/build $(releaseflags) $(FLAGS) $(gllsrc) $(main)
stest: ${gllsrc} ${probatsrc} ${testmain}
- mkdir build 2> /dev/null
${DC} $(commonflags) $(testflags) ${FLAGS} ${gllsrc} ${testmain} ${probatsrc} tests/${T}.d -ofbuild/${T}
clean:
rm -rf build