ref: ea8a00278f5440673a1c19aa1923befc550ddb63
parent: 33fe2b5883ce776e7c4fec88a049531d7785e491
author: Martin Storsjö <martin@martin.st>
date: Mon Jan 27 09:45:18 EST 2014
Simplify the make rules for creating libraries
--- a/build/gtest-targets.mk
+++ b/build/gtest-targets.mk
@@ -9,8 +9,8 @@
$(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)
--- a/build/mktargets.py
+++ b/build/mktargets.py
@@ -112,8 +112,8 @@
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)
--- a/codec/common/targets.mk
+++ b/codec/common/targets.mk
@@ -30,8 +30,8 @@
$(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)
--- a/codec/decoder/targets.mk
+++ b/codec/decoder/targets.mk
@@ -42,8 +42,8 @@
$(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)
--- a/codec/encoder/targets.mk
+++ b/codec/encoder/targets.mk
@@ -56,8 +56,8 @@
$(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)
--- a/codec/processing/targets.mk
+++ b/codec/processing/targets.mk
@@ -39,8 +39,8 @@
$(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)