help-make
[Top][All Lists]
Advanced

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

Re: cost of -MP


From: Noel Yap
Subject: Re: cost of -MP
Date: Fri, 28 May 2004 12:07:06 -0400
User-agent: Mozilla Thunderbird 0.5 (Windows/20040212)

Boris Kolpackov wrote:

Noel Yap <address@hidden> writes:

OK, in this case then, the dependency files should have no empty targets for header files that don't exist. Is this correct?

It is slower if there are empty targets for each header as per my original
post.

Again, sorry for the confusion, I was going by a later post:

> I was referring to the case when target does not exist (as a file) and
> there is not command to build it. In this case make treats it exactly
> as if it was PHONY.

Anyway, this is starting to sound more like the time needed to parse the 
makefile rather than checking timestamps.

So, back to your original post:

>  * If some of the headers are generated using pattern rules those rules
>    should come before the do-nothing rule. See also
>
>    http://mail.gnu.org/archive/html/help-make/2004-02/msg00015.html

I've started to favor static rules over pattern rules.  The user sets some 
variables representing the source and targets (if the targets can't be derived 
from the source), then includes a module makefile which uses only static rules.

>  * Some headers (notably ones from C++ standard library) don't have
>    suffixes. There are two observations to consider:
>
>    - headers in system directories don't get removed very often
>
>
>    - for cases like C++ std lib we can write something like this:
>
>      /usr/include/%:: ;
>      /usr/local/include/%:: ;

It may be beneficial to strip out from the dependencies file the header files 
that tend not to change especially if, as I'm guessing above, the slowdown is 
due to makefile parsing rather than timestamp checking.

If the build system wants to allow different versions of compilers to be used 
(eg gcc 2.96 vs gcc 3.2), it can't assume standard header files will be in 
either of the above directories.

Noel





reply via email to

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