Commit:     1cacc9ab8bf10e60b3ed93d7a10b070c4cbc6c9f
Parent:     94545baded0bfbabdc30a3a4cb48b3db479dd6ef
Author:     Sam Ravnborg <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 6 22:20:11 2007 +0100
Committer:  Sam Ravnborg <[EMAIL PROTECTED]>
CommitDate: Sun Dec 9 08:43:42 2007 +0100

    kbuild: fix building with redirected output.
    Jan Altenberg <[EMAIL PROTECTED]> reported that
    building with redirected input like this failed:
    make O=dir oldconfig bzImage < /dev/null
    The problem were caused by a make silentoldconfig being
    run before oldconfig and with a non-recent .config the build
    failed because silentoldconfig requires non-redirected stdin.
    Silentoldconfig was run as a side-effect of having the
    top-level Makefile re-made by make.
    Introducing an empty rule for the top-level Makefile
    (and Kbuild.include) fixed the issue.
    Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
 Makefile |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 92dc3cb..a5252f4 100644
--- a/Makefile
+++ b/Makefile
@@ -108,6 +108,9 @@ endif
 PHONY := _all
+# Cancel implicit rules on top Makefile
+$(CURDIR)/Makefile Makefile: ;
 ifneq ($(KBUILD_OUTPUT),)
 # Invoke a second make in the output directory, passing relevant variables
 # check that the output directory actually exists
@@ -121,7 +124,7 @@ $(if $(filter-out $(KBUILD_OUTPUT),$(shell /bin/pwd)),, \
 PHONY += $(MAKECMDGOALS) sub-make
-$(filter-out _all sub-make,$(MAKECMDGOALS)) _all: sub-make
+$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
 sub-make: FORCE
@@ -291,7 +294,8 @@ export quiet Q KBUILD_VERBOSE
 # Look for make include files relative to root of kernel src
 MAKEFLAGS += --include-dir=$(srctree)
-# We need some generic definitions.
+# We need some generic definitions (do not try to remake the file).
+$(srctree)/scripts/Kbuild.include: ;
 include $(srctree)/scripts/Kbuild.include
 # Make variables (CC, etc...)
@@ -1560,9 +1564,6 @@ endif     # skip-makefile
-# Cancel implicit rules on top Makefile, `-rR' will apply to sub-makes.
-Makefile: ;
 # Declare the contents of the .PHONY variable as phony.  We keep that
 # information in a variable se we can use it in if_changed and friends.
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to