[Top][All Lists]

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

Re: Question about order dependencies

From: Philip Guenther
Subject: Re: Question about order dependencies
Date: Mon, 21 Sep 2009 13:50:47 -0700

On Sun, Sep 20, 2009 at 12:33 PM, drwowe <address@hidden> wrote:
> Philip Guenther-2 wrote:
>> Hmm, could you give an example of what the 'foo' and 'bar' targets
>> would be doing?  Apparently the 'bar' target doesn't really rely on
>> 'foo' even existing, so where does the requirement for 'foo' to be
>> built before 'bar' come from?
> Foo actually does have a logical dependency on bar.  In the real example Foo
> builds an application and Bar builds a bunch of libraries.  The only thing
> is, "make bar" wastes time because the library code isn't updated as often,
> so "make foo" spends valuable seconds recursing into bar's subdirectories
> and checking all of bar's dependencies.  These seconds add up when make foo
> gets run frequently as it does when I'm debugging.  That's the purpose of
> this question is to avoid the time spent checking dependencies when I
> explicitly request "make foo".  Basically I want to tell make: "I already
> know bar is up to date, so don't bother recursing and checking timestamps
> because it's a waste of time"

Gotcha.  I would probably use the "test MAKECMDGOALS" kludge for now
while doing a profiling of the library part of the make process to see
why it takes so long as to be annoying.  The danger is that you'll
take the speed shortcut when it isn't actually safe and end up wasting
*much* more time working with bad binaries ("why isn't my fix
working?!") than you would have lost getting accurate builds.

(I led a good sized project at work that had a recursive make build
system that drove us developers up the wall for exactly those reasons:
multiple minutes to do a "make build" when nothing had changed,
leading to partial rebuilds that missed changes.  So I ripped it out
and put in a non-recursive setup.  With full-dependencies, the new
setup took just a handful of seconds to determine that nothing was to
be built on an E220R running Solaris 7.  I just checked and on my
laptop it now takes less than a second to determine that there's
nothing to build.)

Philip Guenther

reply via email to

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