kbuild: unify barebox and pbl build commands
The current Linux uses the unified build command for built-in objects
and module objects. This is possible because part-of-module is set to
y when the target is being built for a module. If so, quiet_modtag is
set to [M], and modkern_cflags is set to KBUILD_CFLAGS_MODULE instead
of KBUILD_CFLAGS_KERNEL.

Currently, barebox uses a separate build command for pbl, but the
difference between cmd_cc_o_c and cmd_pbl_cc_o_c is just
"-D__PBL__ $(PBL_CPPFLAGS)".

By using the same approach as Linux, they can be unified.

Set part-of-pbl flag to y when the target is being built for pbl.
Merge cmd_as_o_S and cmd_link_o_target as well.

This also changes the shortlog style as follows:

  PBLCC  ->  CC [P]
  PBLAS  ->  AS [P]
  PBLLD  ->  LD [P]

This is more consistent with the policy in the Linux build system.

In Linux, a capital letter enclosed square blackets indicates which
target the object is being built for.

  CC      object built for built-in
  CC [M]  object built for modules
  CC [U]  object built for userspace (proposed for Linux 5.8-rc1)

The idea behind this is we use the same compiler $(CC) for them.
Only the difference is the compiler flags. On the other hand, host
programs are compiled by a different tool, $(HOSTCC), hence the
shortlog is 'HOSTCC'.

Barebox supports module builds (it seems), but the [P] notation does
not conflict with [M] because pbl has a limited memory footprint.
We never expect pbl can support the module feature.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent f74113d commit dc4cff0209ba243c5438fb278c46cbdb7889f44c
@Masahiro Yamada Masahiro Yamada authored on 19 May 2020
Sascha Hauer committed on 25 May 2020
Showing 2 changed files
View
scripts/Makefile.build
View
scripts/Makefile.lib