On Tue, Jan 13, 2009 at 7:34 AM, EXT-Pennington, Dale K
<[email protected]> wrote:
>> From: Christophe LYON [mailto:[email protected]]
>>
>> why wouldn't you use a single library rule, such as:
>> mylib.a: $(OBJS)
>> ar cr $@ $^
>
> Main reason not to would be the total rebuilding of the library every
> time, even if only 1 object file had changed. Right now, I use a rule of
>
> (%.o) : $(OBJ_DIR)/%.o
> @ar $(ARFLAGS) $@ $<
>
> Where ARFLAGS starts as -csr.
Hmm, does it work with $?
mylib.a: $(OBJS)
$(AR) $(ARFLAGS) $@ $?
I believe that should only run 'ar' once, with the list of members
that are newer than the archive, but I haven't actually used that
myself...
Philip Guenther
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make