[Top][All Lists]

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

[bug #15913] Target-specific immediate append operator not working as ex

From: anonymous
Subject: [bug #15913] Target-specific immediate append operator not working as expected
Date: Mon, 27 Feb 2006 13:47:29 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7


                 Summary: Target-specific immediate append operator not
working as expected
                 Project: make
            Submitted by: None
            Submitted on: Mon 02/27/06 at 13:47
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
       Component Version: 3.80
        Platform Version: Any
           Fixed Release: None



There is some weirdness going on with the append operator and target-specific

The append operator should act immediately if the variable was originally
assigned with an immediate assignment but this does not happen if the
variable was globally assigned and the append is target-specific, the append
does variable expansion (as if the variable had been deferred).

Here's a test case showing the problem:

colsw07m -> cat Makefile


bar: VAR += bar

foo bar:
        echo $(VAR)

colsw07m -> ~/src/make/make-3.81rc1/make foo echo $LOGNAME makholm colsw07m
-> ~/src/make/make-3.81rc1/make bar echo OGNAME bar OGNAME bar

Making the assignment target-specific or making the append global both work
as expected.

It seems to be a thing introduced in 3.80 which makes sense since AFAIK 3.80
brought some fixes to target specific variables.
3.78.1 seems to work correctly.
3.79.1, as expected, breaks with target-specific variables.
3.80 works the same as 3.80rc1.

The documentation (chapter on target-specific vars) states that:

"The variable-assignment can be any valid form of assignment; recursive
(`='), static (`:='), appending (`+='), or conditional (`?='). All variables
that appear within the variable-assignment are evaluated within the context
of the target: thus, any previously-defined target-specific variable values
will be in effect. Note that this variable is actually distinct from any
"global" value: the two variables do not have to have the same flavor
(recursive vs. static)."

What basically happens though is that the target-specific append treats the
global instance of VAR as recursive.

I would consider this a bug especially since this:

bar: VAR := $(VAR) bar

...also works as expected...

On a slightly related side note, the manual seems to switch between the terms
immediate/deferred and static/recursive for describing the same things; the
two flavours of variables... Perhaps the two pairs of terms should be unified
into one?


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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