-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (27 loc) · 1.35 KB
/
Copy pathMakefile
File metadata and controls
37 lines (27 loc) · 1.35 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
# cpp-ml-systems — convenience wrapper around CMake/CTest.
# `make help` lists every target.
BUILD_DIR ?= build
BUILD_DEBUG_DIR ?= build_debug
JOBS ?= $(shell nproc 2>/dev/null || echo 4)
.PHONY: build debug test bench clean install-deps format help
build: ## Configure + build the Release tree in ./build
cmake -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release
cmake --build $(BUILD_DIR) -j$(JOBS)
debug: ## Configure + build a Debug tree (asserts + symbols) in ./build_debug
cmake -B $(BUILD_DEBUG_DIR) -DCMAKE_BUILD_TYPE=Debug
cmake --build $(BUILD_DEBUG_DIR) -j$(JOBS)
test: build ## Run the full GoogleTest suite via CTest
cd $(BUILD_DIR) && ctest --output-on-failure
bench: build ## Build then run all benchmarks
./scripts/run_benchmarks.sh $(BUILD_DIR)
clean: ## Remove all build trees
rm -rf $(BUILD_DIR) $(BUILD_DEBUG_DIR)
install-deps: ## Install toolchain + GoogleTest (Ubuntu/Debian; see comment for macOS)
sudo apt-get update && sudo apt-get install -y cmake g++ libgtest-dev
# macOS: brew install cmake googletest
format: ## clang-format every source file in place
find src include tests benchmarks \( -name '*.cpp' -o -name '*.hpp' \) -print0 \
| xargs -0 clang-format -i
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN{FS=":.*?## "}{printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'