OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / make / include / base.rules
index f128864..4d9e5ce 100644 (file)
@@ -1,16 +1,41 @@
-.PHONY: report.main report.gcc report.modules
+.PHONY: report.main report.gcc report.modules report.var report.true report.help
+.PHONY: shell.run
 
 report.modules::
 
-.PHONY: report.main
 report.main:
        @$(MAKE) report.true REPORT=main
 
-.PHONY: report.gcc
 report.gcc:
        @$(MAKE) report.true REPORT=gcc
 
+report.var:
+       @$(MAKE) report.true REPORT=var
+
 ## needed for nested make (which drives each report)
-.PHONY: report.true
 report.true:
        @true
+
+## linefeed is important
+define REPORT.help.item.global
+       @echo 'report.$(1)' | awk '{ printf("  %-21s  $(REPORT.help.$(1))\n", $$0) }'
+
+endef
+define REPORT.help.item.module
+       @echo '$($(1).name).report' | awk '{ printf("  %-21s  $(1)-scoped vars\n", $$0) }'
+
+endef
+
+REPORT.help.main = global general vars
+REPORT.help.gcc  = global gcc vars (inherited by module GCC)
+REPORT.help.var  = usage: make report.var name=VARNAME
+
+report.help:
+       @echo "  AVAILABLE MAKEFILE VARS REPORTS"
+       @echo "  ----------------------------------------------------------------"
+       $(foreach n,main gcc var,$(call REPORT.help.item.global,$n))
+       $(foreach n,$(MODULES.NAMES),$(call REPORT.help.item.module,$n))
+
+## diagnostic aid when troubleshooting build issues
+shell.run:
+       $(command)