tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: make: exporting MAKEOBJDIR



On Tue, Jun 01, 2010 at 11:39:44AM -0700, Simon Gerraty wrote:
 > The patch below allows providing a name=value pair to .export
 > so that the value exported need not match the one used internally.
 > Eg.
 > 
 > # the $$'s delay expansion
 > MAKEOBJDIR= $${.CURDIR:S,${SRCTOP},${OBJPREFIX}$${MACHINE},}
 > .export MAKEOBJDIR=${MAKEOBJDIR}
 > # now resolve it for ourselves
 > MAKEOBJDIR := ${MAKEOBJDIR}

This is a misuse of $$. Even if this works right now, it arguably
shouldn't, and certainly it should not be encouraged.

Instead, what about .export FOO=${BAR} and .export FOO:=${BAR}? That
would make the behavior consistent with ordinary assignment, and also
allow what you want without resort to such tricks...

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index