-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
55 lines (45 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
43
44
45
46
47
48
49
50
51
52
53
54
55
DEBUG_BUILD_DIR := 'cmake-build-debug'
RELEASE_BUILD_DIR := 'cmake-build-release'
.PHONY: phony
phony: ;
.PHONY: debug
debug:
mkdir -p ${DEBUG_BUILD_DIR}
cd ${DEBUG_BUILD_DIR} && \
export CXX=clang++ && \
cmake -DCMAKE_BUILD_TYPE=Debug .. && \
make -j 2
.PHONY: release
release:
mkdir -p ${RELEASE_BUILD_DIR}
cd ${RELEASE_BUILD_DIR} && \
export CXX=clang++ && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j 2
.PHONY: all
all: release debug
.PHONY: scan-debug
scan-debug:
mkdir -p ${DEBUG_BUILD_DIR}
cd ${DEBUG_BUILD_DIR} && \
export CXX=clang++ && \
scan-build cmake -DCMAKE_BUILD_TYPE=Debug .. && \
scan-build make
.PHONY: scan-release
scan-release:
mkdir -p ${RELEASE_BUILD_DIR}
cd ${RELEASE_BUILD_DIR} && \
export CXX=clang++ && \
scan-build cmake -DCMAKE_BUILD_TYPE=Release .. && \
scan-build make
.PHONY: format
format:
zsh -c 'clang-format -i -style=LLVM src/hoshizora/**/*.(h|cpp)'
.PHONY: clean-debug
clean-debug:
rm -rf ${DEBUG_BUILD_DIR}
.PHONY: clean-release
clean-release:
rm -rf ${RELEASE_BUILD_DIR}
.PHONY: clean
clean: clean-debug clean-release