Subject: Re: CVS commit: sharesrc/share/mk
To: None <perry@wasabisystems.com>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-toolchain
Date: 10/31/2001 17:21:18
> If you take the leap to using shell magic (eg a wrapper script - 
> like build.sh
> or the nbmake-foo's that it also generates), you can do all sorts of
> clever stuff - like building multiple target arches in one tree with
> a separate objtree for host-tools.

Ah, without needing to hack make I should have mentioned.

If we are going to force everyone to do things one way (I like that btw,
but I'm well aware of the angst it can generate), and we are going to
involve build.sh and such, then you've already swallowed the hard bit.
A setup like the one I use at work is pretty neat.  One of the best
things about using a magic MAKEOBJDIR value like:

MAKEOBJDIR=${.CURDIR:S,${SRCTOP},${OBJTOP},} 

is that from any makefile you can redily infer where the objdir and
hence generated files for another dir are.  You can even code them in
a way that is easy for humans to follow. You can have (ignoring quoting)
OBJTOP=$TOP/obj-${MACHINE_ARCH} and the right things just happen, and
you can override it for building hosttools so that you get a separate
tree for those.

--sjg