[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Override directive usage
From: |
Paul Smith |
Subject: |
Re: Override directive usage |
Date: |
Thu, 20 Aug 2009 21:23:14 -0600 |
User-agent: |
Internet Messaging Program (IMP) H3 (4.1.6) |
Quoting Steve Deiters <address@hidden>:
Using make 3.81, any subsequent regular variable assignments to a
variable previously assigned using an override directive are ignored.
For example, in the following:
--- 1969-12-31 18:00:00.000000000 -0600
+++ Makefile 2009-08-20 16:55:07.000000000 -0500
@@ -0,0 +1,6 @@
+FOO:=foo
+override FOO+=bar
+FOO+=baz
+
+all:
+ @echo $(FOO)
The output is "foo bar" instead of the expected "foo bar baz". Is this
the expected behavior? I would expect all regular assignments would be
valid unless overridden by values on the command line.
This behavior is expected. Make tracks variables internally with a certain
level of "importance". Once a variable is set to a certain level, then
no assignment of that variable via a method of lesser "importance" takes
effect. The highest level is "override", so once a variable is marked
"override" no other assignment, except another override, can change it.