kbuild: reuse suffix-search to refactor multi_depend

The complicated part of multi_depend is the same as suffix-search.

Reuse it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
This commit is contained in:
Masahiro Yamada 2022-04-07 00:30:17 +09:00
parent 7cfa2fcbac
commit 9eef99f7a3
1 changed files with 1 additions and 1 deletions

View File

@ -238,7 +238,7 @@ endif
define multi_depend
$(foreach m, $(notdir $1), \
$(eval $(obj)/$m: \
$(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s)))))))
$(addprefix $(obj)/, $(call suffix-search, $m, $2, $3))))
endef
# Copy a file