Thomas Matthews <Thomas_Hates_Spam cox.network> wrote:
> file_a.o : file_a.c file_a.h
>
> file_b.o : file_b.c file_b.h
>
> file_c.o : file_c.c file_c.h
>
> file_d.o : file_d.c file_d.h
>
> In the above scenario, if all the '.o' file are
deleted, the gcc
> compiler will be invoked four times, once for each
file.
You can do this:
file_a.o file_b.o file_c.o file_d.o: \
file_a.c file_b.c file_c.c file_d.c \
file_a.h file_b.h file_c.h file_d.h
gcc -c file_a.c file_b.c file_c.c file_d.c
The downside this way is that all four files will be
recompiled even
if only one is out of date. You should probably measure the
build
time for each of the two Makefiles, and in each situation
(full
rebuild vs. updating one file) to see which is better
overall.
paul
_______________________________________________
help-gnu-utils mailing list
help-gnu-utils gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-utils
|