Subject: Re: make fails to execute ./fred because of a chdir()
To: David Laight <>
From: Greg A. Woods <>
List: tech-toolchain
Date: 12/13/2002 21:54:17
[ On Friday, December 13, 2002 at 20:30:24 (+0000), David Laight wrote: ]
> Subject: Re: make fails to execute ./fred because of a chdir()
> For some reason make decides that the 'obj' directory should
> become the current directory before processing any files at all.

Welcome to the questionably idiotic behaviour of BSD Make.

Read all about MAKEOBJDIR and MAKEOBJDIRPREFIX in the manual.

Note how the default /usr/share/mk stuff goes jumping through hoops to
remember the source directory and to pass the fully qualified pathname
of sources to things like compilers and such.

It's all completely backwards, upside down, and inside out as far as I'm
concerned, but then again it does work and I'm not going to mess with "a
good thing" like that all on my own!  ;-)

(I would very much prefer all this magic automatic chdir()ing be avoided
and that the default rules simply "Do The Right Thing".  Even VPATH
magic in those makes which have it is a bit much for me.)

BTW, what you need to do to find your script again is prepend
${.CURDIR}/ to it....

								Greg A. Woods

+1 416 218-0098;            <>;           <>
Planix, Inc. <>; VE3TCP; Secrets of the Weird <>