2008年6月20日 星期五

Makefile tips and questions

xyz.a: a.o b.o c.o d.o
ar crv $@ $<

Q. I want to archive the whole objects (a.o b.o c.o d.o) into a single static library.
But I can't use the sign "$<" to refer all the afterward objects. It just include the first object, what sign should I use in this condition

The sign $^ seems can present the whole objects (a.o b.o c.o d.o). So maybe we can use the following presentation lines.
xyz.a: a.o b.o c.o d.o
ar crv $@ $^

沒有留言: