aboutsummaryrefslogtreecommitdiff
path: root/scripts/Kbuild.include
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-06 00:09:51 +0100
commit4f1933620f57145212cdbb1ac6ce099eeeb21c5a (patch)
treec083cce1f0acedd92be2ac6eb5e6c49ebd84ac46 /scripts/Kbuild.include
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/Kbuild.include')
-rw-r--r--scripts/Kbuild.include13
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index c3d2e4e068c..59620b1554e 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -116,16 +116,18 @@ make-cmd = $(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1)))))
# function to only execute the passed command if necessary
# >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file
# note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars
-#
-if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
+#
+if_changed = $(if $(strip $(filter-out $(PHONY),$?) \
+ $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
@set -e; \
$(echo-cmd) $(cmd_$(1)); \
echo 'cmd_$@ := $(make-cmd)' > $(@D)/.$(@F).cmd)
# execute the command and also postprocess generated .d dependencies
# file
-if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
- $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
+if_changed_dep = $(if $(strip $(filter-out $(PHONY),$?) \
+ $(filter-out FORCE $(wildcard $^),$^) \
+ $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
@set -e; \
$(echo-cmd) $(cmd_$(1)); \
scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(@D)/.$(@F).tmp; \
@@ -135,6 +137,7 @@ if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
# Usage: $(call if_changed_rule,foo)
# will check if $(cmd_foo) changed, or any of the prequisites changed,
# and if so will execute $(rule_foo)
-if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\
+if_changed_rule = $(if $(strip $(filter-out $(PHONY),$?) \
+ $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\
@set -e; \
$(rule_$(1)))