Subject: 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/19/2007 18:35:14
Hi,

Can someone explain how the :?true_string:false_string extension is
supposed to be used? The man page says

  If the variable (actually an expression; see below) evaluates to
  true, return as its value the true_string, otherwise return the
  false_string.

So far I was only able to see that

  ${TESTVAR:?true:false}

returns "true" if TESTVAR is defined, otherwise "false".

If this extension can only be used as a test for a variable definition,
the words "actually an expression" in the man page are misleading, IMO.

Tested with make from NetBSD 3.0.

ciao
     Klaus