ref: 00a76419b498df71c67a333d419d92856a126c80
parent: d9cbe19110cad66f2654a4aed2f387e89b2f6afd
parent: ea8a00278f5440673a1c19aa1923befc550ddb63
author: Ethan Hugg <[email protected]>
date: Mon Jan 27 09:09:20 EST 2014
Merge pull request #237 from mstorsjo/simplify-make-lib-rules Simplify the make rules for creating libraries
--- a/build/gtest-targets.mk
+++ b/build/gtest-targets.mk
@@ -8,8 +8,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
@@ -111,8 +111,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
@@ -29,8 +29,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
@@ -41,8 +41,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
@@ -55,8 +55,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
@@ -38,8 +38,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)