Mail Archives: djgpp/1997/06/20/12:52:38
Does anyone know of a way to have `make' rebuild only the changed members of
a .a library? For example, I have a library libfoo.a containing func1.o,
func2.o ... func(n).o. Each .o member is built from a .c source. The easy
way is to do this:
--cut--
OBJS = func1.o func2.o [...] func(n).o
libfoo.a : libfoo.a($(OBJS))
--cut--
and let implicit rules handle the rest. This is described in the Archives
section of the docs. But what happens when I make is, if the library is not
up-to-date, every source file is recompiled, and every member re-inserted.
This can take a loooong time if `n' is large.
So what I want is:
for (each source file newer than libfoo.a) do
compile source file
gcc -o funcx.o funcx.c
re-insert member
ar -r libfoo.a funcx.c
How do I get `make' to do this? Is it even possible?
Nate Eldredge
eldredge AT ap DOT net
- Raw text -