Subject: Re: Problem in new toolchain builds (need comments)
To: James Chacon <jchacon@genuity.net>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-toolchain
Date: 10/23/2001 15:40:26
>1. Put a complete set of Makefile.inc's in place in the tree that eventually
>all recurse back to /usr/src/Makefile.inc. Put all the USE_NEW_TOOLCHAIN and
>USETOOLS checks in there.

I was in favour of this a while back.  An alternative is to have a reliable
means of knowing where the top of the src tree is.  Which btw a top-level
Makefile.inc gives you:  SRCTOP=${.PARSEDIR}.

Now, I use a wrapper script for make that searches up the src tree until it
find a .sandbox-env file, and the directory where it find that is set as SB.
The SRCTOP is typically $SB/src - unless .sandbox-env says different.
With that availble it becomes pretty easy to set a whole raft of variables
that give you absolute and relative paths to top of src tree, top of obj tree
etc.  Including ${SRCTOP}/Makefile.inc also becomes pretty simple and cheap
to.  The wrapper is only involved in the kicking off of the build, so the
overhead is not too great - and of course you get the right result regardless
of where within the tree you start.

But if you don't want to go that route, then the Makefile.inc's is the
best bet.  Note that you need to watchout for existing places in the tree
that have .include "../../Makefile.inc" as the addition of new Makefile.inc's
can change what gets .included (a bitch to debug btw).

--sjg