Subject: Re: .mk "subroutine" for getting objdir locations
To: Simon J. Gerraty <sjg@quick.com.au>
From: Todd Vierling <tv@wasabisystems.com>
List: tech-toolchain
Date: 08/08/2001 12:38:01
On Wed, 8 Aug 2001, Simon J. Gerraty wrote:
: > However, I'm going to revisit the possibility as a new variable substitution
: > modifier in make(1) (that will open("."), go to the variable's corresponding
: > objdir, getcwd(), then fchdir() back to the old dir).
:
: Slight correction, chdir("other_srcdir"), work out objdir and return.
: Should be easy enough to do. Just lift the existing code that works
: out objdir and put it in a function [...]
Right, exactly.
: If we are going to add any new modifiers I think we should seriously
: consider multiple char modifier names. Like make's -d command line
: option. Eg. the assignment modifiers ::= ::!= ::+= ::?= all burn only
: a single option char ':'.
Hm. I've been thinking about this. How about a concept of `named transform
functions', allowing more than just one character? For instance, for the
objdir transform, you might have
LIBBFD= ${TOP}/lib/libbfd
LDFLAGS+= -L${LIBBFD:>SRCOBJ}
and every word in ${LIBBFD} (here, only one) is put through the
srcdir->objdir transform function, named SRCOBJ. More transforms could
easily be added; in fact, you could represent almost all single-character
operators in this form if desired.
A punctuation character is the easiest (and probably least conflicting)
choice for this kind of substitution operator. All of !, ?, >, %, &, and *
come to mind as possible such operator characters; I'm not sure which are
already in use on other bmake derivatives.
--
-- Todd Vierling <tv@wasabisystems.com> * Wasabi NetBSD: Run with it.
-- NetBSD 1.5 now available on CD-ROM -- http://www.wasabisystems.com/