2012-05-29 19:52:43 +04:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2010-06-09 03:31:28 +04:00
|
|
|
|
2014-10-17 00:39:20 +04:00
|
|
|
# Set up the libvpx assembler config.
|
|
|
|
|
2010-06-09 03:31:28 +04:00
|
|
|
AS=$(VPX_AS)
|
2010-11-08 10:47:17 +03:00
|
|
|
ASFLAGS=$(VPX_ASFLAGS) -I. -I$(topsrcdir)/media/libvpx/ -I$(topsrcdir)/media/libvpx/vpx_ports/
|
|
|
|
AS_DASH_C_FLAG=$(VPX_DASH_C_FLAG)
|
|
|
|
ASM_SUFFIX=$(VPX_ASM_SUFFIX)
|
2010-06-09 03:31:28 +04:00
|
|
|
|
2014-10-17 00:39:20 +04:00
|
|
|
ifeq ($(OS_TARGET),Android)
|
|
|
|
# For LIBVPX_RAND
|
|
|
|
ASFLAGS += -D__ANDROID__
|
|
|
|
endif
|
|
|
|
|
2010-11-08 10:47:17 +03:00
|
|
|
ifdef VPX_ARM_ASM
|
|
|
|
# Building on an ARM platform with a supported assembler, include
|
|
|
|
# the optimized assembly in the build.
|
|
|
|
|
|
|
|
ifeq ($(OS_TARGET),Android)
|
2012-04-30 07:51:44 +04:00
|
|
|
# For cpu-features.h
|
|
|
|
LOCAL_INCLUDES += -I$(ANDROID_NDK)/sources/android/cpufeatures
|
2010-11-08 10:47:17 +03:00
|
|
|
endif
|
|
|
|
|
2013-12-06 17:16:00 +04:00
|
|
|
ASM_OFFSETS = vpx_scale_asm_offsets.asm vp8_asm_enc_offsets.asm
|
2011-10-14 04:37:34 +04:00
|
|
|
|
2013-11-29 18:02:00 +04:00
|
|
|
|
2010-11-08 10:47:17 +03:00
|
|
|
ifdef VPX_AS_CONVERSION
|
|
|
|
# The ARM asm is written in ARM RVCT syntax, but we actually build it with
|
|
|
|
# gas using GNU syntax. Add some rules to perform the conversion.
|
|
|
|
|
2013-11-29 18:02:00 +04:00
|
|
|
GENERATED_DIRS += $(dir $(ASFILES))
|
2010-11-08 10:47:17 +03:00
|
|
|
|
2013-11-29 18:02:00 +04:00
|
|
|
%.asm.$(ASM_SUFFIX): %.asm $(ASM_OFFSETS)
|
2010-11-08 10:47:17 +03:00
|
|
|
$(VPX_AS_CONVERSION) < $< > $@
|
|
|
|
|
2012-04-30 07:51:44 +04:00
|
|
|
endif
|
2010-11-08 10:47:17 +03:00
|
|
|
endif
|
|
|
|
|
2011-10-14 04:37:34 +04:00
|
|
|
ifdef VPX_NEED_OBJ_INT_EXTRACT
|
|
|
|
|
|
|
|
# We don't have a compiler that supports a compatible inline asm syntax, so we
|
|
|
|
# have to resort to extracting asm offsets from a compiled object. This only
|
|
|
|
# works if we have the appropriate system headers obj_int_extract needs to
|
|
|
|
# parse that format, and so only has limited support for cross-compilation.
|
|
|
|
|
|
|
|
ifdef VPX_ARM_ASM
|
|
|
|
VPX_OIE_FORMAT := rvds
|
|
|
|
else
|
|
|
|
VPX_OIE_FORMAT := gas
|
|
|
|
endif
|
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
GARBAGE += vpx_scale_asm_offsets.$(OBJ_SUFFIX) vpx_scale_asm_offsets.asm
|
|
|
|
GARBAGE += vp8_asm_enc_offsets.$(OBJ_SUFFIX) vp8_asm_enc_offsets.asm
|
2011-10-14 04:37:34 +04:00
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
# We can extract the asm offsets directly from generated assembly using inline
|
2014-01-18 04:21:44 +04:00
|
|
|
# asm. This is the preferred method. However we need to strip out CFLAGS that
|
|
|
|
# cause LTO because then the resulting .S file is useless.
|
2011-10-14 04:37:34 +04:00
|
|
|
|
2014-01-18 04:21:44 +04:00
|
|
|
vpx_scale_asm_offsets.s: CFLAGS := -DINLINE_ASM
|
2012-04-30 07:51:44 +04:00
|
|
|
|
|
|
|
OFFSET_PATTERN := '^[a-zA-Z0-9_]* EQU'
|
2011-10-14 04:37:34 +04:00
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
# This rule, as well as the rule for vp8_asm_enc_offsets.s further below are here
|
2013-08-20 10:21:35 +04:00
|
|
|
# because the generic rule in rules.mk was made to not be implicit, and we
|
|
|
|
# can't put the C files in CSRCS.
|
2013-12-06 15:19:00 +04:00
|
|
|
vpx_scale_asm_offsets.s: $(srcdir)/vpx_scale/vpx_scale_asm_offsets.c
|
2013-08-20 10:21:35 +04:00
|
|
|
$(REPORT_BUILD)
|
|
|
|
$(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
vpx_scale_asm_offsets.asm: vpx_scale_asm_offsets.s
|
2012-04-30 07:51:44 +04:00
|
|
|
grep $(OFFSET_PATTERN) $< | sed -e 's/[$$\#]//g' \
|
2011-10-14 04:37:34 +04:00
|
|
|
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
|
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
GARBAGE += vpx_scale_asm_offsets.s vpx_scale_asm_offsets.asm
|
2012-04-30 07:51:44 +04:00
|
|
|
|
2014-01-18 04:21:44 +04:00
|
|
|
vp8_asm_enc_offsets.s: CFLAGS := -DINLINE_ASM
|
2012-04-30 07:51:44 +04:00
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
vp8_asm_enc_offsets.s: $(srcdir)/vp8/encoder/vp8_asm_enc_offsets.c
|
2013-08-20 10:21:35 +04:00
|
|
|
$(REPORT_BUILD)
|
2014-07-11 11:55:27 +04:00
|
|
|
$(CC) -S $(COMPILE_CFLAGS) $(NO_INTEGRATED_AS_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
2013-08-20 10:21:35 +04:00
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
vp8_asm_enc_offsets.asm: vp8_asm_enc_offsets.s
|
2012-04-30 07:51:44 +04:00
|
|
|
grep $(OFFSET_PATTERN) $< | sed -e 's/[$$\#]//g' \
|
2011-10-14 04:37:34 +04:00
|
|
|
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
|
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
GARBAGE += vp8_asm_enc_offsets.s vp8_asm_enc_offsets.asm
|
2011-10-14 04:37:34 +04:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
EXTRA_MDDEPEND_FILES = vp8_asm_enc_offsets.s.pp vp8_asm_enc_offsets.$(OBJ_SUFFIX).pp vpx_scale_asm_offsets.s.pp vpx_scale_asm_offsets.$(OBJ_SUFFIX).pp
|
2012-08-29 10:55:58 +04:00
|
|
|
|
2010-06-09 03:31:28 +04:00
|
|
|
include $(topsrcdir)/config/rules.mk
|
2010-08-06 11:03:02 +04:00
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
quantize_sse4.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm
|
|
|
|
quantize_ssse3.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm
|
2013-11-29 18:02:00 +04:00
|
|
|
|
2011-10-14 04:37:34 +04:00
|
|
|
ifdef VPX_NEED_OBJ_INT_EXTRACT
|
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
vpx_scale_asm_offsets.asm: vpx_scale_asm_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
|
2011-10-14 04:37:34 +04:00
|
|
|
./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \
|
|
|
|
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
|
|
|
|
|
2012-05-23 06:51:19 +04:00
|
|
|
# Filter out this object, because we don't want to link against it.
|
|
|
|
# It was generated solely so it could be parsed by obj_int_extract.
|
2013-12-06 15:19:00 +04:00
|
|
|
OBJS := $(filter-out vpx_scale_asm_offsets.$(OBJ_SUFFIX),$(OBJS))
|
2012-05-23 06:51:19 +04:00
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
vp8_asm_enc_offsets.asm: vp8_asm_enc_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
|
2011-10-14 04:37:34 +04:00
|
|
|
./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \
|
|
|
|
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
|
|
|
|
|
2012-05-23 06:51:19 +04:00
|
|
|
# Filter out this object, because we don't want to link against it.
|
|
|
|
# It was generated solely so it could be parsed by obj_int_extract.
|
2013-12-06 15:19:00 +04:00
|
|
|
OBJS := $(filter-out vp8_asm_enc_offsets.$(OBJ_SUFFIX),$(OBJS))
|
2012-05-23 06:51:19 +04:00
|
|
|
|
2012-04-30 07:51:44 +04:00
|
|
|
endif
|
2011-10-14 04:37:34 +04:00
|
|
|
|
2010-08-06 11:03:02 +04:00
|
|
|
# Workaround a bug of Sun Studio (CR 6963410)
|
|
|
|
ifdef SOLARIS_SUNPRO_CC
|
|
|
|
ifeq (86,$(findstring 86,$(OS_TEST)))
|
2011-10-14 04:37:34 +04:00
|
|
|
filter.o: filter.c Makefile.in
|
2011-12-08 22:14:06 +04:00
|
|
|
$(REPORT_BUILD)
|
2010-08-06 11:03:02 +04:00
|
|
|
@$(MAKE_DEPS_AUTO_CC)
|
|
|
|
$(CC) -o $@ -c $(patsubst -xO[45],-xO3,$(COMPILE_CFLAGS)) $<
|
|
|
|
endif
|
|
|
|
endif
|