Subject: Re: make(1)'s inbuilt objdir handling
To: None <tech-toolchain@NetBSD.org>
From: Luke Mewburn <lukem@NetBSD.org>
List: tech-toolchain
Date: 06/23/2005 22:34:41
--zuGyJ7KNSMOGsxcs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 21, 2005 at 01:39:16PM +1000, Luke Mewburn wrote:
  | As recently observed in another discussion on this list,
  | make(1) has "special" inbuilt .OBJDIR handling.
  |=20
  | To recap, the inbuilt-to-make .OBJDIR rules are:
  |=20
  |     	if MAKEOBJDIRPREFIX is set in the environment		# rule 1
  | 		.OBJDIR =3D ${MAKEOBJDIRPREFIX}/${PWD}
  | 	else MAKEOBJDIR is set in the environment		# rule 2
  | 			# MAKEOBJDIR may be an expression
  | 		.OBJDIR =3D ${MAKEOBJDIR}
  | 	else if -d "obj.${MACHINE}"				# rule 3
  | 		.OBJDIR =3D obj.${MACHINE}
  | 	else if -d "obj"					# rule 4
  | 		.OBJDIR =3D obj
  | 	else if -d "/usr/obj/${PWD}"				# rule 5
  | 		.OBJDIR =3D /usr/obj/${PWD}
  | 	else							# rule 6
  | 		.OBJDIR =3D .CURDIR
  |=20
  | I personally believe that rules 3 through 5 should be removed from make.
  |
  |	[...]
  |=20
  | This change would simplify the .OBJDIR handling in make(1) to:
  |=20
  |     	if MAKEOBJDIRPREFIX is set in the environment		# rule 1
  | 		.OBJDIR =3D ${MAKEOBJDIRPREFIX}/${PWD}
  | 	else MAKEOBJDIR is set in the environment		# rule 2
  | 			# MAKEOBJDIR may be an expression
  | 		.OBJDIR =3D ${MAKEOBJDIR}
  | 	else							# rule 3
  | 		.OBJDIR =3D .CURDIR
  |=20
  | Of course, a Makefile is still free to override .OBJDIR if it wants to.


I've committed this.

--zuGyJ7KNSMOGsxcs
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iD8DBQFCuqxhpBhtmn8zJHIRAolDAJ92E92MFsoCumTZ1oBBuE1iPd6f8wCdGUq1
Vz0ccICYhf3PJCNmxO1HEeA=
=T3Ly
-----END PGP SIGNATURE-----

--zuGyJ7KNSMOGsxcs--