summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2025-05-20 08:21:25 +0300
committerTom Rini <trini@konsulko.com>2025-05-29 18:42:37 -0600
commitdaf8f5af4c9e542ac75b2ddf7f2831b73833b49d (patch)
tree091e248a16c19135c0b23d67bbb1d6fb38b9b64a
parent3679f24373d609b59e6434afb5253fd8c7af730a (diff)
kbuild: change if_changed_rule for multi-line recipe
Backport from kernel commit 3a2429e1faf4 ("kbuild: change if_changed_rule for multi-line recipe") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r--scripts/Kbuild.include12
-rw-r--r--scripts/Makefile.build12
2 files changed, 11 insertions, 13 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 6ef66c451eb..c0d3440a4b3 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -226,7 +226,7 @@ echo-cmd = $(if $($(quiet)cmd_$(1)),\
echo ' $(call escsq,$($(quiet)cmd_$(1)))$(echo-why)';)
# printing commands
-cmd = @$(echo-cmd) $(cmd_$(1))
+cmd = @set -e; $(echo-cmd) $(cmd_$(1))
# Add $(obj)/ for paths that are not absolute
objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o)))
@@ -268,21 +268,17 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)
# Execute the command and also postprocess generated .d dependencies file.
-if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \
- @set -e; \
- $(cmd_and_fixdep), @:)
+if_changed_dep = $(if $(strip $(any-prereq) $(arg-check)),$(cmd_and_fixdep),@:)
cmd_and_fixdep = \
- $(echo-cmd) $(cmd_$(1)); \
+ $(cmd); \
scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).cmd;\
rm -f $(depfile)
# Usage: $(call if_changed_rule,foo)
# Will check if $(cmd_foo) or any of the prerequisites changed,
# and if so will execute $(rule_foo).
-if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \
- @set -e; \
- $(rule_$(1)), @:)
+if_changed_rule = $(if $(strip $(any-prereq) $(arg-check)),$(rule_$(1)),@:)
###
# why - tell why a a target got build
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 639091e7b29..59ff37a5320 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -236,11 +236,13 @@ endif # -record-mcount
endif
define rule_cc_o_c
- $(call echo-cmd,checksrc) $(cmd_checksrc) \
- $(call cmd_and_fixdep,cc_o_c) \
- $(cmd_modversions) \
- $(cmd_objtool) \
- $(call echo-cmd,record_mcount) $(cmd_record_mcount)
+ $(call cmd,checksrc)
+ $(call cmd_and_fixdep,cc_o_c)
+ $(call cmd,gen_ksymdeps)
+ $(call cmd,checkdoc)
+ $(call cmd,objtool)
+ $(call cmd,modversions_c)
+ $(call cmd,record_mcount)
endef
define rule_as_o_S