Martin d'Anjou wrote:
How do I convince export to export variables to $(shell ...)?
l:=$(shell echo $$USER)
$(warning $(l))
export VAR=Hi
l:=$(shell echo VAR $$VAR)
$(warning $(l))
all:
echo $$VAR
Is this a bug? I use 3.81beta3
The code handling $(shell) (func_shell in function.c) uses the parent
environment (from environ) for the sub-shell. Hence GNU Make's export
directive will not put GNU Make variables into the $(shell) environment.
You could have this like this:
export FOO=fooey
ORIGINAL := $(shell echo 1: $$FOO)
HACKED := $(shell export FOO=$(FOO) ; echo 2: $$FOO)
all:
@echo Original: $(ORIGINAL)
@echo Hacked: $(HACKED)
John.
--
John Graham-Cumming
[EMAIL PROTECTED]
Home: http://www.jgc.org/
POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.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