On Wed, Mar 3, 2010 at 1:35 PM, Paul Smith <[email protected]> wrote: > There is no need for make to store the order: these changes are > internalized as the makefile is read in. In your example above there > are not two different variables CFLAGS^1 and CFLAGS^2, with different > values. There is only one variable, CFLAGS. When make reads in the > first line, it sets the variable to the value "-g". When make reads in > the second line, the first value is thrown away and replaced with the > new value and the variable now has the value "-O". > > When make -p runs (after all the makefiles have been read in) it just > prints the current value of each variable; so in this case you'd see > "CFLAGS = -O" in the output. There is no indication that this variable > ever had any other value. > > It took me a while to figure out what was going on, since I had some actual -p output with repeated and conflicting variable settings which appeared to contradict what you say. But it turned out I generated those using "make -n -p" instead of "make -q -p". Since it's a recursive-make situation and since -n does not suppress $(MAKE) recursion, I was seeing conflicting settings derived from different Makefiles. Thanks for clarifying.
AK
_______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
