2008年12月7日 星期日

Some Makefile tips and questions

$(SHARED_LIBS:%.so=%.d): %.d: %.c
@-$(CC) -M -MG $(CFLAGS) $< | \
sed -e 's@^.*\.o:@$*.d $*_sh.o:@' > $@

Q. What doest this mean? $(SHARED_LIBS:%.so=%.d)
Q. What does here two colon mean?

-------------------------------------------------------
Makefile Rule Format:
In general, a rule looks like this:
targets : prerequisites
command
...

or like this:

targets : prerequisites ; command
command
-------------------------------------------------------

Another similar parts.
$(SHARED_LIBS): %.so : %_sh.o
$(CC) -shared $(EXT_LDFLAGS) -o $@ $<

$(SHARED_SE_LIBS:%.so=%.d): %.d: %.c
@-$(CC) -M -MG $(CFLAGS) $< | \
sed -e 's@^.*\.o:@$*.d $*_sh.o:@' > $@

$(SHARED_SE_LIBS): %.so : %_sh.o
$(LD) -shared $(EXT_LDFLAGS) -o $@ $< $(LDLIBS)

沒有留言: