On Wed, Jul 30, 2008 at 8:35 PM, Peng Yu <[EMAIL PROTECTED]> 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
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make