[Top][All Lists]

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

Re: Improvement on parallel make

From: Philip Guenther
Subject: Re: Improvement on parallel make
Date: Tue, 12 Dec 2006 01:15:51 -0700

On 12/11/06, Paul Smith <address@hidden> wrote:
Here's another message with a more "real world" example:

The desire in that example is to just write _this_ makefile:

  local_objects = a.o b.o c.o d.o
  all: all-recursive .WAIT all-local
       $(MAKE) -C subdir all
  all-local: $(local_objects)

with the understanding that the .WAIT is necessary for the correctness
of the build, right?  I mean, if the .WAIT isn't actually _necessary_
then why the big deal?

So, one or more of the local objects is dependent on all-recursive
being built first.  But all-recursive is a phony, so they must
_really_ be dependent on something that all-recursive builds.  Rather
than actually state the real dependencies (a.o needs subdir/built.h
and c.o needs subdir2/another-built.h), that makefile tries to say
"all dependencies of all-local are order-only dependent on

But it doesn't really do that!  The .WAIT connection only applies when
both all-local and all-recursive are being built.  If you simply say
"make a.o" the .WAIT will have no effect and it will build a.o without
first trying running all-recursive.  That's a broken makefile, as
there is a necessary dependency that isn't expressed.

  local_objects = a.o b.o c.o d.o
  all: all-recursive

       $(MAKE) -C subdir all
  all-local: $(local_objects)

reply via email to

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