20869828 Userland makefiles should provide macro printing helpers
authorNorm Jacobs <Norm.Jacobs@Oracle.COM>
Mon, 13 Apr 2015 09:25:17 -0500
changeset 4195 d88c5d15a4af
parent 4194 ea36499292b9
child 4196 d697072a92f5
20869828 Userland makefiles should provide macro printing helpers
make-rules/shared-macros.mk
--- a/make-rules/shared-macros.mk	Wed Apr 22 23:13:31 2015 -0500
+++ b/make-rules/shared-macros.mk	Mon Apr 13 09:25:17 2015 -0500
@@ -946,3 +946,10 @@
 REQUIRED_PACKAGES += security/sudo
 
 include $(WS_MAKE_RULES)/environment.mk
+
+# A simple rule to print the value of any macro.  Ex:
+#   $ gmake print-REQUIRED_PACKAGES
+# Note that some macros are set on a per target basis, so what you see
+# is not always what you get.
+print-%:
+	@echo '$(subst ','\'',$*=$($*)) (origin: $(origin $*), flavor: $(flavor $*))'