-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
45 lines (35 loc) · 762 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
SHELL := /bin/bash
default:
.PHONY: default
default: build\:false
cd build; ./fortress-commander
.PHONY: test
test: build\:true
cd build; ./fortress-commander_TEST
.PHONY: build
build\:%: cmake\:%
cd build; make -j8
# usage cmake:true for testing, cmake:false otherwise
.PHONY: cmake\:%
cmake\:%: buildfolder
cd build; cmake -DTEST=$* ..
.PHONY: buildfolder
buildfolder:
[[ -d build ]] || mkdir build
.PHONY: format
format:
clang-format -i src/*.cpp src/*.h src/*/*.cpp src/*/*.h
.PHONY: clean
clean:
rm -rf build
.PHONY: cpp
cpp:
@python3 checker.py
.PHONY: gdb
gdb:
gdb build/fortress-commander
.PHONY: profile
profile: build\:true
valgrind --tool=callgrind build/fortress-commander_TEST
kcachegrind callgrind.out.*
rm -f callgrind.out.*