Subject: Re: Merge dtc

From: David Gibson <[email-masked]>
Date: Fri, 19 Oct 2007 16:55:30 +1000

On Fri, Oct 19, 2007 at 12:56:41AM -0500, Milton Miller wrote:
> On Oct 18, 2007, at 8:45 PM, David Gibson wrote:
> > On Thu, Oct 18, 2007 at 09:59:26PM +0200, Sam Ravnborg wrote:
> >> On Thu, Oct 18, 2007 at 12:49:54PM -0500, Milton Miller wrote:
> >>> On Tue Oct 16 15:02:17 EST 2007, David Gibson wrote:
> >>>
> >>>> This very large patch incorporates a copy of dtc into the kernel
> >>>> source, in arch/powerpc/boot/dtc-src.  This means that dtc is no
> >>>> longer an external dependency to build kernels with configurations
> >>>> which need a dtb file.
> >
> >> As Milton already pointed out you should build dtc in the
> >> dtc directory (why the -src prefix??).
> >
> > The -src suffix is only there because I'm not building in the
> > directory - we can't have both a dtc binary and a dtc directory in
> > arch/powerpc/boot.
> 
> So run the dtc binary stored in the sub directory.  Thats what we do 
> elsewhere.

Yes, yes, which boils down to your other point of building in the
subdirectory.  It's not a separate issue.

> > Ok, so how do I build in the subdirectory?  I was going to do that,
> > but couldn't for the life of me figure out how.
> 
> Documentation/kbuild/makefiles.txt  6.4 boot images:
> 
>          "$(Q)$(MAKE) $(build)=<dir>" is the recommended way to invoke
>          make in a subdirectory.

But where does it go?  To have somewhere to put that rule, we'd still
need a target in arch/powerpc/boot itself.

> Section 4 Host Program Support is also relavent, and mentions $(always).

I know I tried using $(always), but I couldn't figure out how to make
it do something useful.

> >> And the dtc specific Makefile looks like something from
> >> the late 80'. Please drop all these ALLUPPERCASE variables
> >> and accept a little bit of redundancy.
> >
> > Hrm... I'm pretty dubious about this.  Practically every Makefile in
> > the universe, *except* Kbuild uses uppercase for most variables.
> > Makefile.dtc is imported verbatim from the standalone dtc package, and
> > is supposed to have the minimal information about what needs to be
> > built to import into Makefiles that actually know how to build things.
> >
> >> Then mere humans may be able to read the Makefile.
> >
> > Says a maintainer of Kbuild, about my tiny and not-very-complex
> > Makefile fragment... um, ok...
> 
> overley complex calls to override source, 

I'm not sure what you're referring to...  even if you mean in
Makefile.dtc or in the diff to arch/powerpc/boot/Makefile.

>conditional rules based on 
> shipped files?  

Or here, for sure.  The shipped/lex/yacc rules are just based on those
from Kconfig and genksyms.

> Its not a trivial fragment.

Compared to the behemoth that is Kbuild...

I'm happy to improve the Makefile integration, but you seem to be
rather vague on how, and the Kbuild documentation makes my brain hurt.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson