]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - scripts/mkmakefile
[ARM] 4764/1: [AT91] AT91CAP9 core support
[linux-2.6-omap-h63xx.git] / scripts / mkmakefile
index 7f9d544f9b6c07339021bdb80762feeb7b95f9bf..e0f54b9d8feca95bf693ec7cc9ad294bd70ab1df 100644 (file)
 
 
 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