Imagine the following Makefile:

***********BEGIN
all: 1.a

1.a: 1.o
        cat 1.o >> 1.a

1.o: 1.c
        cat 1.c >> 1.o
***********END


Then, if I have file "1.c", this is
what happens:


[EMAIL PROTECTED]:~$ make
cat 1.c >> 1.o
cat 1.o >> 1.a

[EMAIL PROTECTED]:~$ ls
1.a  1.c  1.o  Makefile


Nothing new up to this point.

If I now delete "1.o"  and type "make" again,
this is what happens:

[EMAIL PROTECTED]:~$ rm 1.o
[EMAIL PROTECTED]:~$ make
cat 1.c >> 1.o
cat 1.o >> 1.a

That is, everything is rebuilt.

However I don't want everything to be rebuilt. Even
if the intermediate "1.o" file has changed, the final
result is going to be the same one.

Is there anyway I can tell gmake about this ?

The idea is to keep ".a" libraries in the CVS together
with the source code (but NOT the object files also)
and only compile source files when at least one of them
is newer than the CVS library.

Thanks !!

Reply via email to