Subject: Re: .mk "subroutine" for getting objdir locations
To: Simon J. Gerraty <>
From: Todd Vierling <>
List: tech-toolchain
Date: 08/07/2001 15:08:44
On Tue, 7 Aug 2001, Simon J. Gerraty wrote:

: >.elif defined(MAKEOBJDIR)
: >if exists(${GETOBJ_SRC}/${MAKEOBJDIR})
: >.endif
: This one will not always be correct.  Our make does var substitution on

Ah, I hadn't noticed that (main.c:chdir_verify_path()), but this can be
worked around with some very minor trickery.

For the NetBSD source tree, we don't really support any MAKEOBJDIR
substitution that depends on variables set in the specific Makefile (you
could wreak all kinds of havoc doing that).  So, provided the substitution
only includes variable names that are make(1) predefines and variables set
explicitly by the user, it still should be possible to calculate this
properly without invoking a subshell and make(1) with a !=.

: and if MAKEOBJDIR is an absolute path, it uses that.

Right, because it's simply done via a chdir().  Noted; this is simple to

-- Todd Vierling <>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --