On 12/11/06, Paul Smith <[EMAIL PROTECTED]> wrote:
...
Here's another message with a more "real world" example:

http://www.mail-archive.com/help-make@gnu.org/msg05465.html

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
  all-recursive:
       $(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
all-recursive".

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

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


_______________________________________________
Help-make mailing list
Help-make@gnu.org
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to