Simplify the make rules for creating libraries

This commit is contained in:
Martin Storsjö 2014-01-27 14:45:18 +02:00
parent 33fe2b5883
commit ea8a00278f
6 changed files with 12 additions and 12 deletions

View File

@ -9,8 +9,8 @@ $(GTEST_SRCDIR)/%.o: $(GTEST_SRCDIR)/%.cc
$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(GTEST_CFLAGS) $(GTEST_INCLUDES) -c $(CXX_O) $<
$(LIBPREFIX)gtest.$(LIBSUFFIX): $(GTEST_OBJS)
rm -f $(LIBPREFIX)gtest.$(LIBSUFFIX)
$(AR) $(AR_OPTS) $(GTEST_OBJS)
rm -f $@
$(AR) $(AR_OPTS) $+
libraries: $(LIBPREFIX)gtest.$(LIBSUFFIX)
LIBRARIES += $(LIBPREFIX)gtest.$(LIBSUFFIX)

View File

@ -112,8 +112,8 @@ if len(asm) > 0:
if args.library is not None:
f.write("$(LIBPREFIX)%s.$(LIBSUFFIX): $(%s_OBJS)\n"%(args.library, PREFIX))
f.write("\trm -f $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library)
f.write("\t$(AR) $(AR_OPTS) $(%s_OBJS)\n"%PREFIX)
f.write("\trm -f $@\n")
f.write("\t$(AR) $(AR_OPTS) $+\n")
f.write("\n")
f.write("libraries: $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library)
f.write("LIBRARIES += $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library)

View File

@ -30,8 +30,8 @@ $(COMMON_SRCDIR)/%.o: $(COMMON_SRCDIR)/%.asm
$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(COMMON_ASMFLAGS) $(COMMON_ASM_INCLUDES) -o $@ $<
$(LIBPREFIX)common.$(LIBSUFFIX): $(COMMON_OBJS)
rm -f $(LIBPREFIX)common.$(LIBSUFFIX)
$(AR) $(AR_OPTS) $(COMMON_OBJS)
rm -f $@
$(AR) $(AR_OPTS) $+
libraries: $(LIBPREFIX)common.$(LIBSUFFIX)
LIBRARIES += $(LIBPREFIX)common.$(LIBSUFFIX)

View File

@ -42,8 +42,8 @@ $(DECODER_SRCDIR)/%.o: $(DECODER_SRCDIR)/%.asm
$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(DECODER_ASMFLAGS) $(DECODER_ASM_INCLUDES) -o $@ $<
$(LIBPREFIX)decoder.$(LIBSUFFIX): $(DECODER_OBJS)
rm -f $(LIBPREFIX)decoder.$(LIBSUFFIX)
$(AR) $(AR_OPTS) $(DECODER_OBJS)
rm -f $@
$(AR) $(AR_OPTS) $+
libraries: $(LIBPREFIX)decoder.$(LIBSUFFIX)
LIBRARIES += $(LIBPREFIX)decoder.$(LIBSUFFIX)

View File

@ -56,8 +56,8 @@ $(ENCODER_SRCDIR)/%.o: $(ENCODER_SRCDIR)/%.asm
$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(ENCODER_ASMFLAGS) $(ENCODER_ASM_INCLUDES) -o $@ $<
$(LIBPREFIX)encoder.$(LIBSUFFIX): $(ENCODER_OBJS)
rm -f $(LIBPREFIX)encoder.$(LIBSUFFIX)
$(AR) $(AR_OPTS) $(ENCODER_OBJS)
rm -f $@
$(AR) $(AR_OPTS) $+
libraries: $(LIBPREFIX)encoder.$(LIBSUFFIX)
LIBRARIES += $(LIBPREFIX)encoder.$(LIBSUFFIX)

View File

@ -39,8 +39,8 @@ $(PROCESSING_SRCDIR)/%.o: $(PROCESSING_SRCDIR)/%.asm
$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(PROCESSING_ASMFLAGS) $(PROCESSING_ASM_INCLUDES) -o $@ $<
$(LIBPREFIX)processing.$(LIBSUFFIX): $(PROCESSING_OBJS)
rm -f $(LIBPREFIX)processing.$(LIBSUFFIX)
$(AR) $(AR_OPTS) $(PROCESSING_OBJS)
rm -f $@
$(AR) $(AR_OPTS) $+
libraries: $(LIBPREFIX)processing.$(LIBSUFFIX)
LIBRARIES += $(LIBPREFIX)processing.$(LIBSUFFIX)