]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - scripts/mkmakefile
Pull battery-2.6.24 into release branch
[karo-tx-linux.git] / scripts / mkmakefile
index 7f9d544f9b6c07339021bdb80762feeb7b95f9bf..9ad1bd793252ff4241e99813b3c179afc99e9363 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 ! 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