-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
86 lines (70 loc) · 2.58 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
.PHONY: default mgcc-rel mgcc-deb nclang-rel nclang-deb build format tidy clean ctest-deb ctest-rel gtest-deb gtest-rel test-deb-all test-rel-all
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/
TEST_ARGS := ./scripts/example* ./scripts/pattern* ./scripts/robust* ./scripts/trace*
default: build
mgcc-rel:
cmake --preset=mgcc-rel
cmake --build $(BUILD_DIR) $(JOBS)
mgcc-deb:
cmake --preset=mgcc-deb
cmake --build $(BUILD_DIR) $(JOBS)
nclang-rel:
cmake --preset=nclang-rel
cmake --build $(BUILD_DIR) $(JOBS)
nclang-deb:
cmake --preset=nclang-deb
cmake --build $(BUILD_DIR) $(JOBS)
build:
cmake --build $(BUILD_DIR) $(JOBS)
format:
cmake --build $(BUILD_DIR) --target format
tidy:
cmake --build $(BUILD_DIR) --target tidy $(JOBS)
ctest-deb: build
$(BUILD_DIR)deb/ctest_list_segregated $(TEST_ARGS)
$(BUILD_DIR)deb/ctest_rbtree_clrs $(TEST_ARGS)
$(BUILD_DIR)deb/ctest_rbtree_unified $(TEST_ARGS)
$(BUILD_DIR)deb/ctest_rbtree_linked $(TEST_ARGS)
$(BUILD_DIR)deb/ctest_rbtree_stack $(TEST_ARGS)
$(BUILD_DIR)deb/ctest_rbtree_topdown $(TEST_ARGS)
$(BUILD_DIR)deb/ctest_splaytree_stack $(TEST_ARGS)
$(BUILD_DIR)deb/ctest_splaytree_topdown $(TEST_ARGS)
@echo "Ran DEBUG Script Correctness Tests"
ctest-rel: build
$(BUILD_DIR)rel/ctest_list_segregated $(TEST_ARGS)
$(BUILD_DIR)rel/ctest_rbtree_clrs $(TEST_ARGS)
$(BUILD_DIR)rel/ctest_rbtree_unified $(TEST_ARGS)
$(BUILD_DIR)rel/ctest_rbtree_linked $(TEST_ARGS)
$(BUILD_DIR)rel/ctest_rbtree_stack $(TEST_ARGS)
$(BUILD_DIR)rel/ctest_rbtree_topdown $(TEST_ARGS)
$(BUILD_DIR)rel/ctest_splaytree_stack $(TEST_ARGS)
$(BUILD_DIR)rel/ctest_splaytree_topdown $(TEST_ARGS)
@echo "Ran RELEASE Script Correctness Tests"
gtest-deb: build
$(BUILD_DIR)deb/gtest_list_segregated
$(BUILD_DIR)deb/gtest_rbtree_clrs
$(BUILD_DIR)deb/gtest_rbtree_unified
$(BUILD_DIR)deb/gtest_rbtree_linked
$(BUILD_DIR)deb/gtest_rbtree_stack
$(BUILD_DIR)deb/gtest_rbtree_topdown
$(BUILD_DIR)deb/gtest_splaytree_topdown
$(BUILD_DIR)deb/gtest_splaytree_stack
@echo "Ran DEBUG GTests"
gtest-rel: build
$(BUILD_DIR)rel/gtest_list_segregated
$(BUILD_DIR)rel/gtest_rbtree_clrs
$(BUILD_DIR)rel/gtest_rbtree_unified
$(BUILD_DIR)rel/gtest_rbtree_linked
$(BUILD_DIR)rel/gtest_rbtree_stack
$(BUILD_DIR)rel/gtest_rbtree_topdown
$(BUILD_DIR)rel/gtest_splaytree_topdown
$(BUILD_DIR)rel/gtest_splaytree_stack
@echo "Ran RELEASE GTests"
test-deb-all: test-deb gtest-deb
test-rel-all: test-rel gtest-rel
clean:
rm -rf build/