help-make
[Top][All Lists]
Advanced

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

Re: When the branch can not be corrected selected by ifeq?


From: Philip Guenther
Subject: Re: When the branch can not be corrected selected by ifeq?
Date: Wed, 30 Jul 2008 21:18:02 -0600

On Wed, Jul 30, 2008 at 8:35 PM, Peng Yu <address@hidden> wrote:
> I have the following Makefile. The execution result is shown below.
>
> CXX_SOURCE_FILES is an empty string. I think that the top branch
> should be taken.  But in fact, the bottom one is taken.
>
> Would you please let me know what I'm wrong?
...
> CXX_SOURCE_FILES =
>
> ifeq ($CXX_SOURCE_FILES, )

To quote the make info pages:
   A dollar sign followed by a character other than a dollar sign,
   open-parenthesis or open-brace treats that single character as the
   variable name.  Thus, you could reference the variable `x' with `$x'.
   However, this practice is strongly discouraged, except in the case of
   the automatic variables (*note Automatic Variables::).

So, that line is interpreted as:

ifeq (${C}XX_SOURCE_FILES,)

i.e., "expand the variable 'C' and then append 'XX_SOURCE_FILES' and
compare the result to the empty string.


Obviously, you meant to write:

ifeq (${CXX_SOURCE_FILES},)


Philip Guenther




reply via email to

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