From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=MyteYS6/; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 30BBC5A0619 for ; Mon, 16 Mar 2026 06:46:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1773639991; bh=RlD8+hW8vo9ObZEr0tDvrTymPCa7T72QLEJGxEUKQk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MyteYS6/07zS/ZSTE8VMa8ujVQFwWZ/PIUq8+cdgufyUyyotF1KUfQ+uNAnUL25Vw KaVy+L7onpQRu1Jw3AGm+JtXn7gDzFMz6xOTCIsXgiyU9hI+0zJ947UO2+a7yI8PQw BWvlawEwJ8lGICm0mvmStWcfFOZrTaAZaB0FIWlbQlB3B7PxmKE+XCZWTUJ3g8T1EU J9GjlHQeOJMNuyT1acG/GlFNk+q/l4iBCJxVIKAsldymeqmY7/k1oGzBSVR6b4Cu4J xOkk9wiQB9VEoA4DhmAIGbtm0LfRIJPX8ZE54od62xUHfGWSHvJi8LQoRUnc+sn8+5 gBZQZHKuAzyng== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4fZ3xM4lgsz4wDN; Mon, 16 Mar 2026 16:46:31 +1100 (AEDT) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 1/5] Makefile: Use $^ to avoid duplication in static checker rules Date: Mon, 16 Mar 2026 16:46:25 +1100 Message-ID: <20260316054629.239002-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260316054629.239002-1-david@gibson.dropbear.id.au> References: <20260316054629.239002-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 5OYD3H6XROT4DXNO2XSJGNPDRXQEN4DD X-Message-ID-Hash: 5OYD3H6XROT4DXNO2XSJGNPDRXQEN4DD X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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