Source: make-dfsg
Version: 4.0-8
Severity: wishlist

I'm trying to implement prerequisite feedback via environment backpropagation.

Here's "test.1":
{ http://pastebin.com/ZiEJpEhr }
--- [ test.1 ] ---
T=a b c d e
.PHONY: $(T)
$(T):
        $(if $($(@)_BRINGBACK),$(eval $($(@)_BRINGBACK)))
        $(if $($(@)_BRINGBACK),@echo '>' $@':' $(@)_BRINGBACK = 
$($(@)_BRINGBACK))
        $(if $(LDFLAGS),@echo '>' $@':' LDFLAGS = $(LDFLAGS))
        @echo '>' $@':'$(if $+, $+)$(if $|, '|' $|)

.DEFAULT: a
a: b | c
b: d
c: e
e_BRINGBACK = LDFLAGS += -lz
--- [ test.1 ] ---

--- [ test.1 output ] ---
> d:
> b: d
> e: e_BRINGBACK = LDFLAGS += -lz
> e: LDFLAGS = -lz
> e:
> c: LDFLAGS = -lz
> c: e
> a: LDFLAGS = -lz
> a: b | c
--- [ test.1 output ] ---

Append global environment variable to "test.1" and name it "test.2":
{ http://pastebin.com/JqUN36ZP }
--- [ test.2 ] ---
LDFLAGS = -lm
--- [ test.2 ] ---

--- [ test.2 output ] ---
> d: LDFLAGS = -lm
> d:
> b: LDFLAGS = -lm
> b: d
> e: e_BRINGBACK = LDFLAGS += -lz
> e: LDFLAGS = -lm -lz
> e:
> c: LDFLAGS = -lm -lz
> c: e
> a: LDFLAGS = -lm -lz
> a: b | c
--- [ test.2 output ] ---

Works well.

Append target environment variable to "test.1" and name it "test.3":
{ http://pastebin.com/z9L17eaJ }
--- [ test.3 ] ---
a: LDFLAGS = -lm
--- [ test.3 ] ---

--- [ test.3 output ] ---
> d: LDFLAGS = -lm
> d:
> b: LDFLAGS = -lm
> b: d
> e: e_BRINGBACK = LDFLAGS += -lz
> e: LDFLAGS = -lm
> e:
> c: LDFLAGS = -lm
> c: e
> a: LDFLAGS = -lm
> a: b | c
--- [ test.3 output ] ---

Not so good, as you may see.

And finally, append slightly different target environment variable to
"test.1" and name it "test.4":
{ http://pastebin.com/jGaz8H8t }
--- [ test.4 ] ---
a: LDFLAGS += -lm
--- [ test.4 ] ---

--- [ test.4 output ] ---
> d: LDFLAGS = -lm
> d:
> b: LDFLAGS = -lm
> b: d
> e: e_BRINGBACK = LDFLAGS += -lz
> e: LDFLAGS = -lm -lz -lm
> e:
> c: LDFLAGS = -lm -lz -lm
> c: e
> a: LDFLAGS = -lm -lz -lm
> a: b | c
--- [ test.4 output ] ---

This completely breaks my mind.

Questions:
1. why LDFLAGS is not modified in #3?
2. why LDFLAGS is messed up in #4?

Thank you.

-- 
SY,
Konstantin Demin


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to