Makefile: add print-FOO utility target that prints the value of a make variable

useful for debugging/checking value of a variable

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
Øyvind Harboe
2024-01-19 12:24:26 +01:00
parent c7e33e96c9
commit 22ceb7401b

View File

@@ -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 $*)"