aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2006-03-05 17:14:10 -0500
committerSam Ravnborg <sam@mars.ravnborg.org>2006-03-05 18:09:51 -0500
commit4f1933620f57145212cdbb1ac6ce099eeeb21c5a (patch)
treec083cce1f0acedd92be2ac6eb5e6c49ebd84ac46 /scripts/Makefile.build
parent7b75b13cda8bd21e8636ea985f76e1ce5bd1a470 (diff)
kbuild: change kbuild to not rely on incorrect GNU make behavior
The kbuild system takes advantage of an incorrect behavior in GNU make. Once this behavior is fixed, all files in the kernel rebuild every time, even if nothing has changed. This patch ensures kbuild works with both the incorrect and correct behaviors of GNU make. For more details on the incorrect behavior, see: http://lists.gnu.org/archive/html/bug-make/2006-03/msg00003.html Changes in this patch: - Keep all targets that are to be marked .PHONY in a variable, PHONY. - Add .PHONY: $(PHONY) to mark them properly. - Remove any $(PHONY) files from the $? list when determining whether targets are up-to-date or not. Signed-off-by: Paul Smith <psmith@gnu.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 6ac96ea92bfc..7afe3e76cb5a 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -4,7 +4,7 @@
4 4
5src := $(obj) 5src := $(obj)
6 6
7.PHONY: __build 7PHONY := __build
8__build: 8__build:
9 9
10# Read .config if it exist, otherwise ignore 10# Read .config if it exist, otherwise ignore
@@ -308,14 +308,14 @@ targets += $(multi-used-y) $(multi-used-m)
308# Descending 308# Descending
309# --------------------------------------------------------------------------- 309# ---------------------------------------------------------------------------
310 310
311.PHONY: $(subdir-ym) 311PHONY += $(subdir-ym)
312$(subdir-ym): 312$(subdir-ym):
313 $(Q)$(MAKE) $(build)=$@ 313 $(Q)$(MAKE) $(build)=$@
314 314
315# Add FORCE to the prequisites of a target to force it to be always rebuilt. 315# Add FORCE to the prequisites of a target to force it to be always rebuilt.
316# --------------------------------------------------------------------------- 316# ---------------------------------------------------------------------------
317 317
318.PHONY: FORCE 318PHONY += FORCE
319 319
320FORCE: 320FORCE:
321 321
@@ -330,3 +330,9 @@ cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
330ifneq ($(cmd_files),) 330ifneq ($(cmd_files),)
331 include $(cmd_files) 331 include $(cmd_files)
332endif 332endif
333
334
335# Declare the contents of the .PHONY variable as phony. We keep that
336# information in a variable se we can use it in if_changed and friends.
337
338.PHONY: $(PHONY)