%% Mark Kohler <[EMAIL PROTECTED]> writes:

  mk> I have about 175 source files in about 30 directories that need
  mk> to be built. From the main Makefile, I include a module.mk from
  mk> each directory, and then I include a .P dependency file for each
  mk> source file. Nearly all of the module.mk files are of the form

  mk> SRC += foo.cpp bar.cpp glarch.cpp

  mk> Even if none of the .P dependency files have been generated yet,
  mk> it takes over a minute (P3-550, 128 MB RAM) for make to work out
  mk> what it needs to do and start compiling things. The CPU is pegged
  mk> at 100% during that time.

  mk> This seems slow enough to me that I wonder if I'm doing something
  mk> wrong, or at least wildly inefficient.

  mk> Does this seem like an appropriate amount of time?

That seems pretty slow to me.  175 files is not very many.

Please provide information on what version of GNU make you're using,
what OS and version of OS you're using, etc.  If you're using Linux, try
to figure out what version of GLIBC you're using; some RedHat distros
shipped with a "beta" version of GLIBC which has a bug in the globbing
library which makes it _very_ slow.  This was a while ago, so if you're
using 6.1 or better you're probably fine here.

Without more details it's pretty hard to give advice.  Try running "make
-d", which will generate voluminous output, then look and see if you can
see anything seriously wrong.  If you have make 3.79, you can try to cut
down on the output somewhat with the special --debug options (see the
manual).

Look especially for: make deciding to re-exec; it should never need to
do this with the advanced dependencies.

Also look for very complex implicit rule searches.  It could well be a
great timesaver to run make with the -r option (or define an empty
.SUFFIXES target which is almost as good--see the manual on these) and
then explicitly specify only those implicit rules you really need.  The
manual tells you how to generate a complete list of the default rules
database, so you can duplicate the rules you want (if you want to use
the standard definitions).

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.ultranet.com/~pauld/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

Reply via email to