diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2007-12-06 16:20:11 -0500 |
---|---|---|
committer | Sam Ravnborg <sam@saturn.ravnborg.org> | 2007-12-09 02:43:42 -0500 |
commit | 1cacc9ab8bf10e60b3ed93d7a10b070c4cbc6c9f (patch) | |
tree | 2cd03edf980a9f9cbb71d2e33d516260705668ce | |
parent | 94545baded0bfbabdc30a3a4cb48b3db479dd6ef (diff) |
kbuild: fix building with redirected output.
Jan Altenberg <jan.altenberg@linutronix.de> 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 <sam@ravnborg.org>
-rw-r--r-- | Makefile | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -108,6 +108,9 @@ endif | |||
108 | PHONY := _all | 108 | PHONY := _all |
109 | _all: | 109 | _all: |
110 | 110 | ||
111 | # Cancel implicit rules on top Makefile | ||
112 | $(CURDIR)/Makefile Makefile: ; | ||
113 | |||
111 | ifneq ($(KBUILD_OUTPUT),) | 114 | ifneq ($(KBUILD_OUTPUT),) |
112 | # Invoke a second make in the output directory, passing relevant variables | 115 | # Invoke a second make in the output directory, passing relevant variables |
113 | # check that the output directory actually exists | 116 | # check that the output directory actually exists |
@@ -121,7 +124,7 @@ $(if $(filter-out $(KBUILD_OUTPUT),$(shell /bin/pwd)),, \ | |||
121 | 124 | ||
122 | PHONY += $(MAKECMDGOALS) sub-make | 125 | PHONY += $(MAKECMDGOALS) sub-make |
123 | 126 | ||
124 | $(filter-out _all sub-make,$(MAKECMDGOALS)) _all: sub-make | 127 | $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make |
125 | $(Q)@: | 128 | $(Q)@: |
126 | 129 | ||
127 | sub-make: FORCE | 130 | sub-make: FORCE |
@@ -291,7 +294,8 @@ export quiet Q KBUILD_VERBOSE | |||
291 | # Look for make include files relative to root of kernel src | 294 | # Look for make include files relative to root of kernel src |
292 | MAKEFLAGS += --include-dir=$(srctree) | 295 | MAKEFLAGS += --include-dir=$(srctree) |
293 | 296 | ||
294 | # We need some generic definitions. | 297 | # We need some generic definitions (do not try to remake the file). |
298 | $(srctree)/scripts/Kbuild.include: ; | ||
295 | include $(srctree)/scripts/Kbuild.include | 299 | include $(srctree)/scripts/Kbuild.include |
296 | 300 | ||
297 | # Make variables (CC, etc...) | 301 | # Make variables (CC, etc...) |
@@ -1560,9 +1564,6 @@ endif # skip-makefile | |||
1560 | PHONY += FORCE | 1564 | PHONY += FORCE |
1561 | FORCE: | 1565 | FORCE: |
1562 | 1566 | ||
1563 | # Cancel implicit rules on top Makefile, `-rR' will apply to sub-makes. | ||
1564 | Makefile: ; | ||
1565 | |||
1566 | # Declare the contents of the .PHONY variable as phony. We keep that | 1567 | # Declare the contents of the .PHONY variable as phony. We keep that |
1567 | # information in a variable se we can use it in if_changed and friends. | 1568 | # information in a variable se we can use it in if_changed and friends. |
1568 | .PHONY: $(PHONY) | 1569 | .PHONY: $(PHONY) |