help-make
[Top][All Lists]
Advanced

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

Re: Passing environment variables in reciepes


From: Kristof Provost
Subject: Re: Passing environment variables in reciepes
Date: Wed, 8 Dec 2010 12:00:04 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On 2010-12-08 11:29:01 (+0100), Warlich, Christof <address@hidden> wrote:
> Hi,
> 
> please consider the following makefile:
> 
> all:
>         @if [ "${USER}" == "" ]; then \
>             export message="no user defined"; \
>         else \
>             export message="user is ${USER}"; \
>         fi
>         @echo ${message} $${message} $message $$message eval $$message
> 
Each line in the recipe is executed in its own shell.
If you add '; \' behind the 'fi', so echo is executed in the same shell
as the if statement you'll have a different result.

Regards,
Kristof




reply via email to

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