kbuild: add cmd_and_savecmd macro
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 27 May 2022 10:01:54 +0000 (19:01 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 1 Jun 2022 14:07:29 +0000 (23:07 +0900)
commitebd191b38c5ea177318543a08e544cf2f7df944d
tree30ff7589124833ebe70dbcbbb91a26176ca4afda
parentc6031b1dbbbfec03891bf1baefa2e0803d705601
kbuild: add cmd_and_savecmd macro

Separate out the command execution part of if_changed, as we did
for if_changed_dep.

This allows us to reuse it in if_changed_rule.

  define rule_foo
          $(call cmd_and_savecmd,foo)
          $(call cmd,bar)
  endef

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nicolas Schier <n.schier@avm.de>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
scripts/Kbuild.include