%% Philippe Bernard <[EMAIL PROTECTED]> writes:

  pb> When a Makefile is submitted to make, it performs, roughly speaking, a 
  pb> two steps process:
  pb> 1) Recursively check that dependances are correct. In other words, for 
  pb> each requested file:
  pb>     * Either it already exists
  pb>     * And/or there is a rule to build it.
  pb> 2) Build!

This is not how make works.

  pb> Another way to do that would be to build targets "as soon as possible". 
  pb> Here, make would do:
  pb>     * To do all, I need myProg
  pb>         * To do myProg, I need main.o and other.o
  pb>             * To do main.o, I need main.c -> I've got it -> gcc -o 
  pb> main.o -c main.c
  pb>             * To do other.o, I need other.c -> I've got it -> gcc -o 
  pb> other.o -c other.c
  pb>           gcc -o myProg main.o other.o

This is how make works... mostly.

It really goes something like this:

 1) Read in all makefiles, constructing a graph of dependencies as you
    go.

 2) Examine the "current" target.  If it has prerequisites, take each
    one in turn and make it the "current" target, and go to step 2.

 4) After all the prerequisites are checked, if either the target
    doesn't exist _or_ any prerequisite is newer than the target, build
    the target.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to