help-make
[Top][All Lists]
Advanced

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

"Default-values" pattern for target specific variables


From: Zaar Hai
Subject: "Default-values" pattern for target specific variables
Date: Mon, 21 Sep 2020 04:15:20 +1000

Good day,

Consider the following Makefile:

a: A ?= 1
a:
    @echo A=$(A)

b: A = 2
b: a

I would've expected "make a" to print "A=1", but "make b" to print "A=2",
however they both output "A=1", though by reading the manual [1] I
understand that ?= operator is supported and by the time variables for "a"
target are re-evaluated A is already defined from the "b" rule. What am I
missing?

Thank you,
Zaar

[1]
https://www.gnu.org/software/make/manual/html_node/Target_002dspecific.html


reply via email to

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