-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (48 loc) · 1.22 KB
/
Makefile
File metadata and controls
59 lines (48 loc) · 1.22 KB
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
SHELL = /bin/bash
ifeq ($(VCPKG_ROOT),)
$(error Variables VCPKG_ROOT not set correctly.)
endif
ifeq ($(shell type cygpath >& /dev/null && echo true),true)
FIXPATH = cygpath -ma
else
FIXPATH = realpath
endif
# Detect OS and set default PRESET accordingly
ifeq ($(OS),Windows_NT)
PRESET?=x86-windows
else
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_S),Linux)
ifeq ($(UNAME_M),aarch64)
PRESET?=arm64-linux
else
PRESET?=x64-linux
endif
else ifeq ($(UNAME_S),Darwin)
ifeq ($(UNAME_M),arm64)
PRESET?=arm64-osx
else
PRESET?=x64-osx
endif
else
PRESET?=x64-windows
endif
endif
BUILD_TYPE?=Release
CMAKEOPT?=""
INSTALL_PREFIX?=install
BUILD_PATH=$(shell cmake --preset $(PRESET) -N | grep BUILD_DIR | sed 's/.*BUILD_DIR="\(.*\)"/\1/')
.PHONY: prebuild build clean install run
all: build
# cmake 処理実行
# CMAKEOPT で引数定義追加
prebuild:
cmake --preset $(PRESET) ${CMAKEOPT}
# ビルド実行
build:
cmake --build $(BUILD_PATH) --config $(BUILD_TYPE)
clean:
cmake --build $(BUILD_PATH) --config $(BUILD_TYPE) --target clean
install:
cmake --install $(BUILD_PATH) --config $(BUILD_TYPE) --prefix $(INSTALL_PREFIX)