NetBSD-Bugs archive

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

Re: bin/60850: Make could do with a syntax for immediate var expansion



The following reply was made to PR bin/60850; it has been noted by GNATS.

From: RVP <rvp%SDF.ORG@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/60850: Make could do with a syntax for immediate var
 expansion
Date: Tue, 13 Oct 2026 08:33:19 +0000 (UTC)

 On Tue, 6 Oct 2026, Robert Elz via gnats wrote:
 
 >   |  CPPFLAGS =	-I/usr/include
 >   |  .if ${.PARSEDIR:_}
 >   |  CPPFLAGS +=	-I$_
 >   |  .endif
 >   |  CPPFLAGS +=	-I/usr/local/include
 >
 > That works, once, but if you do it again, $_ will be changedm
 > and all of the -I$_ will expand to the same thing when CPPFLAGS
 > is eventually expanded.
 >
 
 You can add a varname to that `$_' to make it unique, but I didn't do that
 because,
 
 > It is also still cumbersome to use (3 lines where just 1 should be
 > needed).
 >
 
 Precisely. And it would've been no better than what you've already done (only,
 2 lines longer and more obscure besides).
 
 -RVP
 



Home | Main Index | Thread Index | Old Index