summaryrefslogtreecommitdiff
path: root/Makefile
blob: 3abc4f21630519274b0ec8b51bc2fa11009637b2 (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
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

format:
	find src -name "*.cpp" -o -name "*.hpp" | xargs clang-format -i

.PHONY: stub release debug clean all install uninstall format