[Top][All Lists]

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

Re: a couple more questions about variables and scope

From: Paul D. Smith
Subject: Re: a couple more questions about variables and scope
Date: Wed, 9 Jun 2004 11:04:53 -0400

%% "Robert P. J. Day" <address@hidden> writes:

  rpjd> but that's clearly not enough.  in addition, that make variable
  rpjd> would also have to be exported so that it was available to all
  rpjd> submakes, as an environment variable would be.

  rpjd> perhaps a better question might be, at the beginning of the
  rpjd> make, how *exactly* are environment variables added to the mix
  rpjd> so that, once that processing is done, is there any record that
  rpjd> those variables came from the calling environment as opposed to,
  rpjd> say, being set as make variables and then exported?  does make
  rpjd> distinguish between those two?

When make starts, all the environment variables are automatically
created as make variables.  They are marked as exported.

When a variable in a makefile is exported it is also marked as exported.

When make invokes a subprocess it goes through the make variables and
takes everything marked as exported, and puts it into the environment of
the subprocess.

So no, there is no distinction made.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

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