kbuild: call make once for all targets when O=.. is used
[linux-3.10.git] / scripts / mkmakefile
index 7f9d544f9b6c07339021bdb80762feeb7b95f9bf..ee39facee15238f8f4148fc2b7e914f07a31b613 100644 (file)
@@ -26,11 +26,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