ref: 7d2c7616042923c5f567ac62903c93545d75e000
parent: 59e6ab91cf09876fa5a61ec2138cd85bcf83cb83
author: Martin Storsjö <[email protected]>
date: Tue Feb 25 18:52:36 EST 2014
Allow using the USE_ASM makefile variable for architectures other than x86 Add an ASM_ARCH variable which specifies which kind of assembly is supposed to be built.
--- a/build/mktargets.py
+++ b/build/mktargets.py
@@ -113,11 +113,13 @@
if len(asm) > 0:
f.write("ifeq ($(USE_ASM), Yes)\n")
+ f.write("ifeq ($(ASM_ARCH), x86)\n")
f.write("%s_ASM_SRCS=\\\n"%(PREFIX))
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("endif\n")
f.write("endif\n\n")
f.write("OBJS += $(%s_OBJS)\n"%PREFIX)
--- a/build/platform-android.mk
+++ b/build/platform-android.mk
@@ -23,6 +23,7 @@
USE_ASM = Yes
ifeq (Yes, $(USE_ASM))
ASM = nasm
+ ASM_ARCH = x86
CFLAGS += -DX86_ASM
ASMFLAGS += -DNOPREFIX -f elf32 -DX86_32
endif
--- a/build/platform-x86-common.mk
+++ b/build/platform-x86-common.mk
@@ -16,5 +16,6 @@
endif
ifeq ($(USE_ASM),Yes)
CFLAGS += -DX86_ASM
+ASM_ARCH = x86
endif
ASMFLAGS += $(ASMFLAGS_PLATFORM) -DNO_DYNAMIC_VP
--- a/codec/common/targets.mk
+++ b/codec/common/targets.mk
@@ -9,6 +9,7 @@
COMMON_OBJS += $(COMMON_CPP_SRCS:.cpp=.o)
ifeq ($(USE_ASM), Yes)
+ifeq ($(ASM_ARCH), x86)
COMMON_ASM_SRCS=\
$(COMMON_SRCDIR)/asm_inc.asm\
$(COMMON_SRCDIR)/cpuid.asm\
@@ -21,6 +22,7 @@
$(COMMON_SRCDIR)/vaa.asm\
COMMON_OBJS += $(COMMON_ASM_SRCS:.asm=.o)
+endif
endif
OBJS += $(COMMON_OBJS)
--- a/codec/decoder/targets.mk
+++ b/codec/decoder/targets.mk
@@ -26,6 +26,7 @@
DECODER_OBJS += $(DECODER_CPP_SRCS:.cpp=.o)
ifeq ($(USE_ASM), Yes)
+ifeq ($(ASM_ARCH), x86)
DECODER_ASM_SRCS=\
$(DECODER_SRCDIR)/core/asm/block_add.asm\
$(DECODER_SRCDIR)/core/asm/dct.asm\
@@ -32,6 +33,7 @@
$(DECODER_SRCDIR)/core/asm/intra_pred.asm\
DECODER_OBJS += $(DECODER_ASM_SRCS:.asm=.o)
+endif
endif
OBJS += $(DECODER_OBJS)
--- a/codec/encoder/targets.mk
+++ b/codec/encoder/targets.mk
@@ -36,6 +36,7 @@
ENCODER_OBJS += $(ENCODER_CPP_SRCS:.cpp=.o)
ifeq ($(USE_ASM), Yes)
+ifeq ($(ASM_ARCH), x86)
ENCODER_ASM_SRCS=\
$(ENCODER_SRCDIR)/core/asm/coeff.asm\
$(ENCODER_SRCDIR)/core/asm/dct.asm\
@@ -45,6 +46,7 @@
$(ENCODER_SRCDIR)/core/asm/score.asm\
ENCODER_OBJS += $(ENCODER_ASM_SRCS:.asm=.o)
+endif
endif
OBJS += $(ENCODER_OBJS)
--- a/codec/processing/targets.mk
+++ b/codec/processing/targets.mk
@@ -21,6 +21,7 @@
PROCESSING_OBJS += $(PROCESSING_CPP_SRCS:.cpp=.o)
ifeq ($(USE_ASM), Yes)
+ifeq ($(ASM_ARCH), x86)
PROCESSING_ASM_SRCS=\
$(PROCESSING_SRCDIR)/src/asm/denoisefilter.asm\
$(PROCESSING_SRCDIR)/src/asm/downsample_bilinear.asm\
@@ -27,6 +28,7 @@
$(PROCESSING_SRCDIR)/src/asm/vaa.asm\
PROCESSING_OBJS += $(PROCESSING_ASM_SRCS:.asm=.o)
+endif
endif
OBJS += $(PROCESSING_OBJS)