help-make
[Top][All Lists]
Advanced

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

Re: Dilemer using target-specific or pattern-specific variables


From: grischka
Subject: Re: Dilemer using target-specific or pattern-specific variables
Date: Fri, 17 Oct 2008 15:13:14 +0200
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

Brian Dessent wrote:
If you want the expansion deferred you can use '='.  So the real
problem isn't that, but rather the recursive nature of trying to
assign cflags based on its existing value.

Actually it hasn't to do with nature, rather the term "recursive variable"
simply describes a limitation with gnu-make internals.

Consider:

        V = A B C
        V = $(V) D E F

It should be clear to almost everybody what this means, however the problem
with gnu-make is that it does not store more than one assignment to the same
variable name, so the second line will just erase it's knowledge about
the first line.  As a result, at expansion time it does not know what to do
with it anymore.  Of course it is not meant to recursively reuse the not even
yet existing value of the currently expanded line, just that it has no way
to react in a more obvious way either, because it didn't bother to memorize
the whole picture earlier.

So, if you wanted a -= operator this problem needs to be fixed before. Then
again if it was fixed it would make the := operator redundant, for most 
purposes.

--- grischka





reply via email to

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