diff options
Diffstat (limited to 'scripts/Kbuild.include')
-rw-r--r-- | scripts/Kbuild.include | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index c3d2e4e068c4..59620b1554e0 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -116,16 +116,18 @@ make-cmd = $(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1))))) | |||
116 | # function to only execute the passed command if necessary | 116 | # function to only execute the passed command if necessary |
117 | # >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file | 117 | # >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file |
118 | # note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars | 118 | # note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars |
119 | # | 119 | # |
120 | if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ | 120 | if_changed = $(if $(strip $(filter-out $(PHONY),$?) \ |
121 | $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ | ||
121 | @set -e; \ | 122 | @set -e; \ |
122 | $(echo-cmd) $(cmd_$(1)); \ | 123 | $(echo-cmd) $(cmd_$(1)); \ |
123 | echo 'cmd_$@ := $(make-cmd)' > $(@D)/.$(@F).cmd) | 124 | echo 'cmd_$@ := $(make-cmd)' > $(@D)/.$(@F).cmd) |
124 | 125 | ||
125 | # execute the command and also postprocess generated .d dependencies | 126 | # execute the command and also postprocess generated .d dependencies |
126 | # file | 127 | # file |
127 | if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ | 128 | if_changed_dep = $(if $(strip $(filter-out $(PHONY),$?) \ |
128 | $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ | 129 | $(filter-out FORCE $(wildcard $^),$^) \ |
130 | $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ | ||
129 | @set -e; \ | 131 | @set -e; \ |
130 | $(echo-cmd) $(cmd_$(1)); \ | 132 | $(echo-cmd) $(cmd_$(1)); \ |
131 | scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(@D)/.$(@F).tmp; \ | 133 | scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(@D)/.$(@F).tmp; \ |
@@ -135,6 +137,7 @@ if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ | |||
135 | # Usage: $(call if_changed_rule,foo) | 137 | # Usage: $(call if_changed_rule,foo) |
136 | # will check if $(cmd_foo) changed, or any of the prequisites changed, | 138 | # will check if $(cmd_foo) changed, or any of the prequisites changed, |
137 | # and if so will execute $(rule_foo) | 139 | # and if so will execute $(rule_foo) |
138 | if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ | 140 | if_changed_rule = $(if $(strip $(filter-out $(PHONY),$?) \ |
141 | $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ | ||
139 | @set -e; \ | 142 | @set -e; \ |
140 | $(rule_$(1))) | 143 | $(rule_$(1))) |