[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
export variables to sub-make
From: |
Michael Morrell |
Subject: |
export variables to sub-make |
Date: |
Wed, 30 Apr 2008 10:52:20 -0700 (PDT) |
I'm reading the section 5.7.2 (Communicating Variables to a Sub-make) and,
unless I missed something, I'm getting behavior I don't understand. I
have
a variable that I want to export to a sub-make. In the top-level
makefile, it gets assigned a value using "override VAR += value" (the base
value is
set from the command line). When the sub-make is invoked, only the
original
value is passed, and does not include the value from the += statement.
Why is this and how can I fix it?
The Makefile looks like:
=======================================
override VAR += extra
export VAR
all:
@echo $(VAR)
$(MAKE) -C dir
=======================================
and the second-level file is just:
=======================================
all:
@echo $(VAR)
=======================================
and I invoke this with "make VAR=value".
Thanks,
Michael
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
- export variables to sub-make,
Michael Morrell <=