help-make
[Top][All Lists]
Advanced

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

Re: how to include dependencies only if includes changed


From: Bart Robinson
Subject: Re: how to include dependencies only if includes changed
Date: Tue, 10 Nov 2009 11:43:02 -0800

On Mon, Nov 9, 2009 at 7:23 PM, Mark Galeck (CW) <address@hidden> wrote:
>> The time should be relative to number of total .h files (and I
>> guess number of included files).
>
> Hmm, from what I see, what takes a long time, is all the lines from
> all the .o files, to read in all this stuff, is more that a million
> lines, then I guess make checks if any of those lines have anything
> to do with your foobar.o target, and finds out most of them they do
> not.  Anyway, it seems most of the time is just reading all the
> files.
>
>>I have a much smaller project (~200 sources + ~250 headers) but I
>>noticed that the implicit rules of make can really slow things down:
>
> Oh thank you very much, I definitely will take a look and follow
> your suggestion if I can!

FWIW, I recently went thru this slimming exercise and here is what I'm
using to get rid of most of the implicit rules (using make -r is not a
option, and of course it isn't possible to set the -r'ness in a
makefile itself, since the implicits are loaded before reading your
makefile):

 1. make your dependencies have empty commands, to avoid searching
    implicit rules
      $(all-your-dependency-.d-files): ;

 2. add this to your makefile to neuter most of the built-ins
     .SUFFIXES:
     %:: %,v
     %:: RCS/%
     %:: RCS/%,v
     %:: s.%
     %:: SCCS/s.%
     %.c: %.w %.ch

-- bart




reply via email to

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