-
Notifications
You must be signed in to change notification settings - Fork 33
/
Makefile
54 lines (40 loc) · 834 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
NAME=gbemu
BUILD_DIR=build
.PHONY: default
default: release tags
#################
# Utility targets
#################
.PHONY: build-dir
build-dir:
@mkdir -p $(BUILD_DIR)
.PHONY: rebuild
rebuild: clean release tags
.PHONY: compile
compile:
@cd $(BUILD_DIR) && make
.PHONY: clean
clean:
@rm -rf $(BUILD_DIR)
.PHONY: tags
tags:
@ctags .
.PHONY: format
format:
@./scripts/clang-format
.PHONY: tidy
tidy: debug
@./scripts/clang-tidy
###################
# Commands to build
###################
.PHONY: cmake-debug
cmake-debug: build-dir
@cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=on ..
.PHONY: cmake-release
cmake-release: build-dir
@cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=Release ..
.PHONY: debug
debug: cmake-debug compile
.PHONY: release
release: cmake-release compile