X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fmkmakefile;h=e0f54b9d8feca95bf693ec7cc9ad294bd70ab1df;hb=36091fd348e79ab703b0766420c0b06ff7662d2d;hp=7f9d544f9b6c07339021bdb80762feeb7b95f9bf;hpb=5dd8816aeb1f068ade0349a22009ff7a66f25413;p=linux-2.6 diff --git a/scripts/mkmakefile b/scripts/mkmakefile index 7f9d544f9b..e0f54b9d8f 100644 --- a/scripts/mkmakefile +++ b/scripts/mkmakefile @@ -11,6 +11,12 @@ test ! -r $2/Makefile -o -O $2/Makefile || exit 0 +# Only overwrite automatically generated Makefiles +# (so we do not overwrite kernel Makefile) +if test -e $2/Makefile && ! grep -q Automatically $2/Makefile +then + exit 0 +fi echo " GEN $2/Makefile" cat << EOF > $2/Makefile @@ -26,11 +32,13 @@ MAKEFLAGS += --no-print-directory .PHONY: all \$(MAKECMDGOALS) +all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) + all: - \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) + \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$(all) Makefile:; -\$(filter-out all Makefile,\$(MAKECMDGOALS)) %/: - \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@ +\$(all) %/: all + @: EOF