summaryrefslogtreecommitdiff
path: root/Makefile
blob: 65fa99eb277626a6ce2009c48d1517d78b932c75 (plain)
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
PREFIX ?= /usr/local

stub:
	@echo "Use 'make release' or 'make debug' to build the project."

release:
	cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} -S . -B ./build
	cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`

debug:
	cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} -S . -B ./build
	cmake --build ./build --config Debug --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`

clean:
	rm -rf build

all:
	$(MAKE) clean
	$(MAKE) release

install:
	cmake --install ./build

uninstall:
	xargs rm < ./build/install_manifest.txt

clang-format:
	cmake --build ./build --target clang-format

clang-tidy:
	cmake --build ./build --target clang-tidy

.PHONY: stub release debug clean all install uninstall format