help-gnu-utils
[Top][All Lists]
Advanced

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

Re: Setting environment variables with Make


From: Paul Jarc
Subject: Re: Setting environment variables with Make
Date: Sat, 07 Mar 2009 15:27:57 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Ralf Wildenhues <Ralf.Wildenhues@gmx.de> wrote:
> Each command line in a rule is executed by a separate shell invocation.
> So use e.g.,
>
> foo:
>       bar=`output of some command`; \
>       echo $(bar)

This shold be expanding a shell variable, not a Makefile variable, so
one more change is needed:

foo:
        bar=`output of some command`; \
        echo $${bar}

Or if you want to check for failure in the first command:

foo:
        bar=`output of some command` && \
        echo $${bar}


paul




reply via email to

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