-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
61 lines (46 loc) · 2.22 KB
/
Copy pathmakefile
File metadata and controls
61 lines (46 loc) · 2.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
60
61
# ── config ───────────────────────────────────────────────────────────────────
BUILD := build
CMAKE := cmake
JOBS := $(shell nproc)
# ── build targets ────────────────────────────────────────────────────────────
.PHONY: release instrumented debug gdb asan ubsan tsan all clean run_release run_bench
release:
$(CMAKE) -S . -B $(BUILD)/release -DCMAKE_BUILD_TYPE=Release
$(CMAKE) --build $(BUILD)/release -j$(JOBS)
instrumented:
$(CMAKE) -S . -B $(BUILD)/instrumented -DCMAKE_BUILD_TYPE=Release -DITCH_INSTRUMENT=ON
$(CMAKE) --build $(BUILD)/instrumented -j$(JOBS)
debug:
$(CMAKE) -S . -B $(BUILD)/debug -DCMAKE_BUILD_TYPE=Debug
$(CMAKE) --build $(BUILD)/debug -j$(JOBS)
gdb:
$(CMAKE) -S . -B $(BUILD)/gdb -DCMAKE_BUILD_TYPE=GDB
$(CMAKE) --build $(BUILD)/gdb -j$(JOBS)
asan:
$(CMAKE) -S . -B $(BUILD)/asan -DCMAKE_BUILD_TYPE=ASan
$(CMAKE) --build $(BUILD)/asan -j$(JOBS)
ubsan:
$(CMAKE) -S . -B $(BUILD)/ubsan -DCMAKE_BUILD_TYPE=UBSan
$(CMAKE) --build $(BUILD)/ubsan -j$(JOBS)
tsan:
$(CMAKE) -S . -B $(BUILD)/tsan -DCMAKE_BUILD_TYPE=TSan
$(CMAKE) --build $(BUILD)/tsan -j$(JOBS)
# build everything at once — useful before committing
all: release instrumented debug asan ubsan tsan
# ── run shortcuts ─────────────────────────────────────────────────────────────
run_release: release
./$(BUILD)/release/bench $(ARGS)
run_instrumented: instrumented
./$(BUILD)/instrumented/bench $(ARGS)
run_debug: debug
./$(BUILD)/debug/bench $(ARGS)
run_tsan: tsan
./$(BUILD)/tsan/bench $(ARGS)
# ── housekeeping ──────────────────────────────────────────────────────────────
clean:
rm -rf $(BUILD)
# reconfigure without rebuilding (useful after CMakeLists changes)
reconfigure:
for d in $(BUILD)/*/; do \
$(CMAKE) -S . -B $$d; \
done