-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
51 lines (38 loc) · 1.17 KB
/
Makefile
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
BUILD_FOLDER = build
SCRIPTS_FOLDER = scripts
TEST_FOLDER = tests
CPPCHECK_BUILD_FOLDER = build_cppcheck
.PHONY: all install_deps setup_cmake build test flash clang_format check_clang_format cppcheck help debug_gdb clean
all: build
install_deps:
bash ./$(SCRIPTS_FOLDER)/install_deps.sh
setup_cmake:
rm -rf $(BUILD_FOLDER)
mkdir $(BUILD_FOLDER)
cd $(BUILD_FOLDER) && \
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../cmake/CMakeSetCompiler.cmake -DCMAKE_BUILD_TYPE=Debug ..
build:
cd $(BUILD_FOLDER) && ninja
test:
cd $(TEST_FOLDER) && \
cmake -S . -B build && \
cmake --build build && \
cd build && \
ctest
flash:
cd $(BUILD_FOLDER) && ninja flash
clang_format:
cd $(BUILD_FOLDER) && ninja clang_format
check_clang_format:
cd $(BUILD_FOLDER) && ninja check_clang_format
cppcheck:
mkdir -p $(CPPCHECK_BUILD_FOLDER)
cppcheck --template=gcc --cppcheck-build-dir=$(CPPCHECK_BUILD_FOLDER) src
debug_gdb:
cd $(BUILD_FOLDER) && ninja debug_gdb
clean:
cd $(BUILD_FOLDER) && ninja clean
rm -rf $(CPPCHECK_BUILD_FOLDER)
#cd $(TEST_FOLDER) && ninja clean
help:
@echo all install_deps setup_cmake build test flash clang_format check_clang_format cppcheck help debug_gdb clean