help-make
[Top][All Lists]
Advanced

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

strange behaviour of 'ifeq'


From: jacques
Subject: strange behaviour of 'ifeq'
Date: Sun, 21 Jun 2009 22:48:00 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Hello,
By writing a simple program (program_a), I was able to see some strange behaviours of 'ifeq'

program_a:

ifeq("foo","foo")  \

TOOL = tool  \

endif



start:

           @echo $TOOL



whose execution by "make -f  program_a" yields a  newline.

First question: The gmake on-line manual states that the syntax of a conditional test follows the following template (7.2):

conditional-directive
    text-if-true
    else
    text-if-false
    endif

Notice that there is no backslash character in the definition. In 'program_a', if I don't put the backslashes, the program gives execution errors. So backslashes are compulsory eventhough the manual says otherwise. Is it just a bug that will be fixed in later versions or is there a deeper significance ( the 'ifdef' and 'ifndef' conditionals behave syntatically according to the gmakeon-line manual !!) ?

Second question: Eventhough I got 'program_a' to work by adding backslash characters, the result of the program doesn't seem correct to me - I was expecting the program to give me : tool (If I build a similar program using the 'ifdef' conditional instead of 'ifeq', the program echoes tool.)
What is your feeling ?
(I'm using gmake 3.81)

Thanks

Jacques








reply via email to

[Prev in Thread] Current Thread [Next in Thread]