Compiling C programs

Hi everyone,

If you have a few c programs to compile, from a make file, how can you tell which program is compiled first. Descriptively, you may have:

objects = main.o xyz.o 123.o abc.o

target : $(objects)
$(CC) -o $@ $(objects)

Does this mean program xyz is called within main, compiled and linked before programs 123 and abc?

Any input greatly appreciated!

Thanks,

Rachael

In general, yes, you are correct.
Remember however, if you made a change to
the source file abc.c then ran make
again, then only abc.o will be built
then all will be linked in order again.
The compile order is less significant than
link order. The order of the
object files and libraries must be correct
to resolve symbols properly.