-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (21 loc) · 816 Bytes
/
Makefile
File metadata and controls
29 lines (21 loc) · 816 Bytes
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
.PHONY: build install test clean debug release
BUILD_DIR = build
build:
cmake -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release
cmake --build $(BUILD_DIR) -j$(shell sysctl -n hw.ncpu 2>/dev/null || nproc)
debug:
cmake -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Debug
cmake --build $(BUILD_DIR) -j$(shell sysctl -n hw.ncpu 2>/dev/null || nproc)
install: build
cmake --install $(BUILD_DIR) --prefix /usr/local
test:
cmake -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Debug
cmake --build $(BUILD_DIR) --target apollo_tests -j$(shell sysctl -n hw.ncpu 2>/dev/null || nproc)
cd $(BUILD_DIR) && ctest --output-on-failure
clean:
rm -rf $(BUILD_DIR)
format:
find src tests -name '*.cpp' -o -name '*.h' | xargs clang-format -i
lint:
cmake -B $(BUILD_DIR) -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
clang-tidy src/**/*.cpp -p $(BUILD_DIR)