-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (38 loc) · 1.33 KB
/
Makefile
File metadata and controls
49 lines (38 loc) · 1.33 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
.DEFAULT_GOAL := help
# SHELL := /bin/bash
################################### Build and Test
all: test
.PHONY: build
build: ## cmake generate and build shell
@mkdir -p build
cd build && \
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake && \
cmake --build .
.PHONY: test
test: build ## Run codecrafters cloud tests
codecrafters test
################################### Static Analysis
CPPCHECK_CACHE_DIR ?= cppcheck-cache
CLANG_FORMAT_CMD = find . -iname "*.hpp" -o -iname "*.cpp" | xargs clang-format -style=file -i
.PHONY: check-format
check-format: ## Check clang format errors
$(CLANG_FORMAT_CMD) --dry-run -Werror
format: ## Apply clang format to code
$(CLANG_FORMAT_CMD)
.PHONY: check
check: ## Run static analysis checks using cppcheck
@mkdir -p $(CPPCHECK_CACHE_DIR)
@cppcheck --version
cppcheck --quiet \
--enable=all \
--std=c++23 \
--cppcheck-build-dir=$(CPPCHECK_CACHE_DIR) \
--inline-suppr \
--check-level=exhaustive \
--error-exitcode=1 \
--suppressions-list=config/cppcheck-suppressions.txt \
--checkers-report=cppcheck_report.txt \
./src
################################### Other targets
help: ## Show this help message
@grep '##' $(MAKEFILE_LIST) | grep -v grep | awk 'BEGIN {FS = ": .*##"}; {printf "\033[36m%-38s\033[0m %s\n", $$1, $$2}'