Skip to content

Commit 0cf99c3

Browse files
committed
Auto merge of #24315 - richo:make-debug-helper, r=pnkfelix
Also add docs because not being able to discover these things is the pits. This was lifted from http://blog.jgc.org/2015/04/the-one-line-you-should-add-to-every.html , and solves a problem I've solved myself a *lot* of times, often in massively inferior ways. Super open to documenting it somewhere other than nitty-gritty, which isn't immediately obvious.
2 parents 47def3e + 7a1d726 commit 0cf99c3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Makefile.in

+7
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@
159159
#
160160
# Admittedly this is a little convoluted.
161161
#
162+
# If you find yourself working on the make infrastructure itself, and trying to
163+
# find the value of a given variable after expansion, you can use:
164+
#
165+
# make print-VARIABLE_NAME
166+
#
167+
# To extract it
168+
#
162169
# </nitty-gritty>
163170
#
164171

mk/util.mk

+3
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ else
1616
E = echo $(1)
1717
endif
1818

19+
print-%:
20+
@echo $*=$($*)
21+
1922
S := $(CFG_SRC_DIR)

0 commit comments

Comments
 (0)