diff mbox series

[3/7] kbuild: reuse real-search to simplify cmd_mod

Message ID 20220406153023.500847-4-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series kbuild: more misc cleanups | expand

Commit Message

Masahiro Yamada April 6, 2022, 3:30 p.m. UTC
The first command in cmd_mod is similar to the real-search macro.
Reuse it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/Makefile.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nick Desaulniers April 7, 2022, 5:38 p.m. UTC | #1
On Wed, Apr 6, 2022 at 8:31 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> The first command in cmd_mod is similar to the real-search macro.
> Reuse it.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>
>  scripts/Makefile.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index f15c245dc17e..857329844789 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -306,7 +306,7 @@ $(obj)/%.prelink.o: $(obj)/%.o FORCE
>  endif
>
>  cmd_mod = { \
> -       echo $(if $($*-objs)$($*-y)$($*-m), $(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)), $(@:.mod=.o)); \
> +       echo $(addprefix $(obj)/, $(call real-search, $*.o, .o, -objs -y -m)); \
>         $(undefined_syms) echo; \
>         } > $@
>
> --
> 2.32.0
>
diff mbox series

Patch

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index f15c245dc17e..857329844789 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -306,7 +306,7 @@  $(obj)/%.prelink.o: $(obj)/%.o FORCE
 endif
 
 cmd_mod = { \
-	echo $(if $($*-objs)$($*-y)$($*-m), $(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)), $(@:.mod=.o)); \
+	echo $(addprefix $(obj)/, $(call real-search, $*.o, .o, -objs -y -m)); \
 	$(undefined_syms) echo; \
 	} > $@