Subject: Should make create $MAKEOBJDIR ?
To: None <tech-userlevel@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 03/17/2003 13:07:43
Having, yet again, fallen foul of a partial build overwriting the
source directory because the required $OBJ directory hadn't been
created, I wondered if there were any reason why make shouldn't
create the object directory when MAKEOBJDIR is set in the environment.

After all make is perfectly willing to write object files into a random
source directory (ie not .) without instruction if it happens to
exist (writing to ./obj is one 'feature' that causes many packages
to fail to build with netbsd's make).

The required change is localised to the Main_SetObjdir function, which
would probably require an extra parameter.

I would only change the MAKEOBJDIR stuff, not MAKEOBJDIRPREFIX - allowing
the latter to be used to turn off the _PATH_OBJDIR stuff.

(Maybe the _PATH_OBJDIR, and _PATH_OBJDIRPREFIX  stuff should be 
deprecated, anything requiring that functionality should explicitely
set MAKEOBJDIR to "obj" or MAKEOBJDIRPREFIX to "/osr/obj".

	David

-- 
David Laight: david@l8s.co.uk