Skip to content

Commit

Permalink
Makefile: add print-FOO utility target that prints the value of a mak…
Browse files Browse the repository at this point in the history
…e variable

useful for debugging/checking value of a variable

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
  • Loading branch information
oharboe committed Jan 19, 2024
1 parent c7e33e9 commit 22ceb74
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 $*)"

0 comments on commit 22ceb74

Please sign in to comment.