help-make
[Top][All Lists]
Advanced

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

Re: Storing environment variables


From: Paul D. Smith
Subject: Re: Storing environment variables
Date: Tue, 14 Sep 2004 11:00:10 -0400

%% Boris Kolpackov <address@hidden> writes:

  bk> address@hidden writes:

  >> Is there  a way to store all the environment variables in gmake so that i
  >> can check for the same while running gmake the second time.

  bk> Starting from GNU make 3.80 special variable .VARIABLES is
  bk> available which expands to a list of all variables defined to this
  bk> point. Using $(origin ) function you can narrow this list to
  bk> environment variables only. Then you can save their names and
  bk> values (or hash sum) to a file...

Since all environment variables are exported to subshells, you can just
do this:

    $(shell env > saved-variables)

Of course, doing something with that file is more complicated; it all
depends on what you're trying to do.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "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]