-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (43 loc) · 1.21 KB
/
Copy pathMakefile
File metadata and controls
55 lines (43 loc) · 1.21 KB
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
#EXTRA_CMAKE_FLAGS=-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
BUILD_GEN=-G Ninja
.PHONY: all
all:
cat README.md
.PHONY: clean
clean:
rm -rf build-*
# XXX it would be nice to conditionally run setup-* iif a cmake file was changed or
# the directory didn't exist to begin with
# Debug
.PHONY: setup-debug
setup-debug:
mkdir build-debug || :
cd build-debug && cmake $(BUILD_GEN) -DCMAKE_BUILD_TYPE=Debug .. $(EXTRA_CMAKE_FLAG)
.PHONY: build-debug
build-debug: setup-debug
cmake --build build-debug
.PHONY: test-debug
test-debug: build-debug
cd build-debug && ctest
# Release
.PHONY: setup-release
setup-release:
mkdir build-release || :
cd build-release && cmake $(BUILD_GEN) -DCMAKE_BUILD_TYPE=Release .. $(EXTRA_CMAKE_FLAG)
.PHONY: build-release
build-release: setup-release
cmake --build build-release
.PHONY: test-release
test-release: build-release
cd build-release && ctest
# Coverage
.PHONY: setup-coverage
setup-coverage:
mkdir build-coverage || :
cd build-coverage && cmake $(BUILD_GEN) -DCMAKE_BUILD_TYPE=Coverage .. $(EXTRA_CMAKE_FLAG)
.PHONY: build-coverage
build-coverage: setup-coverage
cmake --build build-coverage
.PHONY: test-coverage
test-coverage: build-coverage
cd build-coverage && ctest