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 11:10:56
--B3XPdYri2NuANWBV
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jun 22, 2005 at 08:50:32AM -0500, James Chacon wrote:
  | On Tue, Jun 21, 2005 at 03:46:54PM +0200, Jachym Holecek wrote:
  | > > 	else if -d "/usr/obj/${PWD}"				# rule 5
  | > > 		.OBJDIR =3D /usr/obj/${PWD}
  | > > 	else							# rule 6
  | > > 		.OBJDIR =3D .CURDIR
  |=20
  | I'm actually fairly positive #5 only happens if you're in /usr/src also.

No; it occurred anytime; check out ~ line 770-773 in main.c:
			(void) snprintf(mdpath, MAXPATHLEN, "%s%s",=20
					 _PATH_OBJDIRPREFIX, curdir);
			(void) Main_SetObjdir(mdpath);


Confirmed with:

		# ensure nothign in environment will confuse stuff
	unsetenv MAKEOBJDIRPREFIX
	unsetenv MAKEOBJDIR
	mkdir /tmp/foo
	cd /tmp/foo
	rmdir obj.`uname -m` obj
	rmdir /usr/obj/`pwd`

	echo 'all:\n\t@echo "\t" ${.OBJDIR}' | make -f -
		 /tmp/foo

	mkdir obj.`uname -m`
	echo 'all:\n\t@echo "\t" ${.OBJDIR}' | make -f -
		 /tmp/foo/obj.i386
	rmdir obj.`uname -m`

	mkdir obj
	echo 'all:\n\t@echo "\t" ${.OBJDIR}' | make -f -
		 /tmp/foo/obj
	rmdir obj

	mkdir -p /usr/obj/`pwd`
	echo 'all:\n\t@echo "\t" ${.OBJDIR}' | make -f -
		 /usr/obj/tmp/foo
	rmdir /usr/obj/`pwd`

	echo 'all:\n\t@echo "\t" ${.OBJDIR}' | make -f -
		 /tmp/foo


Cheers,
Luke.

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

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

iD8DBQFCugwgpBhtmn8zJHIRAmBdAKDVz2nbAKNMRRVxOZ8hPUwzG3YZHQCghMBS
lwv9Evg1e/kNNEwrQdCH3EI=
=Y9U0
-----END PGP SIGNATURE-----

--B3XPdYri2NuANWBV--