X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=scripts%2Fmkmakefile;h=67d59c7a18dc57b1580a833ed37e832eff227c85;hb=47420c799830d4676e544dbec56b2a7f787528f5;hp=e0f54b9d8feca95bf693ec7cc9ad294bd70ab1df;hpb=13ef7b69b54aa8ae4ed264d0bf41339737f8543a;p=linux-2.6-omap-h63xx.git diff --git a/scripts/mkmakefile b/scripts/mkmakefile index e0f54b9d8fe..67d59c7a18d 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 @@ -25,8 +27,11 @@ cat << EOF > $2/Makefile VERSION = $3 PATCHLEVEL = $4 -KERNELSRC := $1 -KERNELOUTPUT := $2 +lastword = \$(word \$(words \$(1)),\$(1)) +makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST))) + +MAKEARGS := -C $1 +MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir)) MAKEFLAGS += --no-print-directory @@ -35,10 +40,11 @@ MAKEFLAGS += --no-print-directory all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) all: - \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$(all) + \$(MAKE) \$(MAKEARGS) \$(all) Makefile:; \$(all) %/: all @: + EOF