help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: append to/from command line variable


From: Martin d'Anjou
Subject: Re: append to/from command line variable
Date: Mon, 7 Nov 2005 09:03:51 -0500 (EST)

>   md> $ make
>   md> makefile:2: FOO = foo
>   md> makefile:5: FOO = foo bar
>   md> makefile:9: FOO = foo bar biz
>   md> FOO = boz baz / $FOO =
> 
> Oh whoops... I should have added "export FOO" to the makefile.
> 
>   md> $ setenv FOO gig
>   md> $ make
>   md> makefile:2: FOO = gig foo
>   md> makefile:5: FOO = gig foo bar
>   md> makefile:9: FOO = gig foo bar biz
>   md> FOO = boz baz / $FOO = boz baz
> 
>   md> Why in the second case "/ $FOO" prints "boz baz" and not the empty
>   md> string?
> 
> Make automatically exports all variables that were in the environment
> when it started up.  It doesn't export other, normal make variables.
> 
> So, by adding FOO to the environment before you started make you caused
> it to be exported.

I have no problem seeing what happens with make -e, but I don't get why
make prints $$FOO as empty in he first example and "boz baz" in the
second.

I guess I don't understand what happens behind the curtains when "Make
automatically exports all variables that were in the environment ...".

Thanks,
Martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]