Subject: Re: making objdirs automatically
To: Todd Vierling <>
From: Simon J. Gerraty <>
List: tech-toolchain
Date: 04/19/2004 21:50:29
On Mon, 19 Apr 2004 09:53:45 -0400 (EDT), Todd Vierling writes:
>iiOn Sat, 17 Apr 2004, Simon J. Gerraty wrote:
>: further to our conversation (and one with a colleague) the other day ,
>: the following simple makefile demonstrates how objdirs can be made
>: automatically - without the need for a separate 'make obj' pass.
>You forgot to bracket those by
>.if !make(clean) && !make(cleandir) && !make(distclean) && !make(cleanhtml)

Good point, that was a simple demo though ;-)

I've been using this tick for little while now.  Because I
play games with making .CURDIR a relative path (from .OBJDIR), I found
it necessary to do the auto.obj trick from else even after
.PATH is re-constituted with adjusted relative paths, the damage has
already been done.  The main downside is that Makefiles that don't
include bsd.{obj,subdir}.mk still get objdirs - but I only found one
makefile (so far) for which that mattered.

All in all, it works well.