-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (38 loc) · 1.12 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
SHELL := /bin/bash
PROJECT := $(shell pwd)
CI_DIR := $(PROJECT)/.ci
VENV ?= $(PROJECT)/.venv
BUILD ?= $(PROJECT)/.build
VCPKG ?= $(PROJECT)/.vcpkg
PATH = $(VENV)/bin:$(shell echo $$PATH)
ifneq (,$(wildcard $(CI_DIR)/.env))
include $(CI_DIR)/.env
export
endif
OS_TYPE := $(shell bash -c 'source $(CI_DIR)/scripts/detect_os.sh && detect_os')
all: init_all configure build test
init_all: init init_py init_vcpkg
os:
@echo "=== Detected OS: $(OS_TYPE)"
init:
@echo "=== Initializing..."
$(CI_DIR)/scripts/init.sh
init_py:
@echo "=== Initializing Python..."
source $(CI_DIR)/scripts/init_py.sh && init_py
init_vcpkg:
@echo "=== Initializing Vcpkg..."
source $(CI_DIR)/scripts/init_vcpkg.sh && init_vcpkg
configure:
@echo "=== Configuring..."
VCPKG_ROOT=$(VCPKG) cmake --preset=default -DPython3_EXECUTABLE="$(VENV)/bin/python3" -B $(BUILD) $(PROJECT)
build:
@echo "=== Building..."
cmake --build $(BUILD)
test:
@echo "=== Testing..."
ctest --test-dir $(BUILD)
clean_all:
@echo "=== Cleaning..."
rm -rf $(VENV) $(BUILD) $(VCPKG)
.PHONY: all init_all os init init_py init_vcpkg configure build test clean_all