Re: [PATCH] riscv: add arch/riscv/Kbuild

From: Masahiro Yamada
Date: Tue Sep 03 2019 - 10:32:01 EST


On Mon, Sep 2, 2019 at 4:42 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> On Sat, Aug 31, 2019 at 10:04:53PM +0900, Masahiro Yamada wrote:
> > Kbuild support two file names, "Makefile" and "Kbuild"
> > for describing obj-y, obj-m, etc.
>
> <snipping the basic explanation, which is documented pretty well,
> I I think I full understand>
>
> > Similarly, arch/$(SRCARCH)/Makefile is very special
> > in that it is included from the top-level Makefile,
> > and specify arch-specific compiler flags etc.
> >
> > We can use arch/$(SRCARCH)/Kbuild
> > to specify obj-y, obj-m.
> > The top-level Makefile does not need to know
> > the directory structure under arch/$(SRCARCH)/.
> >
> > This is logical separation.
>
> But only if we document this specific split and eventually stop allowing
> to build objects from arch/$(SRCARCH)/Makefile.

I like this idea, but it would change the link order (i.e. probe order)

For example, I want move all drivers-y in arch/x86/Makefile
to arch/x86/Kbuild.

I do not know how much we care about the probe order.


> And in my perfect world
> we'd eventually phase out the magic arch/$(SRCARCH)/Makefile entireÅy.
> In addition to the normal Kbuild file we'd then have say (names entirely
> made up and probably not the best idea)
>
> arch/$(SRCARCH)/flags.mk to set the various compiler flags and co
> arch/$(SRCARCH)/targets.mk for extra arch-specific targets

I am not sure whether this split is a good idea.
What is the problem with having the single arch-Makefile?


--
Best Regards
Masahiro Yamada