help-make
[Top][All Lists]
Advanced

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

Re: include files with :=


From: Noel Yap
Subject: Re: include files with :=
Date: Wed, 15 Dec 2004 12:37:17 -0500
User-agent: Mozilla Thunderbird 0.5 (Windows/20040212)

Dill, John wrote:

I am still trying to track down where exactly my lag time is coming from, and it 
doesn't >appear to be from using the include directive by itself.  My question 
is how makefile
evaluates variables that are defined using ':=' with respect to include files.

If I have a file include_me.mk which contains:

my_var:=$(shell script)

and I have included this file several times (indirectly through my file's 
dependent
include files).  Does make re-evaluate this variable assignment each time 
'include
include_me.mk' appears?

If that's the case, then I think that's where my problem is.

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

This makes sense.  The := is evaluated at the time of the assignment (rather 
than at the time of usage as with =).  As Paul has said $(system) is an 
expensive call.

Noel




reply via email to

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