Merge pull request #536 from mstorsjo/obj-suffix

Use .obj as suffix for object files on MSVC
This commit is contained in:
Ethan Hugg 2014-03-18 10:58:12 -07:00
commit baa63ea6a0
13 changed files with 50 additions and 47 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
# Object files
*.o
*.obj
# Dependency files
*.d

View File

@ -13,6 +13,7 @@ BUILDTYPE=Release
V=Yes
PREFIX=/usr/local
SHARED=-shared
OBJ=o
ifeq (,$(wildcard ./gtest))
HAVE_GTEST=No
@ -99,7 +100,7 @@ CODEC_UNITTEST_DEPS = $(LIBPREFIX)gtest.$(LIBSUFFIX) $(LIBPREFIX)decoder.$(LIBSU
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 build/gtest-targets.mk
include test/targets.mk
endif
-include $(OBJS:.o=.d)
-include $(OBJS:.$(OBJ)=.d)

View File

@ -2,10 +2,10 @@ GTEST_SRCDIR=gtest
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)

View File

@ -20,11 +20,11 @@ OUTFILE="targets.mk"
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_cpp_rule_pattern(f):
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_c_rule_pattern(f):
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_rule_pattern(f):
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,14 +118,14 @@ f.write("%s_CPP_SRCS=\\\n"%(PREFIX))
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))
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 @@ if len(asm) > 0:
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 @@ if len(sfiles) > 0:
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)

View File

@ -57,7 +57,7 @@ encdemo: libraries
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) $<

View File

@ -13,6 +13,7 @@ LINK_LIB=$(1).lib
LIBSUFFIX=lib
LIBPREFIX=
EXEEXT=.exe
OBJ=obj
SHAREDLIBSUFFIX=dll
SHARED=-LD
SHLDFLAGS=-link -def:wels.def -implib:wels_dll.lib

View File

@ -6,7 +6,7 @@ COMMON_CPP_SRCS=\
$(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_ASM_SRCS=\
$(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_ASM_S_SRCS=\
$(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)

View File

@ -4,10 +4,10 @@ H264DEC_CPP_SRCS=\
$(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)

View File

@ -3,10 +3,10 @@ H264ENC_CPP_SRCS=\
$(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)

View File

@ -23,7 +23,7 @@ DECODER_CPP_SRCS=\
$(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_ASM_SRCS=\
$(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_ASM_S_SRCS=\
$(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)

View File

@ -33,7 +33,7 @@ ENCODER_CPP_SRCS=\
$(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_ASM_SRCS=\
$(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_ASM_S_SRCS=\
$(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)

View File

@ -17,7 +17,7 @@ PROCESSING_CPP_SRCS=\
$(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_ASM_SRCS=\
$(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_ASM_S_SRCS=\
$(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)

View File

@ -13,19 +13,19 @@ CODEC_UNITTEST_CPP_SRCS=\
$(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)