X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fmkmakefile;h=67d59c7a18dc57b1580a833ed37e832eff227c85;hb=86f162f4c75ceb6daf43165469eeeca1bc3d4639;hp=e0f54b9d8feca95bf693ec7cc9ad294bd70ab1df;hpb=61c93f4eb45493f203d6bad24156599668be614f;p=pandora-kernel.git diff --git a/scripts/mkmakefile b/scripts/mkmakefile index e0f54b9d8fec..67d59c7a18dc 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