-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathMakefile
96 lines (73 loc) · 3.26 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
93
94
95
.PHONY: install coverage test docs help build clean unit-test-daemon unit-test unit-test-runtime
.DEFAULT_GOAL := help
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z\d_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
BROWSER := python3 -c "$$BROWSER_PYSCRIPT"
INSTALL_LOCATION := ~/.local
CXXFLAGS += -std=c++20
JOBS := 1
help:
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
build-unit-test:
cmake -Bbuild -DBPFTIME_ENABLE_UNIT_TESTING=1 -DCMAKE_BUILD_TYPE:STRING=Debug -DENABLE_PROBE_WRITE_CHECK=1 -DENABLE_PROBE_READ_CHECK=1
cmake --build build --config Debug --target bpftime_runtime_tests bpftime_daemon_tests -j$(JOBS)
build-unit-test-without-probe-check:
cmake -Bbuild -DBPFTIME_ENABLE_UNIT_TESTING=1 -DCMAKE_BUILD_TYPE:STRING=Debug
cmake --build build --config Debug --target bpftime_runtime_tests bpftime_daemon_tests -j$(JOBS)
unit-test-daemon:
./build/daemon/test/bpftime_daemon_tests
unit-test-runtime:
make -C runtime/test/bpf && cp runtime/test/bpf/*.bpf.o build/runtime/test/
./build/runtime/unit-test/bpftime_runtime_tests
cd build/runtime/test && make && ctest -VV
unit-test: unit-test-daemon unit-test-runtime ## run catch2 unit tests
build: ## build the package with test and all components
cmake -Bbuild -DBPFTIME_ENABLE_UNIT_TESTING=1 -DBUILD_BPFTIME_DAEMON=1 -DCMAKE_BUILD_TYPE:STRING=Debug
cmake --build build --config Debug -j$(JOBS)
build-iouring: ## build the package with iouring extension
cmake -Bbuild -DBPFTIME_ENABLE_IOURING_EXT=1 -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
cmake --build build --config RelWithDebInfo -j$(JOBS)
build-wo-libbpf: ## build the package with iouring extension
cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBPFTIME_BUILD_WITH_LIBBPF=OFF -DBPFTIME_BUILD_KERNEL_BPF=OFF
cmake --build build --config RelWithDebInfo --target install -j$(JOBS)
release: ## build the release version
cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DBUILD_BPFTIME_DAEMON=1
cmake --build build --config RelWithDebInfo --target install -j$(JOBS)
release-with-llvm-jit: ## build the package, with llvm-jit
cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DBPFTIME_LLVM_JIT=1 \
-DBUILD_BPFTIME_DAEMON=1
cmake --build build --config RelWithDebInfo --target install -j$(JOBS)
release-with-static-lib: ## build the release version with libbpftime archive
cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DBPFTIME_BUILD_STATIC_LIB=ON
cmake --build build --config RelWithDebInfo --target install -j$(JOBS)
build-vm: ## build only the core library
make -C vm build
build-llvm: ## build with llvm as jit backend
cmake -Bbuild -DBPFTIME_ENABLE_UNIT_TESTING=1 \
-DBPFTIME_LLVM_JIT=1 \
-DCMAKE_BUILD_TYPE:STRING=Debug
cmake --build build --config Debug -j$(JOBS)
clean: ## clean the project
rm -rf build
make -C runtime clean
make -C vm clean
install: release ## Invoke cmake to install..