diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-03-19 07:26:12 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-03-25 13:01:28 -0400 |
commit | 5e18f0290f2eccb0f64e87fbfca6395f11985b4b (patch) | |
tree | 08dbdb849b1b0e8de73bc5e29e866ddbce4519f7 | |
parent | 7657f60e8ffad587fabc74873b5f42083a60c3cf (diff) |
kbuild: clean up archive rule of built-in.a
With the incremental linking entirely dropped, we can simplify
the Makefile.
While I am here, I renamed cmd_link_o_target to cmd_ar_builtin.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r-- | scripts/Makefile.build | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 66461e9323b4..e5c1aa347554 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -450,17 +450,12 @@ ifdef builtin-target | |||
450 | # makes them small and fast, but unable to be used by the linker. | 450 | # makes them small and fast, but unable to be used by the linker. |
451 | # scripts/link-vmlinux.sh builds an aggregate built-in.a with a symbol | 451 | # scripts/link-vmlinux.sh builds an aggregate built-in.a with a symbol |
452 | # table and index. | 452 | # table and index. |
453 | cmd_make_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) | 453 | quiet_cmd_ar_builtin = AR $@ |
454 | cmd_make_empty_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) | 454 | cmd_ar_builtin = rm -f $@; \ |
455 | quiet_cmd_link_o_target = AR $@ | 455 | $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(filter $(real-obj-y), $^) |
456 | |||
457 | # If the list of objects to link is empty, just create an empty built-in.a | ||
458 | cmd_link_o_target = $(if $(strip $(real-obj-y)),\ | ||
459 | $(cmd_make_builtin) $@ $(filter $(real-obj-y), $^), \ | ||
460 | $(cmd_make_empty_builtin) $@) | ||
461 | 456 | ||
462 | $(builtin-target): $(real-obj-y) FORCE | 457 | $(builtin-target): $(real-obj-y) FORCE |
463 | $(call if_changed,link_o_target) | 458 | $(call if_changed,ar_builtin) |
464 | 459 | ||
465 | targets += $(builtin-target) | 460 | targets += $(builtin-target) |
466 | endif # builtin-target | 461 | endif # builtin-target |