linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: move archive command to scripts/Makefile.lib
@ 2019-02-05  7:33 Masahiro Yamada
  2019-02-14  2:09 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2019-02-05  7:33 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Masahiro Yamada, linux-s390, Vasily Gorbik, Heiko Carstens,
	linux-kernel, Michal Marek, Martin Schwidefsky

scripts/Makefile.build and arch/s390/boot/Makefile use the same
command (thin archiving with symbol table creation).

Avoid the code duplication, and move it to scripts/Makefile.lib.

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

 arch/s390/boot/Makefile | 3 ---
 scripts/Makefile.build  | 6 +-----
 scripts/Makefile.lib    | 6 ++++++
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile
index 11ca879..c844eaf 100644
--- a/arch/s390/boot/Makefile
+++ b/arch/s390/boot/Makefile
@@ -57,9 +57,6 @@ $(obj)/section_cmp%: vmlinux $(obj)/compressed/vmlinux FORCE
 $(obj)/compressed/vmlinux: $(obj)/startup.a FORCE
 	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
 
-quiet_cmd_ar = AR      $@
-      cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs)
-
 $(obj)/startup.a: $(OBJECTS) FORCE
 	$(call if_changed,ar)
 
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index f8e2794..99be01c 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -424,13 +424,9 @@ $(modorder-target): $(subdir-ym) FORCE
 # Rule to compile a set of .o files into one .a file (with symbol table)
 #
 ifdef lib-target
-quiet_cmd_link_l_target = AR      $@
-
-# lib target archives do get a symbol table and index
-cmd_link_l_target = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs)
 
 $(lib-target): $(lib-y) FORCE
-	$(call if_changed,link_l_target)
+	$(call if_changed,ar)
 
 targets += $(lib-target)
 
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index c0abd9a..8a1f64f 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -233,6 +233,12 @@ $(obj)/%: $(src)/%_shipped
 quiet_cmd_ld = LD      $@
       cmd_ld = $(LD) $(ld_flags) $(real-prereqs) -o $@
 
+# Archive
+# ---------------------------------------------------------------------------
+
+quiet_cmd_ar = AR      $@
+      cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs)
+
 # Objcopy
 # ---------------------------------------------------------------------------
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: move archive command to scripts/Makefile.lib
  2019-02-05  7:33 [PATCH] kbuild: move archive command to scripts/Makefile.lib Masahiro Yamada
@ 2019-02-14  2:09 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2019-02-14  2:09 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: linux-s390, Vasily Gorbik, Heiko Carstens,
	Linux Kernel Mailing List, Michal Marek, Martin Schwidefsky

On Tue, Feb 5, 2019 at 4:34 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> scripts/Makefile.build and arch/s390/boot/Makefile use the same
> command (thin archiving with symbol table creation).
>
> Avoid the code duplication, and move it to scripts/Makefile.lib.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Applied to linux-kbuild.



>  arch/s390/boot/Makefile | 3 ---
>  scripts/Makefile.build  | 6 +-----
>  scripts/Makefile.lib    | 6 ++++++
>  3 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile
> index 11ca879..c844eaf 100644
> --- a/arch/s390/boot/Makefile
> +++ b/arch/s390/boot/Makefile
> @@ -57,9 +57,6 @@ $(obj)/section_cmp%: vmlinux $(obj)/compressed/vmlinux FORCE
>  $(obj)/compressed/vmlinux: $(obj)/startup.a FORCE
>         $(Q)$(MAKE) $(build)=$(obj)/compressed $@
>
> -quiet_cmd_ar = AR      $@
> -      cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs)
> -
>  $(obj)/startup.a: $(OBJECTS) FORCE
>         $(call if_changed,ar)
>
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index f8e2794..99be01c 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -424,13 +424,9 @@ $(modorder-target): $(subdir-ym) FORCE
>  # Rule to compile a set of .o files into one .a file (with symbol table)
>  #
>  ifdef lib-target
> -quiet_cmd_link_l_target = AR      $@
> -
> -# lib target archives do get a symbol table and index
> -cmd_link_l_target = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs)
>
>  $(lib-target): $(lib-y) FORCE
> -       $(call if_changed,link_l_target)
> +       $(call if_changed,ar)
>
>  targets += $(lib-target)
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index c0abd9a..8a1f64f 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -233,6 +233,12 @@ $(obj)/%: $(src)/%_shipped
>  quiet_cmd_ld = LD      $@
>        cmd_ld = $(LD) $(ld_flags) $(real-prereqs) -o $@
>
> +# Archive
> +# ---------------------------------------------------------------------------
> +
> +quiet_cmd_ar = AR      $@
> +      cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs)
> +
>  # Objcopy
>  # ---------------------------------------------------------------------------
>
> --
> 2.7.4
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-14  2:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-05  7:33 [PATCH] kbuild: move archive command to scripts/Makefile.lib Masahiro Yamada
2019-02-14  2:09 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).