diff mbox series

kbuild: remove unneeded link_multi_deps

Message ID 1536826841-4458-1-git-send-email-yamada.masahiro@socionext.com
State Superseded
Headers show
Series kbuild: remove unneeded link_multi_deps | expand

Commit Message

Masahiro Yamada Sept. 13, 2018, 8:20 a.m. UTC
Since commit c8589d1e9e01 ("kbuild: handle multi-objs dependency
appropriately"), $^ really represents all the prerequisite of the
composite object being built.

Hence, $(filter-out FORCE,$^) contains all the objects to link
together, which is much simpler than link_multi_deps calculation.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

 scripts/Makefile.build | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

-- 
2.7.4

Comments

Masahiro Yamada Sept. 30, 2018, 1:44 p.m. UTC | #1
2018年9月13日(木) 17:22 Masahiro Yamada <yamada.masahiro@socionext.com>:
>

> Since commit c8589d1e9e01 ("kbuild: handle multi-objs dependency

> appropriately"), $^ really represents all the prerequisite of the

> composite object being built.

>

> Hence, $(filter-out FORCE,$^) contains all the objects to link

> together, which is much simpler than link_multi_deps calculation.

>

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

> ---


Applied to linux-kbuild.


>  scripts/Makefile.build | 20 ++------------------

>  1 file changed, 2 insertions(+), 18 deletions(-)

>

> diff --git a/scripts/Makefile.build b/scripts/Makefile.build

> index cb03774..d7fa203 100644

> --- a/scripts/Makefile.build

> +++ b/scripts/Makefile.build

> @@ -485,28 +485,12 @@ targets += $(obj)/lib-ksyms.o

>

>  endif

>

> -#

> -# Rule to link composite objects

> -#

> -#  Composite objects are specified in kbuild makefile as follows:

> -#    <composite-object>-objs := <list of .o files>

> -#  or

> -#    <composite-object>-y    := <list of .o files>

> -#  or

> -#    <composite-object>-m    := <list of .o files>

> -#  The -m syntax only works if <composite object> is a module

> -link_multi_deps =                     \

> -$(filter $(addprefix $(obj)/,         \

> -$($(subst $(obj)/,,$(@:.o=-objs)))    \

> -$($(subst $(obj)/,,$(@:.o=-y)))       \

> -$($(subst $(obj)/,,$(@:.o=-m)))), $^)

> -

>  quiet_cmd_link_multi-m = LD [M]  $@

> -cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)

> +cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter-out FORCE,$^) $(cmd_secanalysis)

>

>  $(multi-used-m): FORCE

>         $(call if_changed,link_multi-m)

> -       @{ echo $(@:.o=.ko); echo $(link_multi_deps); \

> +       @{ echo $(@:.o=.ko); echo $(filter-out FORCE,$^); \

>            $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod)

>  $(call multi_depend, $(multi-used-m), .o, -objs -y -m)

>

> --

> 2.7.4

>



-- 
Best Regards
Masahiro Yamada
diff mbox series

Patch

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index cb03774..d7fa203 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -485,28 +485,12 @@  targets += $(obj)/lib-ksyms.o
 
 endif
 
-#
-# Rule to link composite objects
-#
-#  Composite objects are specified in kbuild makefile as follows:
-#    <composite-object>-objs := <list of .o files>
-#  or
-#    <composite-object>-y    := <list of .o files>
-#  or
-#    <composite-object>-m    := <list of .o files>
-#  The -m syntax only works if <composite object> is a module
-link_multi_deps =                     \
-$(filter $(addprefix $(obj)/,         \
-$($(subst $(obj)/,,$(@:.o=-objs)))    \
-$($(subst $(obj)/,,$(@:.o=-y)))       \
-$($(subst $(obj)/,,$(@:.o=-m)))), $^)
-
 quiet_cmd_link_multi-m = LD [M]  $@
-cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
+cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter-out FORCE,$^) $(cmd_secanalysis)
 
 $(multi-used-m): FORCE
 	$(call if_changed,link_multi-m)
-	@{ echo $(@:.o=.ko); echo $(link_multi_deps); \
+	@{ echo $(@:.o=.ko); echo $(filter-out FORCE,$^); \
 	   $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod)
 $(call multi_depend, $(multi-used-m), .o, -objs -y -m)