-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (42 loc) · 975 Bytes
/
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
buildDir := build
testDir := src/test
buildSystem := ninja
ifeq ($(buildSystem),ninja)
buildSystemGenerated := Ninja
else
buildSystemGenerated := Unix Makefiles
endif
buildType := Debug
cmakeFiles := $(shell find src/cmake -name "*.cmake")
all: build
cmake: CMakeLists.txt $(cmakeFiles)
cmake -B $(buildDir) -G "$(buildSystemGenerated)" \
-DCMAKE_BUILD_TYPE=$(buildType)
.PHONY: cmake
pass: cmake
cd $(buildDir) && $(buildSystem) pass
.PHONY: pass
runtime: cmake
cd $(buildDir) && $(buildSystem) runtime
.PHONY: runtime
main: cmake
cd $(buildDir) && $(buildSystem) main
.PHONY: main
test: main
cd $(buildDir) && $(buildSystem) test
.PHONY: test
build: test
.PHONY: build
tests: main $(testDir)/Makefile
cd $(testDir) && make -r
.PHONY: tests
cleanCmake:
cd $(buildDir) && $(buildSystem) clean
.PHONY: cleanCmake
cleanTests:
cd $(testDir) && make -r clean
.PHONY: cleanTests
clean: cleanCmake cleanTests
fullClean:
rm -rf $(buildDir)
.PHONY: fullClean