mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 2/5] scripts: Add common library functions
Date: Tue, 12 Oct 2021 01:38:27 +0900	[thread overview]
Message-ID: <CAK7LNASY0fnOH5S3xDVBCH7TsT-ThcPCwLBc19-TR2gU2wqHxQ@mail.gmail.com> (raw)
In-Reply-To: <20211011145248.GE28453@pengutronix.de>

On Mon, Oct 11, 2021 at 11:53 PM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> On Mon, Oct 11, 2021 at 11:37:07PM +0900, Masahiro Yamada wrote:
> > On Wed, Oct 6, 2021 at 11:26 PM Sascha Hauer <s.hauer@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
>
> I did and it works well as long as common.o is used only in a single
> directory. Unfortunately some tools are in subdirectories, like for
> example scripts/imx/imx-usb-loader.c. Of course these could be moved up
> one level, but I didn't want to go that path.
> Do you see any possibility to archieve the same with files in different
> directories?
>

Then, I have no idea.

At least, the Makefile part needs to be moved up.

hostprogs-always-$(CONFIG_ARCH_IMX_IMXIMAGE)    += imx-image
imx-usb-loader-objs := imx/imx-usb-loader.o imx/imx.o  common.o

Probably, you do not want to do it.


-- 
Best Regards
Masahiro Yamada

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-10-11 16:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 14:22 [PATCH 0/5] scripts: Common functions for host tools and rk-usb-loader Sascha Hauer
2021-10-06 14:22 ` [PATCH 1/5] scripts: Add Kconfig option for most host tools Sascha Hauer
2021-10-06 14:22 ` [PATCH 2/5] scripts: Add common library functions Sascha Hauer
2021-10-11 14:37   ` Masahiro Yamada
2021-10-11 14:52     ` Sascha Hauer
2021-10-11 16:38       ` Masahiro Yamada [this message]
2021-10-06 14:22 ` [PATCH 3/5] scripts/common: Add write_file() Sascha Hauer
2021-10-06 14:22 ` [PATCH 4/5] scripts/common: Add write_full() and read_full() Sascha Hauer
2021-10-06 14:22 ` [PATCH 5/5] scripts: Add rk-usb-loader tool Sascha Hauer
2021-10-08 14:25   ` Michael Riesch
2021-10-11  7:18     ` Sascha Hauer
2021-10-11  9:46       ` Michael Riesch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK7LNASY0fnOH5S3xDVBCH7TsT-ThcPCwLBc19-TR2gU2wqHxQ@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox