-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathMakefile
41 lines (31 loc) · 1.35 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
default: help
# The general philosophy and functionality of this makefile is shamelessly stolen from compiler explorer
help: # with thanks to Ben Rady
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: build
build: debug ## build in debug mode
.PHONY: debug
debug: ## build in debug mode
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLIBASSERT_BUILD_TESTING=On -DLIBASSERT_WERROR_BUILD=On
cmake --build build
.PHONY: release
release: ## build in release mode (with debug info)
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLIBASSERT_BUILD_TESTING=On -DLIBASSERT_WERROR_BUILD=On
cmake --build build
.PHONY: debug-msvc
debug-msvc: ## build in debug mode
cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLIBASSERT_BUILD_TESTING=On
cmake --build build --config Debug
.PHONY: release-msvc
release-msvc: ## build in release mode (with debug info)
cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLIBASSERT_BUILD_TESTING=On
cmake --build build --config RelWithDebInfo
.PHONY: clean
clean: ## clean
rm -rf build
.PHONY: test
test: debug ## test
cd build && ninja test
.PHONY: test-release
test-release: release ## test-release
cd build && ninja test