Subject: Re: Syntax of :? in Makefiles
To: None <tech-userlevel@NetBSD.org>
From: Klaus Heinz <k.heinz.mai.sieben@kh-22.de>
List: tech-userlevel
Date: 05/25/2007 22:36:37
Bill Stouder-Studenmund wrote:
> On Sat, May 19, 2007 at 07:00:07PM +0200, Klaus Heinz wrote:

> >   	echo ${empty(TESTVAR:Mbla):?true:false}
> > 
> > make: Bad conditional expression `empty(TESTVAR' in empty(TESTVAR?true:false
> > 
> > The missing closing parenthesis probably hints at some bug.
> 
> I think you want ${TESTVAR:Mbla} but I'm not sure. Did you get an answer 
> on this?

No, so far nobody else commented on the message.

I recently discovered :? and the test case is only that, a test case. Of
course the test above could be expressed as

  all:
  .if empty(TESTVAR:Mbla)
        echo true
  .else
        echo false
  .endif

Either the man page is misleading and expressions cannot generally be
used with this :? syntax or there is a bug in parsing the expressions.
I suspect the latter.

ciao
     Klaus