help-make
[Top][All Lists]
Advanced

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

Re: how to disable all checking of prerequisites


From: Paul Smith
Subject: Re: how to disable all checking of prerequisites
Date: Fri, 13 Nov 2009 22:20:32 -0500

On Fri, 2009-11-13 at 18:15 -0800, Mark Galeck (CW) wrote:
> foobar: foobar0 foobar1 foobar2 … foobar1000
> 
> with no commands, all I want is to check, whether file foobar is older
> than any of the prerequisites.  Assume all prerequisites exist, and I
> do not want make to check anything about them, whether there are any
> rules for them, etc etc.  Just check the timestamps and compare with
> that of foobar.  
> 
> Even if do make –r, and I try various combinations of ::, ; and stuff,
> make always checks lots and lots of things, for example, if there are
> any implicit rules (and does not find any).  So the above, takes 10
> seconds on my machine, when checking 1000 timestamps, should be much
> much faster.

First, make treats every prerequisite as if it were a target.  There is
no way to disable this.

It's surprising to me that it takes that long on your system.  I just
tried this on my Linux box, by touching 1000 files:

    i=1; while [[ $i -le 1000 ]]; do touch foo$i; : $((++i)); done

then creating a makefile with nothing in it but a target "foo" listing
all 1000 fooNNN files as prerequisites, and no rules to build any of
them.

When I run normal make, it takes an average of 0.23s to run.

When I run make -r, it takes an average of 0.006s to run.

I seriously doubt whether the "processing time" make expends internally
is much different between our two systems (unless you're running on an
old IBM i386 or something).  To me this suggests that your system has
much slower file I/O.  What kind of operating system are you using?
What kind of filesystem?

Are you SURE that 1000 timestamp lookups is really that much faster?
Have you run a sample program that does those lookups, and compared the
time?

My suspicion is that your performance problems lie elsewhere, other than
make.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist





reply via email to

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