public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top, Stefano Brivio <sbrivio@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 1/5] Makefile: Use $^ to avoid duplication in static checker rules
Date: Mon, 16 Mar 2026 16:46:25 +1100	[thread overview]
Message-ID: <20260316054629.239002-2-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20260316054629.239002-1-david@gibson.dropbear.id.au>

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>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 91e037b8..fe016f30 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)
+	$^
-- 
2.53.0


  reply	other threads:[~2026-03-16  5:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16  5:46 [PATCH 0/5] RFC: Stub dynamic update implementation David Gibson
2026-03-16  5:46 ` David Gibson [this message]
2026-03-16  5:46 ` [PATCH 2/5] doc: Fix formatting of (DEPRECATED) notes in man page David Gibson
2026-03-16  5:46 ` [PATCH 3/5] pif: Remove unused PIF_NAMELEN David Gibson
2026-03-16  5:46 ` [PATCH 4/5] treewide: Spell ASSERT() as assert() David Gibson
2026-03-17  0:02   ` Stefano Brivio
2026-03-17  0:39     ` David Gibson
2026-03-17  9:36       ` Stefano Brivio
2026-03-16  5:46 ` [PATCH 5/5] pesto: Introduce stub configuration interface and tool David Gibson
2026-03-17  0:02   ` Stefano Brivio
2026-03-17  0:48     ` David Gibson
2026-03-17  9:36       ` Stefano Brivio
2026-03-17  0:02 ` [PATCH 0/5] RFC: Stub dynamic update implementation Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260316054629.239002-2-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).