ref: baa63ea6a03961397f6d07246bdfe12070adfa0c
parent: fc6f756436a039e437db63ee9b7f2a1223e231bd
parent: e1b5e038d2c1af093103347a4c2da9289f7a0f1c
author: Ethan Hugg <[email protected]>
date: Tue Mar 18 06:58:12 EDT 2014
Merge pull request #536 from mstorsjo/obj-suffix Use .obj as suffix for object files on MSVC
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
# Object files
*.o
+*.obj
# Dependency files
*.d
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,7 @@
V=Yes
PREFIX=/usr/local
SHARED=-shared
+OBJ=o
ifeq (,$(wildcard ./gtest))
HAVE_GTEST=No
@@ -99,7 +100,7 @@
all: libraries binaries
clean:
- $(QUIET)rm -f $(OBJS) $(OBJS:.o=.d) $(LIBRARIES) $(BINARIES)
+ $(QUIET)rm -f $(OBJS) $(OBJS:.$(OBJ)=.d) $(LIBRARIES) $(BINARIES)
gtest-bootstrap:
svn co https://googletest.googlecode.com/svn/trunk/ gtest
@@ -159,4 +160,4 @@
include test/targets.mk
endif
--include $(OBJS:.o=.d)
+-include $(OBJS:.$(OBJ)=.d)
--- a/build/gtest-targets.mk
+++ b/build/gtest-targets.mk
@@ -2,10 +2,10 @@
GTEST_CPP_SRCS=\
$(GTEST_SRCDIR)/src/gtest-all.cc\
-GTEST_OBJS += $(GTEST_CPP_SRCS:.cc=.o)
+GTEST_OBJS += $(GTEST_CPP_SRCS:.cc=.$(OBJ))
OBJS += $(GTEST_OBJS)
-$(GTEST_SRCDIR)/%.o: $(GTEST_SRCDIR)/%.cc
+$(GTEST_SRCDIR)/%.$(OBJ): $(GTEST_SRCDIR)/%.cc
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(GTEST_CFLAGS) $(GTEST_INCLUDES) -c $(CXX_O) $<
$(LIBPREFIX)gtest.$(LIBSUFFIX): $(GTEST_OBJS)
--- a/build/mktargets.py
+++ b/build/mktargets.py
@@ -20,11 +20,11 @@
CPP_SUFFIX=".cpp"
def make_o(x):
- return os.path.splitext(x)[0] + ".o"
+ return os.path.splitext(x)[0] + ".$(OBJ)"
def write_cpp_rule_pattern(f):
src = "$(%s_SRCDIR)/%%%s"%(PREFIX, CPP_SUFFIX)
- dst = "$(%s_SRCDIR)/%%.o"%(PREFIX)
+ dst = "$(%s_SRCDIR)/%%.$(OBJ)"%(PREFIX)
f.write("%s: %s\n"%(dst, src))
f.write('\t$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(' + PREFIX + '_CFLAGS) $(' + PREFIX + '_INCLUDES) -c $(CXX_O) $<\n')
@@ -32,7 +32,7 @@
def write_c_rule_pattern(f):
src = "$(%s_SRCDIR)/%%.c"%(PREFIX)
- dst = "$(%s_SRCDIR)/%%.o"%(PREFIX)
+ dst = "$(%s_SRCDIR)/%%.$(OBJ)"%(PREFIX)
f.write("%s: %s\n"%(dst, src))
f.write('\t$(QUIET_CC)$(CC) $(CFLAGS) $(INCLUDES) $(' + PREFIX + '_CFLAGS) $(' + PREFIX + '_INCLUDES) -c $(CXX_O) $<\n')
@@ -40,7 +40,7 @@
def write_asm_rule_pattern(f):
src = "$(%s_SRCDIR)/%%.asm"%(PREFIX)
- dst = "$(%s_SRCDIR)/%%.o"%(PREFIX)
+ dst = "$(%s_SRCDIR)/%%.$(OBJ)"%(PREFIX)
f.write("%s: %s\n"%(dst, src))
f.write('\t$(QUIET_ASM)$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(' + PREFIX + '_ASMFLAGS) $(' + PREFIX + '_ASM_INCLUDES) -o $@ $<\n')
@@ -48,7 +48,7 @@
def write_asm_s_rule_pattern(f):
src = "$(%s_SRCDIR)/%%.S"%(PREFIX)
- dst = "$(%s_SRCDIR)/%%.o"%(PREFIX)
+ dst = "$(%s_SRCDIR)/%%.$(OBJ)"%(PREFIX)
f.write("%s: %s\n"%(dst, src))
f.write('\t$(QUIET_CCAS)$(CCAS) $(CFLAGS) $(ASMFLAGS) $(INCLUDES) $(' + PREFIX + '_CFLAGS) $(' + PREFIX + '_INCLUDES) -c -o $@ $<\n')
@@ -118,7 +118,7 @@
for c in cpp:
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
f.write("\n")
-f.write("%s_OBJS += $(%s_CPP_SRCS:%s=.o)\n\n"%(PREFIX, PREFIX, CPP_SUFFIX))
+f.write("%s_OBJS += $(%s_CPP_SRCS:%s=.$(OBJ))\n\n"%(PREFIX, PREFIX, CPP_SUFFIX))
if len(cfiles) > 0:
f.write("%s_C_SRCS=\\\n"%(PREFIX))
@@ -125,7 +125,7 @@
for cfile in cfiles:
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, cfile))
f.write("\n")
- f.write("%s_OBJS += $(%s_C_SRCS:.c=.o)\n\n"%(PREFIX, PREFIX))
+ f.write("%s_OBJS += $(%s_C_SRCS:.c=.$(OBJ))\n\n"%(PREFIX, PREFIX))
if len(asm) > 0:
f.write("ifeq ($(ASM_ARCH), x86)\n")
@@ -133,7 +133,7 @@
for c in asm:
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
f.write("\n")
- f.write("%s_OBJS += $(%s_ASM_SRCS:.asm=.o)\n"%(PREFIX, PREFIX))
+ f.write("%s_OBJS += $(%s_ASM_SRCS:.asm=.$(OBJ))\n"%(PREFIX, PREFIX))
f.write("endif\n\n")
if len(sfiles) > 0:
@@ -142,7 +142,7 @@
for c in sfiles:
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
f.write("\n")
- f.write("%s_OBJS += $(%s_ASM_S_SRCS:.S=.o)\n"%(PREFIX, PREFIX))
+ f.write("%s_OBJS += $(%s_ASM_S_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
f.write("endif\n\n")
f.write("OBJS += $(%s_OBJS)\n"%PREFIX)
--- a/build/platform-android.mk
+++ b/build/platform-android.mk
@@ -57,7 +57,7 @@
cd ./codec/build/android/enc && $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI) && android update project -t $(TARGET) -p . && ant debug
COMMON_INCLUDES += -I$(NDKROOT)/sources/android/cpufeatures
-COMMON_OBJS += $(COMMON_SRCDIR)/cpu-features.o
+COMMON_OBJS += $(COMMON_SRCDIR)/cpu-features.$(OBJ)
-codec/common/cpu-features.o: $(NDKROOT)/sources/android/cpufeatures/cpu-features.c
+codec/common/cpu-features.$(OBJ): $(NDKROOT)/sources/android/cpufeatures/cpu-features.c
$(QUIET_CC)$(CC) $(CFLAGS) $(INCLUDES) $(COMMON_CFLAGS) $(COMMON_INCLUDES) -c $(CXX_O) $<
--- a/build/platform-msvc-common.mk
+++ b/build/platform-msvc-common.mk
@@ -13,6 +13,7 @@
LIBSUFFIX=lib
LIBPREFIX=
EXEEXT=.exe
+OBJ=obj
SHAREDLIBSUFFIX=dll
SHARED=-LD
SHLDFLAGS=-link -def:wels.def -implib:wels_dll.lib
--- a/codec/common/targets.mk
+++ b/codec/common/targets.mk
@@ -6,7 +6,7 @@
$(COMMON_SRCDIR)/logging.cpp\
$(COMMON_SRCDIR)/WelsThreadLib.cpp\
-COMMON_OBJS += $(COMMON_CPP_SRCS:.cpp=.o)
+COMMON_OBJS += $(COMMON_CPP_SRCS:.cpp=.$(OBJ))
ifeq ($(ASM_ARCH), x86)
COMMON_ASM_SRCS=\
@@ -19,7 +19,7 @@
$(COMMON_SRCDIR)/satd_sad.asm\
$(COMMON_SRCDIR)/vaa.asm\
-COMMON_OBJS += $(COMMON_ASM_SRCS:.asm=.o)
+COMMON_OBJS += $(COMMON_ASM_SRCS:.asm=.$(OBJ))
endif
ifeq ($(ASM_ARCH), arm)
@@ -28,17 +28,17 @@
$(COMMON_SRCDIR)/expand_picture_neon.S\
$(COMMON_SRCDIR)/mc_neon.S\
-COMMON_OBJS += $(COMMON_ASM_S_SRCS:.S=.o)
+COMMON_OBJS += $(COMMON_ASM_S_SRCS:.S=.$(OBJ))
endif
OBJS += $(COMMON_OBJS)
-$(COMMON_SRCDIR)/%.o: $(COMMON_SRCDIR)/%.cpp
+$(COMMON_SRCDIR)/%.$(OBJ): $(COMMON_SRCDIR)/%.cpp
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(COMMON_CFLAGS) $(COMMON_INCLUDES) -c $(CXX_O) $<
-$(COMMON_SRCDIR)/%.o: $(COMMON_SRCDIR)/%.asm
+$(COMMON_SRCDIR)/%.$(OBJ): $(COMMON_SRCDIR)/%.asm
$(QUIET_ASM)$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(COMMON_ASMFLAGS) $(COMMON_ASM_INCLUDES) -o $@ $<
-$(COMMON_SRCDIR)/%.o: $(COMMON_SRCDIR)/%.S
+$(COMMON_SRCDIR)/%.$(OBJ): $(COMMON_SRCDIR)/%.S
$(QUIET_CCAS)$(CCAS) $(CFLAGS) $(ASMFLAGS) $(INCLUDES) $(COMMON_CFLAGS) $(COMMON_INCLUDES) -c -o $@ $<
$(LIBPREFIX)common.$(LIBSUFFIX): $(COMMON_OBJS)
--- a/codec/console/dec/targets.mk
+++ b/codec/console/dec/targets.mk
@@ -4,10 +4,10 @@
$(H264DEC_SRCDIR)/src/h264dec.cpp\
$(H264DEC_SRCDIR)/src/read_config.cpp\
-H264DEC_OBJS += $(H264DEC_CPP_SRCS:.cpp=.o)
+H264DEC_OBJS += $(H264DEC_CPP_SRCS:.cpp=.$(OBJ))
OBJS += $(H264DEC_OBJS)
-$(H264DEC_SRCDIR)/%.o: $(H264DEC_SRCDIR)/%.cpp
+$(H264DEC_SRCDIR)/%.$(OBJ): $(H264DEC_SRCDIR)/%.cpp
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264DEC_CFLAGS) $(H264DEC_INCLUDES) -c $(CXX_O) $<
h264dec$(EXEEXT): $(H264DEC_OBJS) $(LIBS) $(H264DEC_LIBS) $(H264DEC_DEPS)
--- a/codec/console/enc/targets.mk
+++ b/codec/console/enc/targets.mk
@@ -3,10 +3,10 @@
$(H264ENC_SRCDIR)/src/read_config.cpp\
$(H264ENC_SRCDIR)/src/welsenc.cpp\
-H264ENC_OBJS += $(H264ENC_CPP_SRCS:.cpp=.o)
+H264ENC_OBJS += $(H264ENC_CPP_SRCS:.cpp=.$(OBJ))
OBJS += $(H264ENC_OBJS)
-$(H264ENC_SRCDIR)/%.o: $(H264ENC_SRCDIR)/%.cpp
+$(H264ENC_SRCDIR)/%.$(OBJ): $(H264ENC_SRCDIR)/%.cpp
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264ENC_CFLAGS) $(H264ENC_INCLUDES) -c $(CXX_O) $<
h264enc$(EXEEXT): $(H264ENC_OBJS) $(LIBS) $(H264ENC_LIBS) $(H264ENC_DEPS)
--- a/codec/decoder/targets.mk
+++ b/codec/decoder/targets.mk
@@ -23,7 +23,7 @@
$(DECODER_SRCDIR)/plus/src/welsCodecTrace.cpp\
$(DECODER_SRCDIR)/plus/src/welsDecoderExt.cpp\
-DECODER_OBJS += $(DECODER_CPP_SRCS:.cpp=.o)
+DECODER_OBJS += $(DECODER_CPP_SRCS:.cpp=.$(OBJ))
ifeq ($(ASM_ARCH), x86)
DECODER_ASM_SRCS=\
@@ -31,7 +31,7 @@
$(DECODER_SRCDIR)/core/asm/dct.asm\
$(DECODER_SRCDIR)/core/asm/intra_pred.asm\
-DECODER_OBJS += $(DECODER_ASM_SRCS:.asm=.o)
+DECODER_OBJS += $(DECODER_ASM_SRCS:.asm=.$(OBJ))
endif
ifeq ($(ASM_ARCH), arm)
@@ -39,17 +39,17 @@
$(DECODER_SRCDIR)/core/arm/block_add_neon.S\
$(DECODER_SRCDIR)/core/arm/intra_pred_neon.S\
-DECODER_OBJS += $(DECODER_ASM_S_SRCS:.S=.o)
+DECODER_OBJS += $(DECODER_ASM_S_SRCS:.S=.$(OBJ))
endif
OBJS += $(DECODER_OBJS)
-$(DECODER_SRCDIR)/%.o: $(DECODER_SRCDIR)/%.cpp
+$(DECODER_SRCDIR)/%.$(OBJ): $(DECODER_SRCDIR)/%.cpp
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c $(CXX_O) $<
-$(DECODER_SRCDIR)/%.o: $(DECODER_SRCDIR)/%.asm
+$(DECODER_SRCDIR)/%.$(OBJ): $(DECODER_SRCDIR)/%.asm
$(QUIET_ASM)$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(DECODER_ASMFLAGS) $(DECODER_ASM_INCLUDES) -o $@ $<
-$(DECODER_SRCDIR)/%.o: $(DECODER_SRCDIR)/%.S
+$(DECODER_SRCDIR)/%.$(OBJ): $(DECODER_SRCDIR)/%.S
$(QUIET_CCAS)$(CCAS) $(CFLAGS) $(ASMFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $@ $<
$(LIBPREFIX)decoder.$(LIBSUFFIX): $(DECODER_OBJS)
--- a/codec/encoder/targets.mk
+++ b/codec/encoder/targets.mk
@@ -33,7 +33,7 @@
$(ENCODER_SRCDIR)/plus/src/welsCodecTrace.cpp\
$(ENCODER_SRCDIR)/plus/src/welsEncoderExt.cpp\
-ENCODER_OBJS += $(ENCODER_CPP_SRCS:.cpp=.o)
+ENCODER_OBJS += $(ENCODER_CPP_SRCS:.cpp=.$(OBJ))
ifeq ($(ASM_ARCH), x86)
ENCODER_ASM_SRCS=\
@@ -44,7 +44,7 @@
$(ENCODER_SRCDIR)/core/asm/quant.asm\
$(ENCODER_SRCDIR)/core/asm/score.asm\
-ENCODER_OBJS += $(ENCODER_ASM_SRCS:.asm=.o)
+ENCODER_OBJS += $(ENCODER_ASM_SRCS:.asm=.$(OBJ))
endif
ifeq ($(ASM_ARCH), arm)
@@ -55,17 +55,17 @@
$(ENCODER_SRCDIR)/core/arm/pixel_neon.S\
$(ENCODER_SRCDIR)/core/arm/reconstruct_neon.S\
-ENCODER_OBJS += $(ENCODER_ASM_S_SRCS:.S=.o)
+ENCODER_OBJS += $(ENCODER_ASM_S_SRCS:.S=.$(OBJ))
endif
OBJS += $(ENCODER_OBJS)
-$(ENCODER_SRCDIR)/%.o: $(ENCODER_SRCDIR)/%.cpp
+$(ENCODER_SRCDIR)/%.$(OBJ): $(ENCODER_SRCDIR)/%.cpp
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c $(CXX_O) $<
-$(ENCODER_SRCDIR)/%.o: $(ENCODER_SRCDIR)/%.asm
+$(ENCODER_SRCDIR)/%.$(OBJ): $(ENCODER_SRCDIR)/%.asm
$(QUIET_ASM)$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(ENCODER_ASMFLAGS) $(ENCODER_ASM_INCLUDES) -o $@ $<
-$(ENCODER_SRCDIR)/%.o: $(ENCODER_SRCDIR)/%.S
+$(ENCODER_SRCDIR)/%.$(OBJ): $(ENCODER_SRCDIR)/%.S
$(QUIET_CCAS)$(CCAS) $(CFLAGS) $(ASMFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $@ $<
$(LIBPREFIX)encoder.$(LIBSUFFIX): $(ENCODER_OBJS)
--- a/codec/processing/targets.mk
+++ b/codec/processing/targets.mk
@@ -17,7 +17,7 @@
$(PROCESSING_SRCDIR)/src/vaacalc/vaacalcfuncs.cpp\
$(PROCESSING_SRCDIR)/src/vaacalc/vaacalculation.cpp\
-PROCESSING_OBJS += $(PROCESSING_CPP_SRCS:.cpp=.o)
+PROCESSING_OBJS += $(PROCESSING_CPP_SRCS:.cpp=.$(OBJ))
ifeq ($(ASM_ARCH), x86)
PROCESSING_ASM_SRCS=\
@@ -25,7 +25,7 @@
$(PROCESSING_SRCDIR)/src/asm/downsample_bilinear.asm\
$(PROCESSING_SRCDIR)/src/asm/vaa.asm\
-PROCESSING_OBJS += $(PROCESSING_ASM_SRCS:.asm=.o)
+PROCESSING_OBJS += $(PROCESSING_ASM_SRCS:.asm=.$(OBJ))
endif
ifeq ($(ASM_ARCH), arm)
@@ -35,17 +35,17 @@
$(PROCESSING_SRCDIR)/src/arm/pixel_sad_neon.S\
$(PROCESSING_SRCDIR)/src/arm/vaa_calc_neon.S\
-PROCESSING_OBJS += $(PROCESSING_ASM_S_SRCS:.S=.o)
+PROCESSING_OBJS += $(PROCESSING_ASM_S_SRCS:.S=.$(OBJ))
endif
OBJS += $(PROCESSING_OBJS)
-$(PROCESSING_SRCDIR)/%.o: $(PROCESSING_SRCDIR)/%.cpp
+$(PROCESSING_SRCDIR)/%.$(OBJ): $(PROCESSING_SRCDIR)/%.cpp
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c $(CXX_O) $<
-$(PROCESSING_SRCDIR)/%.o: $(PROCESSING_SRCDIR)/%.asm
+$(PROCESSING_SRCDIR)/%.$(OBJ): $(PROCESSING_SRCDIR)/%.asm
$(QUIET_ASM)$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(PROCESSING_ASMFLAGS) $(PROCESSING_ASM_INCLUDES) -o $@ $<
-$(PROCESSING_SRCDIR)/%.o: $(PROCESSING_SRCDIR)/%.S
+$(PROCESSING_SRCDIR)/%.$(OBJ): $(PROCESSING_SRCDIR)/%.S
$(QUIET_CCAS)$(CCAS) $(CFLAGS) $(ASMFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $@ $<
$(LIBPREFIX)processing.$(LIBSUFFIX): $(PROCESSING_OBJS)
--- a/test/targets.mk
+++ b/test/targets.mk
@@ -13,19 +13,19 @@
$(CODEC_UNITTEST_SRCDIR)/EncUT_MotionEstimate.cpp\
$(CODEC_UNITTEST_SRCDIR)/simple_test.cpp\
-CODEC_UNITTEST_OBJS += $(CODEC_UNITTEST_CPP_SRCS:.cpp=.o)
+CODEC_UNITTEST_OBJS += $(CODEC_UNITTEST_CPP_SRCS:.cpp=.$(OBJ))
CODEC_UNITTEST_C_SRCS=\
$(CODEC_UNITTEST_SRCDIR)/c_interface_test.c\
$(CODEC_UNITTEST_SRCDIR)/sha1.c\
-CODEC_UNITTEST_OBJS += $(CODEC_UNITTEST_C_SRCS:.c=.o)
+CODEC_UNITTEST_OBJS += $(CODEC_UNITTEST_C_SRCS:.c=.$(OBJ))
OBJS += $(CODEC_UNITTEST_OBJS)
-$(CODEC_UNITTEST_SRCDIR)/%.o: $(CODEC_UNITTEST_SRCDIR)/%.cpp
+$(CODEC_UNITTEST_SRCDIR)/%.$(OBJ): $(CODEC_UNITTEST_SRCDIR)/%.cpp
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(CODEC_UNITTEST_CFLAGS) $(CODEC_UNITTEST_INCLUDES) -c $(CXX_O) $<
-$(CODEC_UNITTEST_SRCDIR)/%.o: $(CODEC_UNITTEST_SRCDIR)/%.c
+$(CODEC_UNITTEST_SRCDIR)/%.$(OBJ): $(CODEC_UNITTEST_SRCDIR)/%.c
$(QUIET_CC)$(CC) $(CFLAGS) $(INCLUDES) $(CODEC_UNITTEST_CFLAGS) $(CODEC_UNITTEST_INCLUDES) -c $(CXX_O) $<
codec_unittest$(EXEEXT): $(CODEC_UNITTEST_OBJS) $(LIBS) $(CODEC_UNITTEST_LIBS) $(CODEC_UNITTEST_DEPS)