help-make
[Top][All Lists]
Advanced

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

How to force make to dynamically check rule prerequisites


From: Joshua Redstone
Subject: How to force make to dynamically check rule prerequisites
Date: Thu, 2 Aug 2001 16:33:27 -0700 (PDT)

Suppose I have the following makefile with make 3.79:

-----------
foo: foo2 foo3
        cat foo2 foo3 > foo

foo2:
        echo "Need to execute some special command to make foo2"
foo3:
        echo "Need to execute some special command to make foo3"
-----------

If I execute 'make foo' in an empty directory, make will execute the
command 'cat foo2 foo3 > foo' (resulting in an error because foo2 and foo3
doen't exist).

Is there any way to cause make to fire exactly those set of rules whose
prerequisites have been satisfied?  In the example above, this would mean
that make fires the rules for foo2 and foo3, and then exits with an error
saying that foo can't be remade because the rules for foo2 and foo3 didn't
produce a foo2 and foo3.

Thanks very much for any help.

-Josh

P.S. the reason I have rules whose body doesn't produce the target is that
the actaul commands to make the target are long-running.  I want the
makefile to give me an idea of what targets are ready to be built so I can
then make decisions about how to build them (load balancing, etc.)




reply via email to

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