Subject: Re: Sparc 5 newbie stuff
To: NetBSD/sparc Discussion List <port-sparc@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: port-sparc
Date: 01/24/2002 16:01:38
[ On Thursday, January 24, 2002 at 14:56:52 (-0500), Kurt J. Lidl wrote: ]
> Subject: Re: Sparc 5 newbie stuff
>
> On Thu, Jan 24, 2002 at 01:44:18PM -0600, Peter Seebach wrote:
> > I haven't even figured out exactly what it's for.  Actually, that's not quite
> > true:  I have a vague belief that the idea is that I can have a read-only
> > /usr/src, NFS-mounted to hell and back, and everyone uses /home/obj for
> > builds, and it All Just Works.

Nope, not quite....

> The big idea for the obj subdirectory stuff had to do with the belief
> that you would have your /usr/src on one drive, and /usr/obj on a
> second drive.

Nope, not quite that either....

The 'obj' _sub_directory stuff is merely a simple trick to keep sources
and products separate when you're building _in_the_same_tree_.

Having BSDOBJDIR be some other location, and tricking 'make' by creating
'obj' symlinks to a different location is what both of you are talking
about.

In reality the use of MAKEOBJDIR (which defaults to _PATH_OBJDIR, which
is normally 'obj' in NetBSD), is rather unnecessary since all build
tools (that I know of anyway) can be run in such a way that their output
is deposited in a specified directory (i.e. not in the directory where
make is started), and of course the rules can be written in such a way
that dependencies are sought in the build directory, not the current
directory.  I.e. all of the mechanism for putting products in some
ancillary tree completely outside of the source tree can be built
entirely in the rules used by 'make' -- no internal magic is really
necessary.

Conversely there's the VPATH trick where you start make in an empty
build directory, pointing it to the top-level source Makefile, and it
builds products in the current directory, using the VPATH mechanism to
find the sources.

> Given that you need write access into /usr/src for the first run of
> the 'make obj' target, you can't really do a read only /usr/src tree,
> at least not all the time.

You don't need to be building the tree to have run "make obj" on the NFS
server -- all you need is a copy of the right kind of 'make' (and its
associated files, of course).

-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods@acm.org>;  <g.a.woods@ieee.org>;  <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>