diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-03-16 16:46:25 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-03-16 23:34:27 +0100 |
| commit | 744d6df27d6003346e7f1553d3712cc25e907933 (patch) | |
| tree | 4be6bd6f7a977e004340a398f352c712d659d3a5 | |
| parent | 1b32bfe181c7a22d22fbc9ba90b94c8234e15adc (diff) | |
| download | passt-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-- | Makefile | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) + $^ |
