-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (27 loc) · 993 Bytes
/
Copy pathMakefile
File metadata and controls
39 lines (27 loc) · 993 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
30
31
32
33
34
35
36
37
38
39
.PHONY: all config build set-style format test tidy watch clean docs
NPROC := $(shell nproc 2>/dev/null || sysctl -n hw.logicalcpu)
config:
cmake -S . -B build -G Ninja
build/build.ninja: CMakeLists.txt lib/CMakeLists.txt tools/proteus-opt/CMakeLists.txt tests/CMakeLists.txt tests/unit/CMakeLists.txt
cmake -S . -B build -G Ninja
build: build/build.ninja
cmake --build build --parallel $(NPROC)
set-style:
@clang-format --style=LLVM --dump-config > .clang-format
format:
@find lib include tests \( -name "*.cpp" -o -name "*.hpp" -o -name "*.h" \) \
| xargs clang-format -i
format-check:
@find lib include tests \( -name "*.cpp" -o -name "*.hpp" -o -name "*.h" \) \
| xargs clang-format --dry-run --Werror
test: build
ctest --verbose --test-dir build --output-on-failure
lit tests
tidy:
find lib tools -name "*.cpp" | xargs clang-tidy -p build
watch:
watchman-make -p 'lib/**/*.cpp' 'include/**/*.h' 'tools/**/*.cpp' -t tidy
clean:
rm -rf build
docs: build
doxygen