help-make
[Top][All Lists]
Advanced

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

Re: A not so clear behaviour for Makefiles including other makefiles


From: Paul D. Smith
Subject: Re: A not so clear behaviour for Makefiles including other makefiles
Date: Thu, 13 Nov 2003 09:09:03 -0500

%% Noel Yap <address@hidden> writes:

  ny> "Paul D. Smith" wrote:

  >> The second make starts from scratch, with no memory or information
  >> about the previous make (or even that there _WAS_ a previous make)
  >> or what it did or didn't do.

  ny> Is there any way of passing information to the exec'ed make (eg by
  ny> setting environment variables or something)?

Not currently.  The re-exec code doesn't go through the normal "put
exported make variables to the environment" processing that's done
before a shell is invoked... and I think it's correct to work that way,
otherwise code like:

  ifndef FOO
     FOO = $(BAR)
     export FOO
  endif

wouldn't work properly, if the rebuilt makefile impacted the value of
BAR.


However, this is probably worth requesting as a new feature: some way to
tell whether or not you've re-execed.  I would assume it would be
something like MAKELEVEL, except for counting re-execs.  That way people
could conditionalize on that where they wanted to.  It has to be
carefully done though to be sure the variable is set where it should be
and _NOT_ set where it shouldn't be.

-- 
-------------------------------------------------------------------------------
 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]