summary refs log tree commit diff
path: root/Makefile
blob: b4af63fb0136cbf8018bb304db2be20c83f97f23 (plain) (blame)
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
SRC := $(shell find include src -type f -type f \( -iname "*.cc" -o -iname "*.h" \))

# Linux specific helpers
debug:
	@cmake -DBUILD_TESTS=OFF -H. -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Debug
	@cmake --build build


release-debug:
	@cmake -DBUILD_TESTS=OFF -H. -GNinja -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo
	@cmake --build build

test:
	@cmake -DBUILD_TESTS=ON -H. -GNinja -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo
	@cmake --build build
	@cd build && GTEST_COLOR=1 ctest --verbose

# MacOS specific helpers
mdebug:
	@cmake -DBUILD_TESTS=OFF \
		-H. \
		-GNinja \
		-Bbuild \
		-DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 \
		-DCMAKE_BUILD_TYPE=Debug
	@cmake --build build

mrelease:
	@cmake -DBUILD_TESTS=OFF \
		-H. \
		-GNinja \
		-Bbuild \
		-DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo
	@cmake --build build

run:
	@./build/nheko

lint:
	@clang-format -i $(SRC)


clean:
	rm -rf build

.PHONY: build