X-Git-Url: https://git.stricted.de/?a=blobdiff_plain;f=scripts%2Fmkmakefile;h=67d59c7a18dc57b1580a833ed37e832eff227c85;hb=7187adbf08336bd69da11d42d2542de7b1cc6957;hp=9ad1bd793252ff4241e99813b3c179afc99e9363;hpb=c34c15b02e0af7e235f84ca1471747ee1cbb1b87;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git diff --git a/scripts/mkmakefile b/scripts/mkmakefile index 9ad1bd793252..67d59c7a18dc 100644 --- a/scripts/mkmakefile +++ b/scripts/mkmakefile @@ -13,11 +13,13 @@ test ! -r $2/Makefile -o -O $2/Makefile || exit 0 # Only overwrite automatically generated Makefiles # (so we do not overwrite kernel Makefile) -if ! grep -q Automatically $2/Makefile +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