Hi,

According to manual, make is capable for updating archives when
sources change. I'm trying the following:

%.a: LIBNAME = $(shell echo $(notdir $(basename $@)) | sed s/lib// | \
        tr '[a-z]' '[A-Z]' | tr '/' '_')
%.a: SOURCES = $($(LIBNAME)_SOURCES)
%.a: OBJECTS = $(addprefix $(STORE)/, $(addsuffix .o, $(SOURCES)))
%.a: dirs $@($$(OBJECTS))
        @echo Packing static library $@ ...
        @$(AR) $(ARPARAMS) $@ $(OBJECTS)
        @ranlib $@

$(STORE)/%.c.o: LIBNAME = $(shell echo $(dir $(basename $@)) | sed
s/$(STORE)\\/// | \
        sed s/\\/.*// | tr '[a-z]' '[A-Z]' | tr '/' '_')
$(STORE)/%.c.o: DEPLIBS = $($(LIBNAME)_DEPLIBS)
$(STORE)/%.c.o: DEFINES += $($(LIBNAME)_DEFINES)
$(STORE)/%.c.o: INCLUDES += $($(LIBNAME)_INCLUDES)
$(STORE)/%.c.o: %.c
        @echo Creating object file for $< ...
        @$(CCOMP) $(CPARAMS) $(DEFINES) $(INCLUDES) -c $< -o $@

This rule packages static libraries just fine, if %.a: dirs
$@($$(OBJECTS)) is replaced with %.a: dirs $$(OBJECTS). I'm trying to
understand, why $@(...) does not work here. Do I need to modify
$(STORE)/%.c.o: rule as well, or archive updating simply does not work
with %-ed rules?

Thanks,
- D.

_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to