URL:
<http://savannah.gnu.org/bugs/?25140>
Summary: Pattern-specific variable assignment behaves
differently compared to normal variables
Project: make
Submitted by: bosk
Submitted on: Sun 21 Dec 2008 10:20:54 AM GMT
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: 3.81
Operating System: Any
Fixed Release: None
_______________________________________________________
Details:
Consider this makefile:
v := two
%.bar: var := one
%.bar: var += $(v)
%.bar: var += three
v :=
%.bar: ; @echo $(var)
all: foo.bar
When used with 3.81, it prints 'one three' while I would expect it to print
'one two three'. If I change pattern-specific to target-specific assignment,
it works as expected:
foo.bar: var := one
foo.bar: var += $(v)
foo.bar: var += three
The workaround for this problem is to use temporary variable:
tmp := one
tmp += $(v)
tmp += three
%.bar: var := $(tmp)
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?25140>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-make