-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (48 loc) · 2.59 KB
/
Copy pathMakefile
File metadata and controls
62 lines (48 loc) · 2.59 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
.PHONY: build test test-data test-conformance test-cli-smoke clean format lint help
# ── Build ──────────────────────────────────────────────────────────────────
build:
cmake -S . -B build
cmake --build build
# ── Test ───────────────────────────────────────────────────────────────────
test: test-data build
ctest --test-dir build --output-on-failure
$(MAKE) test-cli-smoke
test-conformance: test-data build
python3 tests/conformance/run_cli_smoke.py
test-cli-smoke: test-data build
python3 tests/conformance/run_cli_smoke.py
# ── Data / Clean ───────────────────────────────────────────────────────────
test-data:
python3 tests/gen_testdata.py
clean:
rm -rf build tests/data
rm -rf docs/.vitepress/dist
# ── Format & Lint ───────────────────────────────────────────────────────────
format:
@command -v clang-format >/dev/null || { echo "clang-format is required"; exit 1; }
@echo "Formatting C++ code..."
@find algorithms -type f \( -name '*.cpp' -o -name '*.hpp' \) -exec clang-format -i {} +
@echo "Done!"
lint:
@command -v clang-format >/dev/null || { echo "clang-format is required"; exit 1; }
@echo "Linting C++ code (clang-format dry-run)..."
@find algorithms -type f \( -name '*.cpp' -o -name '*.hpp' \) \
! -path '*/build/*' \
-exec clang-format --dry-run -Werror {} + || { echo "clang-format check failed; run 'make format'"; exit 1; }
@echo "Done!"
# ── Help ────────────────────────────────────────────────────────────────────
help:
@echo "Build Commands:"
@echo " make build Build all algorithms (CMake)"
@echo ""
@echo "Test Commands:"
@echo " make test Run all tests + CLI smoke"
@echo " make test-cli-smoke Run CLI smoke tests"
@echo ""
@echo "Code Quality:"
@echo " make format Format all C++ code"
@echo " make lint Lint all C++ code (clang-format dry-run)"
@echo ""
@echo "Other:"
@echo " make clean Clean build artifacts"
@echo " make test-data Generate test corpus"