Martin d'Anjou wrote:
l:=$(shell echo $$VAR)
$(warning VAR=$(VAR))
export VAR=10
l:=$(shell echo $$VAR)
$(warning VAR=$(VAR))
make
Makefile:2: VAR=
Makefile:5: VAR=10
Why would VAR be defined for $(shell) just like it is for $(warning) for
example? Without export, ok, but with export, why not?
The output you show makes sense to me. The first $(warning) get
evaluated before VAR has been set to anything and hence you get the VAR=
output; the second $(warning) is after VAR has been set to 10 and hence
you get the VAR=10 output.
I'd also assume that l is always empty in this Makefile since VAR will
not be exported into the environment of the $(shell).
I think the authors of GNU Make want to avoid the following situation:
export FOO=$(shell do_something)
export BAR=$(shell do_something_else)
What should the values of FOO and BAR be in the environment for each of
those shell commands? It's hard to answer because in order to run the
shell you'd have to figure out the value of FOO and BAR to put into the
environment, which requires a $(shell) which requires... a loop.
John.
--
John Graham-Cumming
[EMAIL PROTECTED]
Home: http://www.jgc.org/
POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/
GNU Make Debugger: http://gmd.sf.net/
Fast, Parallel Builds: http://www.electric-cloud.com/
Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/
PGP key: http://www.jgc.org/pgp/
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make