My rule for building my foo.a library is:
${LIB}: ${LIB_OBJ}
ar ${LIB_ARGS} ${LIB} ${LIB_OBJ}
ranlib ${LIB}
This becomes:
ar -cvrU lib/libfoo.a ... (all the obj/foo.o files)
It works, but as I add more code, this takes longer and longer. It's necessary for a clean build, but what if libfoo.a lists, and I've only changed a single foo.cpp?
Note that I just did this manually:
ar -cvrU lib/libfoo.a obj/foo.o
And it took 10 or 15 seconds, which seems a little crazy.
So I guess my question: can I do this more efficiently?