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: Greg Chicares
Subject: Re: Passing environment variables in reciepes
Date: Wed, 08 Dec 2010 12:23:48 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

On 2010-12-08 10:29Z, Warlich, Christof wrote:
> 
> all:
>         @if [ "${USER}" == "" ]; then \
>             export message="no user defined"; \
>         else \
>             export message="user is ${USER}"; \
>         fi
>         @echo ${message} $${message} $message $$message eval $$message
> 
> My problem ist that I cannot find a way to pass data being determined in one
> reciepe line to the next reciepe line. Executing the example given above:

"if ... fi" is passed to a subshell; then "echo ..." is passed to a
different subshell:
  http://www.gnu.org/software/make/manual/html_node/Execution.html#Execution
I'd change the makefile:

-       fi
-       @echo ${message}, $${message}, $message, $$message, eval $$message
+       fi; \
+       echo ${message}, $${message}, $message, $$message, eval $$message



reply via email to

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