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: Warlich, Christof
Subject: RE: Passing environment variables in reciepes
Date: Wed, 8 Dec 2010 13:41:58 +0100

David Boyce wrote:
> You're barking up the wrong tree. Each line of the recipe is passed by
> make to a separate instance of the shell. Each of these processes is
> the child of make, thus making them siblings. Environment variables
> won't work for the same reason you can't inherit a trait from your
> sister.
> 
> If you're using make 3.82 the simplest fix is to add the line
> 
> .ONESHELL:
> 
> to the Makefile. This will cause all lines of each recipe to be
> grafted together and passed to a single shell instance which makes
> communication much easier. If using an older version you need to do
> the grafting manually, e.g.:
> 
> target:
>         line 1 &&\
>         line 2 &&\
>         line3
> 
> And forget eval and escaped $$. Those are completely unrelated.
> 
> -David Boyce

It looks like e-mails that only carbon-copy address@hidden are rejected by the 
list. So again, thanks to everyone.

My misconception was that I thought that exporting the variable would make it 
visible in the subsequent reciepe line, missing the fact that the subsequent 
reciepe is not a sub-shell of the first reciepe.


reply via email to

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