Subject: Re: obj.${MACHINE_ARCH}-${OBJECT_FMT}
To: Ben Harris <bjh21@netbsd.org>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-userlevel
Date: 10/18/2001 15:56:45
>The problem, as I see it, is that make has an excessively-fixed idea of
>where its objdir is.  It's obj.${MACHINE}, and it decides this before it
>loads any Makefiles.  We really need it to vary by file (not even by
>directory, ideally):

Make is actually pretty flexible.  If you use MAKEOBJDIR you have almost
total controll over what it will use.  Of course the only variables you
have available at the time that MAKEOBJDIR is expanded are .CURDIR
and environment variables - but I've found that works pretty well.

As I mentioned previously, I have no problem building multiple arches
on multiple hosts simply by using MAKEOBJDIR and a suitable environment.
It is actually far better - from a version control pov, to have a 
.environment file at the top of your tree that sanitizes and conditions
the build environment, than rely on /etc/mk.conf etc.


>What side-effects are these?  I've seen very few problems doing this kind
>of thing myself, and working on the assumption that MACHINE and
>MACHINE_ARCH represent the target.

Yep.  By dealing with HOSTPROG's carefully, the target is the only 
real consideration. 

--sjg