[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
2 level dependencies in Makefiles
From: |
address@hidden |
Subject: |
2 level dependencies in Makefiles |
Date: |
Thu, 25 Oct 2007 15:33:14 -0000 |
User-agent: |
G2/1.0 |
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:
john@tokio:~$ make
cat 1.c >> 1.o
cat 1.o >> 1.a
john@tokio:~$ 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:
john@tokio:~$ rm 1.o
john@tokio:~$ 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 !!
- 2 level dependencies in Makefiles,
address@hidden <=