From 22ceb7401b8581439b21c8cbfe7e1410bfc37634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 19 Jan 2024 12:24:26 +0100 Subject: [PATCH] Makefile: add print-FOO utility target that prints the value of a make variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit useful for debugging/checking value of a variable Signed-off-by: Øyvind Harboe --- common.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common.mk b/common.mk index 3763584f..462f1945 100644 --- a/common.mk +++ b/common.mk @@ -469,3 +469,10 @@ check-submodule-status: # Disable all suffix rules to improve Make performance on systems running older # versions of Make .SUFFIXES: + +.PHONY: print-% +# Print any variable and it's origin. This helps figure out where the +# variable was defined and to distinguish between empty and undefined. +print-%: + @echo "$*=$($*)" + @echo "Origin is: $(origin $*)"