From a2a2f404a7b6aa44f166006dbd85207b2727248d Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 12 May 2026 15:52:52 +1000 Subject: Makefile: Split static checker targets Currently we have a single 'cppcheck' and 'clang-tidy' target which checks passt. However, it doesn't check the additional binaries, qrap and passt-repair. In preparation for running the static checkers on those as well, split the targets into a top-level rule and a pattern rule which we will be able to reuse. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- Makefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2b5d49a..f55ffb5 100644 --- a/Makefile +++ b/Makefile @@ -193,8 +193,13 @@ docs: README.md CLANG_TIDY = clang-tidy CLANG_TIDY_FLAGS = -DCLANG_TIDY_58992 -clang-tidy: $(PASST_SRCS) - $(CLANG_TIDY) $^ -- $(BASE_CPPFLAGS) $(CPPFLAGS) $(CLANG_TIDY_FLAGS) +clang-tidy: passt.clang-tidy + +.PHONY: %.clang-tidy +%.clang-tidy: + $(CLANG_TIDY) $(filter %.c,$^) -- $(BASE_CPPFLAGS) $(CPPFLAGS) $(CLANG_TIDY_FLAGS) + +passt.clang-tidy: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h CPPCHECK = cppcheck CPPCHECK_FLAGS = --std=c11 --error-exitcode=1 --enable=all --force \ @@ -209,5 +214,10 @@ CPPCHECK_FLAGS = --std=c11 --error-exitcode=1 --enable=all --force \ --suppress=unusedStructMember \ -D CPPCHECK_6936 -cppcheck: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h +cppcheck: passt.cppcheck + +.PHONY: %.cppcheck +%.cppcheck: $(CPPCHECK) $(CPPCHECK_FLAGS) $(BASE_CPPFLAGS) $^ + +passt.cppcheck: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h -- cgit v1.2.3