help-make
[Top][All Lists]
Advanced

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

Re: how to (correctly) modify GNU Make so that separate shell is always


From: Mark Galeck
Subject: Re: how to (correctly) modify GNU Make so that separate shell is always spawned for each command
Date: Sun, 17 Apr 2016 01:11:24 +0000 (UTC)

Thank you Paul.  Of course you were right from the beginning.  

The reason why the behaviour was different when I modified Make to always spawn 
a shell,  
is because with unmodified Make, it uses the parent shell and the modified Make 
uses a shell that is present in /bin/sh during the run of Make, which is 
different than the parent shell.  
Mark

      From: Paul Smith <address@hidden>
 To: Mark Galeck <address@hidden>; "address@hidden" <address@hidden> 
 Sent: Saturday, April 16, 2016 7:01 AM
 Subject: Re: how to (correctly) modify GNU Make so that separate shell is 
always spawned for each command
   
On Sat, 2016-04-16 at 05:16 +0000, Mark Galeck wrote:
> I guess you are saying that in fact the Make statement
> 
> export VAR-Y := val
> 
> (attempts to) establish a shell (environment) variable, and is not
> merely a Make construct. Is that what you are saying?

Yes, that's what the "export" keyword does: it tells make to put the
variable into the environment when it invokes a command as part of a
recipe.  See the GNU make manual:

http://www.gnu.org/software/make/manual/html_node/Variables_002fRecursion.html

The only ways for one program to pass information to another program in
UNIX are through the command line and through the environment (unless
you want to use more complex and non-portable methods such as shared
memory etc.)  The export keyword tells make to put the variable into the
environment.




reply via email to

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