-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (49 loc) · 1.78 KB
/
Copy pathMakefile
File metadata and controls
65 lines (49 loc) · 1.78 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
62
63
64
65
# Cardinal — build orchestration across the C++ engine and Go control plane.
.PHONY: all engine engine-asan test test-engine test-go bench fmt vet \
run-engine run-control compose-up compose-down clean
ENGINE_DIR := engine
CONTROL_DIR := control
all: engine
cd $(CONTROL_DIR) && go build ./...
## --- C++ engine ---
engine:
cmake -S $(ENGINE_DIR) -B $(ENGINE_DIR)/build -DCMAKE_BUILD_TYPE=Release
cmake --build $(ENGINE_DIR)/build -j
engine-asan:
cmake -S $(ENGINE_DIR) -B $(ENGINE_DIR)/build-asan -DCMAKE_BUILD_TYPE=Debug -DSANITIZE=address,undefined
cmake --build $(ENGINE_DIR)/build-asan -j
test-engine: engine
cd $(ENGINE_DIR)/build && ctest --output-on-failure
bench: engine
$(ENGINE_DIR)/build/carde_bench
# Socket-vs-shared-memory ingest benchmark (WAL off to isolate transport).
bench-shm: engine
cd $(CONTROL_DIR) && go build -o /tmp/shmbench ./cmd/shmbench
rm -f /tmp/bench.sock /dev/shm/carde.ring
$(ENGINE_DIR)/build/carded --socket /tmp/bench.sock --no-wal \
--shm /dev/shm/carde.ring --shm-capacity 1048576 & echo $$! > /tmp/carded.pid
sleep 1
-/tmp/shmbench --socket /tmp/bench.sock --shm /dev/shm/carde.ring --n 1000000
kill `cat /tmp/carded.pid`
## --- Go control plane ---
test-go:
cd $(CONTROL_DIR) && go test -race ./...
vet:
cd $(CONTROL_DIR) && go vet ./...
fmt:
cd $(CONTROL_DIR) && gofmt -w ./cmd ./internal
## --- combined ---
test: test-engine test-go
## --- local run (no docker) ---
run-engine: engine
$(ENGINE_DIR)/build/carded --socket /tmp/carde.sock --wal /tmp/carde.wal
run-control:
cd $(CONTROL_DIR) && go run ./cmd/cardinal --engine /tmp/carde.sock
## --- docker ---
compose-up:
docker compose up --build
compose-down:
docker compose down -v
clean:
rm -rf $(ENGINE_DIR)/build $(ENGINE_DIR)/build-asan
cd $(CONTROL_DIR) && go clean ./...