NetBSD-Bugs archive

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

Re: bin/39802: make(1) :? modifier does not work



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

From: David Laight <david%l8s.co.uk@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/39802: make(1) :? modifier does not work
Date: Mon, 22 Dec 2008 22:35:20 +0000

 On Sat, Oct 25, 2008 at 09:45:00PM +0000, jklowden%schemamania.org@localhost 
wrote:
 > >Number:         39802
 > >Synopsis:       make(1) :? modifier does not work
 ...
 >      The make modfier :? seems to return TRUE no matter what the 
 >      evaluated string is.  
 
 :? expands the variable to its left and treats the contents as a conditional.
 
 >      echo $("0 == 1":?'0 == 1':'0 != 1')
 
 That tries to expand the variable "0 == 1" (the quotes are part of the name)
 This can be demonstated by giving that variable a value, eg:
 e = =${s::= }
 "0$s$e$e$s1" = 3 != 4
 
 > FOO = bar
 >      echo $(FOO:Mbar:?"$(FOO) has bar":"no bar in $(FOO)") with ':M'
 
 In this case the conditional text evaluated is "bar" (my quotes) or "",
 I'm not sure why this returns true - I think it should be equivalent
 to testing defined(bar) which is false in my test makefile
 
 >      echo $(empty(BAR):?'BAR is empty':"BAR is not empty?")
 
 Here the $(empty(BAR) is taken as an expansion of the variable empty(BAR
 demonstratable by defining it (eg):
 open = (
 empty${open}BAR = fubar
 
 Largely this seems to be a  mis-understanding of what :? actually evaluates.
 The recent man page updates need correcting.
 
        David
 
 -- 
 David Laight: david%l8s.co.uk@localhost
 


Home | Main Index | Thread Index | Old Index