aboutsummaryrefslogtreecommitdiff
path: root/scripts/mkmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mkmakefile')
-rw-r--r--scripts/mkmakefile24
1 files changed, 14 insertions, 10 deletions
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index e65d8b33faa..84af27bf0f9 100644
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -17,7 +17,9 @@ if test -e $2/Makefile && ! grep -q Automatically $2/Makefile
then
exit 0
fi
-echo " GEN $2/Makefile"
+if [ "${quiet}" != "silent_" ]; then
+ echo " GEN $2/Makefile"
+fi
cat << EOF > $2/Makefile
# Automatically generated by $0: don't edit
@@ -28,21 +30,23 @@ PATCHLEVEL = $4
lastword = \$(word \$(words \$(1)),\$(1))
makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST)))
+ifeq ("\$(origin V)", "command line")
+VERBOSE := \$(V)
+endif
+ifneq (\$(VERBOSE),1)
+Q := @
+endif
+
MAKEARGS := -C $1
MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir))
MAKEFLAGS += --no-print-directory
-.PHONY: all \$(MAKECMDGOALS)
-
-all := \$(filter-out all Makefile,\$(MAKECMDGOALS))
+.PHONY: __sub-make \$(MAKECMDGOALS)
-all:
- \$(MAKE) \$(MAKEARGS) \$(all)
+__sub-make:
+ \$(Q)\$(MAKE) \$(MAKEARGS) \$(MAKECMDGOALS)
-Makefile:;
-
-\$(all) %/: all
+\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make
@:
-
EOF