Subject: Re: obj dir not created (subdir sendmail/cf/cf)
To: None <>
From: David Laight <>
List: tech-toolchain
Date: 06/20/2005 21:08:44
On Mon, Jun 20, 2005 at 06:04:49PM +0200, wrote:
> Well, last time I try to track down how things were supposed to behave,
> I concluded (I may be totally or partially wrong):
> 1) The Makefiles are called from the source dir;
> 2) ${.CURDIR} is hence the source dir;
> 3) ${.TARGET} is the same as POSIX classical $@ and expands just to
> the given target, no obj stuff being prepended;

You need to realise that the make binary changes its own current directory
(and hence that of everything it runs) to be the 'object directory' [1].
So any program that just creates a file will create it in the object
directory, not the source directory.


[1] The directory $MAKEOBJDIR, $MAKEOBJDIRPREFIX/$(pwd) or $(pwd)/obj [2]
if the relevant environment variable is set and the directory exists.
Code is right at the start of main().

[2] The cd to $(pwd)/obj is rather unexpected, and causes some makefiles
that a simple SVR4 make will execute to break under NetBSD - causing some
packages to require gmake!

David Laight: