help-make
[Top][All Lists]
Advanced

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

RE: Environment varles


From: Paul D. Smith
Subject: RE: Environment varles
Date: Tue, 30 Oct 2001 11:18:47 -0500

%% Yuri Polyakov <address@hidden> writes:

  yp> Actually I don't care to change the value of the make variable.  I
  yp> want to change the value of the variable in make and effect by
  yp> this change the environment,its all.  For example : if I have a
  yp> variable called MYVAR (defined like "setenv MYVAR 1" in some
  yp> .login file) I want to change the value of MYVAR from the MAKE and
  yp> by this change to change the $ENV{'MYVAR'} - its value in the
  yp> environment.

Just change the make variable in the makefile:

  MYVAR = somevalue

When make starts, all environment variables are imported and set as make
variables, and automatically marked as "exported".

When make invokes a subprocess, the current value of all make variables
that are marked as "exported" are set into the environment of the
subprocesses.

You can control which variables are marked exported (to export more make
variables for example) with the export and unexport make commands.


See the GNU make manual:

    Communicating Variables to a Sub-`make'

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