summary refs log tree commit diff
path: root/Makefile
blob: b4f3f4709f8173a24c629ef5b0024a1f184c7a54 (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
APP_NAME = nheko

MAC_DIST_DIR = dist/MacOS
APP_TEMPLATE = $(MAC_DIST_DIR)/Nheko.app

# 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

app: release-debug $(APP_TEMPLATE)
	@cp -fp ./build/$(APP_NAME) $(APP_TEMPLATE)/Contents/MacOS
	@echo "Created '$(APP_NAME).app' in '$(APP_TEMPLATE)'"

app-install: app
	cp -Rf $(APP_TEMPLATE) /Applications/

dmg: app
	hdiutil create $(MAC_DIST_DIR)/Nheko.dmg \
		-volname "$(APP_NAME)" \
		-fs HFS+ \
		-srcfolder $(MAC_DIST_DIR) \
		-ov -format UDZO

run:
	@./build/nheko

lint:
	@./.ci/format.sh

clean:
	rm -rf build

.PHONY: build app dmg