aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2026-03-16 16:46:25 +1100
committerStefano Brivio <sbrivio@redhat.com>2026-03-16 23:34:27 +0100
commit744d6df27d6003346e7f1553d3712cc25e907933 (patch)
tree4be6bd6f7a977e004340a398f352c712d659d3a5
parent1b32bfe181c7a22d22fbc9ba90b94c8234e15adc (diff)
downloadpasst-744d6df27d6003346e7f1553d3712cc25e907933.tar
passt-744d6df27d6003346e7f1553d3712cc25e907933.tar.gz
passt-744d6df27d6003346e7f1553d3712cc25e907933.tar.bz2
passt-744d6df27d6003346e7f1553d3712cc25e907933.tar.lz
passt-744d6df27d6003346e7f1553d3712cc25e907933.tar.xz
passt-744d6df27d6003346e7f1553d3712cc25e907933.tar.zst
passt-744d6df27d6003346e7f1553d3712cc25e907933.zip
Makefile: Use $^ to avoid duplication in static checker rules
Currently we duplicate the list of sources / headers to check in the dependency list for the clang-tidy and cppcheck rules, then again in the command itself. Since we already require GNU make, we can avoid this by using the special $^ symbol which expands to the full list of dependencies. Since clang-tidy only needs the .c files, not the headers listed, we remove the headers from the dependency list to make this work. Since these are phony targets that will always be rebuilt, that shouldn't have any side effects. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--Makefile6
1 files changed, 3 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 91e037b..fe016f3 100644
--- a/Makefile
+++ b/Makefile
@@ -172,8 +172,8 @@ docs: README.md
done < README.md; \
) > README.plain.md
-clang-tidy: $(PASST_SRCS) $(HEADERS)
- clang-tidy $(PASST_SRCS) -- $(filter-out -pie,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) \
+clang-tidy: $(PASST_SRCS)
+ clang-tidy $^ -- $(filter-out -pie,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) \
-DCLANG_TIDY_58992
cppcheck: $(PASST_SRCS) $(HEADERS)
@@ -189,4 +189,4 @@ cppcheck: $(PASST_SRCS) $(HEADERS)
--suppress=missingIncludeSystem \
--suppress=unusedStructMember \
$(filter -D%,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) -D CPPCHECK_6936 \
- $(PASST_SRCS) $(HEADERS)
+ $^