help-make
[Top][All Lists]
Advanced

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

How does $@ work in a make conditional?


From: JeffS
Subject: How does $@ work in a make conditional?
Date: Fri, 14 Jan 2011 11:38:29 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7


Hi! I'm using GNU Make 3.80. In my Makefile, I use automatic variable $@ to refer to the current target, as shown below.

       |     @echo current target is ... address@hidden
       ifeq ($@,sms)
            @echo yep, they are equal
       else
            @echo no, they are not equal
       endif
       |

It seems that $@  expands to sms , as shown in the output below.

Output is:

       |current target is ... [sms]
       no, they are not equal
       |

My question: since $@ (apparently) expands to sms , shouldn't the "true" branch of the ifeq conditional be executed (with the consequence that the output should read yep, they are equal)? [I am at a loss as to why the output is no, they are not equal.]

Thank you for any advice you can provide.



reply via email to

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