-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (69 loc) · 1.62 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
.PHONY: ccc default build rel deb crel cdeb clean tests samples all-deb all-rel call-deb call-rel dtest rtest util tidy format fanalyze
MAKE := $(MAKE)
MAKEFLAGS += --no-print-directory
# Adjust parallel build jobs based on your available cores.
JOBS ?= $(shell (command -v nproc > /dev/null 2>&1 && echo "-j$$(nproc)") || echo "")
BUILD_DIR := build/
PREFIX := install/
ifeq ($(words $(MAKECMDGOALS)),2)
PREFIX := $(word 2, $(MAKECMDGOALS))
endif
default: build
build:
cmake --build $(BUILD_DIR) $(JOBS)
ccc:
cmake --preset=rel -DCMAKE_INSTALL_PREFIX=$(PREFIX)
cmake --build $(BUILD_DIR) --target install $(JOBS)
install:
cmake --build $(BUILD_DIR) --target install $(JOBS)
rel:
cmake --preset=rel
$(MAKE) build
deb:
cmake --preset=deb
$(MAKE) build
crel:
cmake --preset=crel
$(MAKE) build
cdeb:
cmake --preset=cdeb
$(MAKE) build
format:
cmake --build $(BUILD_DIR) --target format
tidy:
cmake --build $(BUILD_DIR) --target tidy $(JOBS)
tests:
cmake --build $(BUILD_DIR) --target tests $(JOBS)
samples:
cmake --build $(BUILD_DIR) --target samples $(JOBS)
util:
cmake --build $(BUILD_DIR) --target util $(JOBS)
all-deb:
$(MAKE) deb
$(MAKE) tests
$(MAKE) samples
all-rel:
$(MAKE) rel
$(MAKE) tests
$(MAKE) samples
fanalyze:
cmake --preset=fanalyze
$(MAKE) build
$(MAKE) tests
$(MAKE) samples
call-deb:
$(MAKE) cdeb
$(MAKE) tests
$(MAKE) samples
call-rel:
$(MAKE) crel
$(MAKE) tests
$(MAKE) samples
dtest: tests
$(BUILD_DIR)debug/bin/run_tests $(BUILD_DIR)debug/bin/tests/
@echo "RAN TESTS"
rtest: tests
$(BUILD_DIR)bin/run_tests $(BUILD_DIR)bin/tests/
@echo "RAN TESTS"
clean:
rm -rf build/ install/