summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2015-10-20 18:54:06 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2015-10-27 11:10:49 +0100
commitb2708da42d3dfb5bbf7b796554eec3071c4f4f1a (patch)
tree86e2ba3ca18ddb74f4d83c9c689c381de1f48555
parentb3495f9a14b8fd6f4062d65266ba124cf539e222 (diff)
downloadptxdist-b2708da42d3dfb5bbf7b796554eec3071c4f4f1a.tar.gz
ptxdist-b2708da42d3dfb5bbf7b796554eec3071c4f4f1a.tar.xz
ptxdist: rework 'print' command
- avoid "recipe for target '...' failed" messages - generate '<variable>=<value>' when running in verbose mode - produce and empty value instead of an error when "-k" is used This makes is possible to use $ ptxdist -v--k make print-<VAR1> print-<VAR2>ยท... to dump a useful list of many variables that may or may not be defined. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-xbin/ptxdist3
-rw-r--r--rules/other/Toplevel.make3
2 files changed, 5 insertions, 1 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index a878fb6ff..8af0ac839 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -1971,6 +1971,9 @@ EOF
fi
while [ ${#} -gt 0 ]; do
if [ -n "${!1}" ]; then
+ if [ "${PTXDIST_VERBOSE}" = "1" ]; then
+ echo -n "${1}="
+ fi
echo "${!1}"
else
local check
diff --git a/rules/other/Toplevel.make b/rules/other/Toplevel.make
index 19793fa8d..642a2bfa0 100644
--- a/rules/other/Toplevel.make
+++ b/rules/other/Toplevel.make
@@ -108,7 +108,8 @@ include $(PTX_DGEN_DEPS_POST)
# ----------------------------------------------------------------------------
print-%: FORCE
- @[ "$(origin $(*))" != "undefined" ] && echo "$($(*))"
+ $(if $(filter k,$(MAKEFLAGS)),,$($(if $(filter undefined,$(origin $(*))),$(error $(*) undefined))))
+ @echo "$(if $(filter 1,$(PTXDIST_VERBOSE)),$(*)=)$($(*))"
.PHONY: $(PHONY)