Subject: Re: Syntax of :? in Makefiles
To: None <tech-userlevel@NetBSD.org>
From: Simon Gerraty <sjg@juniper.net>
List: tech-userlevel
Date: 05/25/2007 18:45:12
>I recently discovered :? and the test case is only that, a test case. Of
>course the test above could be expressed as

One thing to keep in mind is that many macro expansions behave differently
in conditional expressions - which can be very frustrating.  I have a
vague recollection that the scope that is searched is a factor.
For example:

X=${"${VAR:Mmatch}":?yes:no}

a:
	@echo X=${X}

b:
.if ${X} == "yes"
	@echo ok
.else
	@echo no
.endif

$ make a b
X=no
ok
$ VAR=match make a b
X=yes
ok
$