DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (d8847129d134)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
# 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/.

# Set up the libvpx assembler config.

AS=$(VPX_AS)
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)

ifeq ($(OS_TARGET),Android)
  # For LIBVPX_RAND
  ASFLAGS += -D__ANDROID__
endif

ifdef VPX_ARM_ASM
# Building on an ARM platform with a supported assembler, include
# the optimized assembly in the build.

ifeq ($(OS_TARGET),Android)
# For cpu-features.h
LOCAL_INCLUDES += -I$(ANDROID_NDK)/sources/android/cpufeatures
endif

ASM_OFFSETS = vpx_scale_asm_offsets.asm vp8_asm_enc_offsets.asm


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.

GENERATED_DIRS += $(dir $(ASFILES))

%.asm.$(ASM_SUFFIX): %.asm $(ASM_OFFSETS)
	$(VPX_AS_CONVERSION) < $< > $@

endif
endif

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

GARBAGE += vpx_scale_asm_offsets.$(OBJ_SUFFIX) vpx_scale_asm_offsets.asm
GARBAGE += vp8_asm_enc_offsets.$(OBJ_SUFFIX) vp8_asm_enc_offsets.asm

else

# We can extract the asm offsets directly from generated assembly using inline
# asm. This is the preferred method. However we need to strip out CFLAGS that
# cause LTO because then the resulting .S file is useless.

vpx_scale_asm_offsets.s: CFLAGS := -DINLINE_ASM

OFFSET_PATTERN := '^[a-zA-Z0-9_]* EQU'

# This rule, as well as the rule for vp8_asm_enc_offsets.s further below are here
# because the generic rule in rules.mk was made to not be implicit, and we
# can't put the C files in CSRCS.
vpx_scale_asm_offsets.s: $(srcdir)/vpx_scale/vpx_scale_asm_offsets.c
	$(REPORT_BUILD)
	$(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)

vpx_scale_asm_offsets.asm: vpx_scale_asm_offsets.s
	grep $(OFFSET_PATTERN) $< | sed -e 's/[$$\#]//g' \
	    $(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@

GARBAGE += vpx_scale_asm_offsets.s vpx_scale_asm_offsets.asm

vp8_asm_enc_offsets.s: CFLAGS := -DINLINE_ASM

vp8_asm_enc_offsets.s: $(srcdir)/vp8/encoder/vp8_asm_enc_offsets.c
	$(REPORT_BUILD)
	$(CC) -S $(COMPILE_CFLAGS) $(NO_INTEGRATED_AS_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)

vp8_asm_enc_offsets.asm: vp8_asm_enc_offsets.s
	grep $(OFFSET_PATTERN) $< | sed -e 's/[$$\#]//g' \
	    $(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@

GARBAGE += vp8_asm_enc_offsets.s vp8_asm_enc_offsets.asm

endif

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

include $(topsrcdir)/config/rules.mk

quantize_sse4.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm
quantize_ssse3.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm

ifdef VPX_NEED_OBJ_INT_EXTRACT

vpx_scale_asm_offsets.asm: vpx_scale_asm_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
	./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \
	    $(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@

# 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.
OBJS := $(filter-out vpx_scale_asm_offsets.$(OBJ_SUFFIX),$(OBJS))

vp8_asm_enc_offsets.asm: vp8_asm_enc_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
	./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \
	    $(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@

# 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.
OBJS := $(filter-out vp8_asm_enc_offsets.$(OBJ_SUFFIX),$(OBJS))

endif

# Workaround a bug of Sun Studio (CR 6963410)
ifdef SOLARIS_SUNPRO_CC
ifeq (86,$(findstring 86,$(OS_TEST)))
filter.o: filter.c Makefile.in
	$(REPORT_BUILD)
	@$(MAKE_DEPS_AUTO_CC)
	$(CC) -o $@ -c $(patsubst -xO[45],-xO3,$(COMPILE_CFLAGS)) $<
endif
endif