Subject: Re: toolchain/14629: make obj does not work correctly
To: None <tech-toolchain@netbsd.org>
From: Bernd Ernesti <netbsd@arresum.inka.de>
List: tech-toolchain
Date: 11/20/2001 00:25:55
On Sun, Nov 18, 2001 at 11:32:21PM +0100, bernd@arresum.inka.de wrote:
> >Environment:
> System: NetBSD arresum.inka.de 1.5Y NetBSD 1.5Y (ARRESUM) #634: Mon Nov 12 19:54:29 CET 2001 bernd@arresum.inka.de:/home/work/obj_i386/src.i386/sys/arch/i386/compile/ARRESUM i386
> Architecture: i386
> Machine: i386
> >Description:
> 	A make obj doesn't create the correct obj link and directory.
> 
> 	You need these entries in /etc/mk.conf:
> 
> BSDOBJDIR = /usr/obj/src
> BSDSRCDIR = /home/source/src
> USR_OBJMACHINE = 1
> OBJMACHINE = 1
> 
> >How-To-Repeat:
> 	cd usr.bin.make; make obj
> /home/source/src/usr.bin/make/obj.i386 -> /usr/obj/src.i386/
> 
> 	The correct link should be:
> /home/source/src/usr.bin/make/obj.i386 -> /usr/obj/src.i386/usr.bin/make
> 
> 	And of course, the make obj doesn't create the /usr/obj/src.i386/usr.bin/make
> 	directory.
> 
> 	That happens after I build a new make and installed share/mk.
> #       $NetBSD: bsd.obj.mk,v 1.35 2001/11/14 22:29:23 tv Exp $

It doesn't matter which make version I use. It also happens with an old make.

I tracked it down to rev 1.33 of bsd.obj.mk, where the following was changed from:

.if defined(USR_OBJMACHINE)
__usrobjdirpf=
.else
__usrobjdirpf= ${OBJMACHINE:D.${MACHINE}}
.endif

to:

__usrobjdirpf=  ${USR_OBJMACHINE:U${OBJMACHINE:D.${MACHINE}}}

I don't know why that breaks it, it looks good for me, but reverting back to use
the ifdef fixed the problem.

Hmmm, adding an echo in the obj: target says that __usrobjdirpf is 1, because
USR_OBJMACHINE is set to 1 in /etc/mk.conf and this breaks the code later in
bsd.obj.mk.

I guess we can't use :U ODE feature here.

Bernd