Subject: Re: make(1)'s inbuilt objdir handling
To: Luke Mewburn <lukem@NetBSD.org>
From: Jachym Holecek <freza@liberouter.org>
List: tech-toolchain
Date: 06/21/2005 15:46:54
> 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.

My 2c.

	Regards,
		-- Jachym Holecek