Subject: Re: make(1)'s inbuilt objdir handling
To: Jachym Holecek <freza@liberouter.org>
From: James Chacon <jmc@NetBSD.org>
List: tech-toolchain
Date: 06/22/2005 08:50:32
On Tue, Jun 21, 2005 at 03:46:54PM +0200, Jachym Holecek wrote:
> > As recently observed in another discussion on this list,
> > make(1) has "special" inbuilt .OBJDIR handling.
> > 
> > To recap, the inbuilt-to-make .OBJDIR rules are:
> > 
> >     	if MAKEOBJDIRPREFIX is set in the environment		# rule 1
> > 		.OBJDIR = ${MAKEOBJDIRPREFIX}/${PWD}
> > 	else MAKEOBJDIR is set in the environment		# rule 2
> > 			# MAKEOBJDIR may be an expression
> > 		.OBJDIR = ${MAKEOBJDIR}
> > 	else if -d "obj.${MACHINE}"				# rule 3
> > 		.OBJDIR = obj.${MACHINE}
> > 	else if -d "obj"					# rule 4
> > 		.OBJDIR = obj
> > 	else if -d "/usr/obj/${PWD}"				# rule 5
> > 		.OBJDIR = /usr/obj/${PWD}
> > 	else							# rule 6
> > 		.OBJDIR = .CURDIR
> > 
> > I personally believe that rules 3 through 5 should be removed from make.
> > Rationale:
> 
> Umm, #5 is just evil. I didn't even know about that. I'm quite used
> to #3 and #4, but they're easy enough to emulate as you notice.
> 

I'm actually fairly positive #5 only happens if you're in /usr/src also.

James