-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
63 lines (51 loc) · 1.65 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- coding: utf8 -*-
# Copyright (c) 2022 - ∞ blurryroots innovation qanat OÜ
FILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJECT_DIR := $(shell dirname $(FILE_PATH))
PROJECT_NAME := $(notdir $(patsubst %/,%,$(dir $(FILE_PATH))))
BUILD_DIR ?= $(PROJECT_DIR)/staging
BUILD_MODE ?= Release # Either Debug or Release
BUILD_SHARED_LIBS ?= OFF
WITH_WINDOWS := 0
TEST_EXE_PATH := $(BUILD_DIR)/JustOnceCMD
BIN_DIR := "$(BUILD_DIR)"
ifeq ($(shell echo "check_quotes"),"check_quotes")
WITH_WINDOWS = 1
TEST_EXE_PATH = $(BUILD_DIR)/$(BUILD_MODE)/JustOnceCMD.exe
BIN_DIR = $(BUILD_DIR)/$(BUILD_MODE)
endif
WITH_TEST ?= 1
GRIND ?= valgrind
GRIND_OPTS ?= --show-leak-kinds=all --leak-check=full --track-origins=yes -v
default: all
debug:
@echo "FILE_PATH: $(FILE_PATH)"
@echo "PROJECT_DIR: $(PROJECT_DIR)"
@echo "PROJECT_NAME: $(PROJECT_NAME)"
@echo "BIN_DIR: $(BIN_DIR)"
@echo "BUILD_DIR: $(BUILD_DIR)"
@echo "BUILD_MODE: $(BUILD_MODE)"
@echo "GRIND: $(GRIND)"
@echo "SDKROOT: $(SDKROOT)"
@echo "OS: $(OS)"
@echo "WITH_WINDOWS: $(WITH_WINDOWS)"
clean:
@rm -rf "$(BUILD_DIR)"
prepare:
@mkdir -p "$(BUILD_DIR)"
@cmake -B $(BUILD_DIR) -D CMAKE_BUILD_TYPE=${BUILD_MODE} \
-D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -S $(PROJECT_DIR) \
-D WITH_TOOLS=0 -D WITHOUT_PNG=1 -D JustOnce_WithTest=1
build:
cmake --build "$(BUILD_DIR)"
run:
$(BIN_DIR)/./JustOnceCMD -U -a "[email protected]" -i "architect" -l 23 -d 7 -k "$(PROJECT_DIR)/Key.hash"
docs: clean-docs
doxygen docs/doxygen.cfg > docs/doxygen.log 2> docs/doxygen.err.log
open-docs:
open docs/html/index.html
clean-docs:
rm -rf docs/{html,latex}
rm -f docs/doxygen*.log
build-run: build run
all: prepare build-run