help-make
[Top][All Lists]
Advanced

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

RE: include files with :=


From: Paul D. Smith
Subject: RE: include files with :=
Date: Wed, 15 Dec 2004 13:04:45 -0500

%% "Dill, John" <address@hidden> writes:

  >> my_var:=$(shell script)

  dj> I did some more investigation and found that this is where my
  dj> performance problem is.  It appears that time increases linearly
  dj> with the number of times the include file with ':=' variables are
  dj> included, which means make is evaluating it each time it is seen
  dj> like it should.  Adding inclusion guards to my include files
  dj> should fix my performance problem.

You can also add guards around that variable:

    ifndef my_var
      my_var := $(shell script)
    endif

Of course be aware of getting it from the environment if you don't want
to allow that; you can use a fancier test based on the $(origin ...)
function to avoid that if you want.

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