]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
kbuild: change if_changed_rule for multi-line recipe
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 20 May 2025 05:21:25 +0000 (08:21 +0300)
committerTom Rini <trini@konsulko.com>
Fri, 30 May 2025 00:42:37 +0000 (18:42 -0600)
Backport from kernel
commit 3a2429e1faf4 ("kbuild: change if_changed_rule for multi-line recipe")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
scripts/Kbuild.include
scripts/Makefile.build

index 6ef66c451eb1f7dfb1da4ea03b5b4def933f7dc1..c0d3440a4b3ee11ace2d654c54f2a7a70892764a 100644 (file)
@@ -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
index 639091e7b29c7d37c35b0370baa643337a0905bf..59ff37a53208f3e947e870bf03d4d45a691c7e51 100644 (file)
@@ -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