[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GMAKE speed ups.
From: |
Paul D. Smith |
Subject: |
Re: GMAKE speed ups. |
Date: |
Thu, 6 Mar 2003 13:02:25 -0500 |
%% Bijal Shah <address@hidden> writes:
bs> Part1:
bs> ======
bs> Add the following rule to the makefile.
bs> .SUFFIXES:
bs> This resulted improvement to 2.6 seconds for the same GMAKE invokation.
bs> Part2:
bs> ======
bs> Explicitly disable the built-in rules - there isn't an easy way to
bs> do this, but its worth it. These can be found with "gmake -p", but
bs> here is the full list anyway:
bs> %: %.c
bs> (%): %
bs> %.out: %
bs> %.c: %.w %.ch
bs> %.tex: %.w %.ch
bs> %:: %,v
bs> %:: RCS/%,v
bs> %:: RCS/%
bs> %:: s.%
bs> %:: SCCS/s.%
None of these below should be in your makefile. The .SUFFIXES: will
turn all of these off.
bs> .c:
bs> .texinfo.info:
bs> .mod.o:
bs> .c.o:
bs> .s:
bs> .txinfo.dvi:
bs> .y.c:
bs> .web.tex:
bs> .s.o:
bs> .F.f:
bs> .web.p:
bs> .F:
bs> .cc.o:
bs> .S.s:
bs> .def.sym:
bs> .F.o:
bs> .f:
bs> .y.ln:
bs> .texi.dvi:
bs> .texinfo.dvi:
bs> .p.o:
bs> .r.f:
bs> .w.tex:
bs> .txinfo.info:
bs> .o:
bs> .c.ln:
bs> .l.r:
bs> .r.o:
bs> .C.o:
bs> .p:
bs> .l.c:
bs> .sh:
bs> .cc:
bs> .f.o:
bs> .texi.info:
bs> .cpp.o:
bs> .l.ln:
bs> .S.o:
bs> .tex.dvi:
bs> .r:
bs> .mod:
bs> .C:
bs> .S:
bs> .w.c:
bs> .cpp:
bs> This improved the performance further to .6 seconds. I did some
bs> basic analysis to figure out what was taking the most time out of
bs> all these rules and it has proven to be the :: rules for RCS and
bs> SCCS updating. Even with a few files, the checks that these rules
bs> invoked added significantly to overall processing time.
That's because those rules are "match anything" rules; that is, the left
hand pattern is "%" with no suffix, etc. That means that make will
_always_ consider that rule when looking for an implicit way to build
targets, no matter what the filename is.
The other pattern rules, like
--
-------------------------------------------------------------------------------
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