[PATCH 2/5] scripts: Add common library functions

Masahiro Yamada masahiroy at kernel.org
Mon Oct 11 07:37:07 PDT 2021


On Wed, Oct 6, 2021 at 11:26 PM Sascha Hauer <s.hauer at pengutronix.de> wrote:
>
> Several functions are duplicated in different host tools. This patch
> starts collecting them in a single C file. We start with read_file()
> and read_file_2(), others follow in separate commits.
>
> It would be great to compile these functions in a separate library, but
> I don't know how this can be archieved in Kbuild. Instead, the C file
> is included where needed. Not nice, not beautiful, but at least enough
> to get something going.


You can try this.


hostprogs-always-$(CONFIG_IMD)   += bareboximd
bareboximd-objs                                 := bareboximd.o common.o


hostprogs-always-$(CONFIG_OMAP3_USB_LOADER) += omap3-usb-loader
omap3-usb-loader-objs                       := omap3-usb-loader.o common.o





--
Best Regards
Masahiro Yamada



More information about the barebox mailing list