summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2018-11-11 19:07:12 +0000
committerrillig <rillig@pkgsrc.org>2018-11-11 19:07:12 +0000
commitbb04e56ed27d3956406c48dcbaf151cbc0578ef5 (patch)
tree1cf2bc96123cf909d6132c918e15d4518567da78 /mk
parentce7c3eb63ed3dc9b3308ae9520d41e5bfaa0cb0a (diff)
downloadpkgsrc-bb04e56ed27d3956406c48dcbaf151cbc0578ef5.tar.gz
mk/misc: adjust layout of the show-all output to pkgsrc format
In Makefiles, the variable values are aligned vertically. This format is now also used in the show-all target, which makes it easier readable. Some more variables have been marked as multi-value, and single-valued variables ending in space are clearly marked. Without the latter, the regression test would have a line with significant trailing whitespace.
Diffstat (limited to 'mk')
-rw-r--r--mk/misc/show.mk35
1 files changed, 19 insertions, 16 deletions
diff --git a/mk/misc/show.mk b/mk/misc/show.mk
index 07fd9e0c2ec..8a9f11e0483 100644
--- a/mk/misc/show.mk
+++ b/mk/misc/show.mk
@@ -1,4 +1,4 @@
-# $NetBSD: show.mk,v 1.15 2018/11/10 10:40:55 rillig Exp $
+# $NetBSD: show.mk,v 1.16 2018/11/11 19:07:12 rillig Exp $
#
# This file contains some targets that print information gathered from
# variables. They do not modify any variables.
@@ -149,18 +149,20 @@ show-all-${g}: .PHONY
. for c in ${_SHOW_ALL_CATEGORIES}
. for v in ${${c}.${g}}
. if (${v:M*_ENV} \
- || ${v:M*_ENV.*})
+ || ${v:M*_ENV.*} \
+ || ${v} == PLIST_SUBST \
+ || ${v:MSUBST_VARS.*})
# multi-valued variables, values are sorted
${RUN} \
if ${!defined(${v}) :? true : false}; then \
- printf ' %s\t%s (undefined)\n' ${_LABEL.${c}} ${v:Q}; \
+ printf ' %s\t%-23s # undefined\n' ${_LABEL.${c}} ${v:Q}; \
elif value=${${v}:U:M*:Q} && test "x$$value" = "x"; then \
- printf ' %s\t%s = # empty\n' ${_LABEL.${c}} ${v:Q}; \
+ printf ' %s\t%-23s # empty\n' ${_LABEL.${c}} ${v:Q}=; \
else \
- printf ' %s\t%s (sorted) = \\\n' ${_LABEL.${c}} ${v:Q}; \
- printf ' \t\t%s \\\n' ${${v}:O:@x@${x:Q}@}; \
- printf ' \t\t# end of %s\n' ${v:Q}; \
+ printf ' %s\t%-23s \\\n' ${_LABEL.${c}} ${v:Q}=; \
+ printf '\t\t\t\t%s \\\n' ${${v}:O:@x@${x:Q}@}; \
+ printf '\t\t\t\t# end of %s (sorted)\n' ${v:Q}; \
fi
. elif (${v:M*_ARGS} \
@@ -168,6 +170,7 @@ show-all-${g}: .PHONY
|| ${v:M*_CMD} \
|| ${v:M*_CMD_DEFAULT} \
|| ${v:M*_SKIP} \
+ || ${v:M*INSTALL_SRC} \
|| ${v:MMASTER_SITE*} \
|| ${v:MSUBST_FILES.*} \
|| ${v:MSUBST_SED.*} \
@@ -177,13 +180,13 @@ show-all-${g}: .PHONY
# multi-valued variables, preserving original order
${RUN} \
if ${!defined(${v}) :? true : false}; then \
- printf ' %s\t%s (undefined)\n' ${_LABEL.${c}} ${v:Q}; \
+ printf ' %s\t%-23s # undefined\n' ${_LABEL.${c}} ${v:Q}; \
elif value=${${v}:U:M*:Q} && test "x$$value" = "x"; then \
- printf ' %s\t%s = # empty\n' ${_LABEL.${c}} ${v:Q}; \
+ printf ' %s\t%-23s # empty\n' ${_LABEL.${c}} ${v:Q}=; \
else \
- printf ' %s\t%s = \\\n' ${_LABEL.${c}} ${v:Q}; \
- printf ' \t\t%s \\\n' ${${v}:@x@${x:Q}@}; \
- printf ' \t\t# end of %s\n' ${v:Q}; \
+ printf ' %s\t%-23s \\\n' ${_LABEL.${c}} ${v:Q}=; \
+ printf '\t\t\t\t%s \\\n' ${${v}:@x@${x:Q}@}; \
+ printf '\t\t\t\t# end of %s\n' ${v:Q}; \
fi
. else
@@ -191,11 +194,12 @@ show-all-${g}: .PHONY
# single-valued variables
${RUN} \
if ${!defined(${v}) :? true : false}; then \
- printf ' %s\t%s (undefined)\n' ${_LABEL.${c}} ${v:Q}; \
+ printf ' %s\t%-23s # undefined\n' ${_LABEL.${c}} ${v:Q}; \
elif value=${${v}:U:Q} && test "x$$value" = "x"; then \
- printf ' %s\t%s = # empty\n' ${_LABEL.${c}} ${v:Q}; \
+ printf ' %s\t%-23s # empty\n' ${_LABEL.${c}} ${v:Q}=; \
else \
- printf ' %s\t%s = %s\n' ${_LABEL.${c}} ${v:Q} "$$value"; \
+ case "$$value" in (*[\ \ ]) eol="# ends with space";; (*) eol=""; esac; \
+ printf ' %s\t%-23s %s\n' ${_LABEL.${c}} ${v:Q}= "$$value$$eol"; \
fi
. endif
@@ -213,4 +217,3 @@ show-depends-options:
cd ${.CURDIR}/../../$$dir && \
${RECURSIVE_MAKE} ${MAKEFLAGS} show-options; \
done
-