2 # Copyright (C) 2013 The Android-x86 Open Source Project
4 # Licensed under the GNU General Public License Version 2 or later.
5 # You may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.gnu.org/licenses/gpl.html
12 FFDROID_DIR := $(call my-dir)
16 include $(FFDROID_DIR)/ffmpeg.mk
18 FFMPEG_ARCH_DIR := $(FFMPEG_ARCH)
19 ifeq ($(FFMPEG_ARCH),x86_64)
20 FFMPEG_ARCH_DIR := x86
23 $(foreach V,$(FF_VARS),$(eval $(call RESET,$(V))))
24 #$(warning INCLUDING $(wildcard $(LOCAL_PATH)/$(FFMPEG_ARCH)/Makefile) for $(FFMPEG_2ND_ARCH) - $(NEON-OBJS) - $(FF_VARS))
26 SUBDIR := $(FFDROID_DIR)/include/
27 include $(FFDROID_DIR)/config.mak
28 include $(LOCAL_PATH)/Makefile $(wildcard $(LOCAL_PATH)/$(FFMPEG_ARCH_DIR)/Makefile)
29 include $(FFMPEG_DIR)ffbuild/arch.mak
31 # remove duplicate objects
32 OBJS := $(sort $(OBJS) $(OBJS-yes))
34 ASM_SUFFIX := $(if $(filter x86,$(FFMPEG_ARCH_DIR)),asm,S)
35 ALL_S_FILES := $(subst $(LOCAL_PATH)/,,$(wildcard $(LOCAL_PATH)/$(FFMPEG_ARCH_DIR)/*.$(ASM_SUFFIX)))
36 ALL_S_FILES := $(if $(filter S,$(ASM_SUFFIX)),$(ALL_S_FILES),$(filter $(patsubst %.o,%.asm,$(YASM-OBJS) $(YASM-OBJS-yes)),$(ALL_S_FILES)))
38 ifneq ($(ALL_S_FILES),)
39 S_OBJS := $(ALL_S_FILES:%.$(ASM_SUFFIX)=%.o)
40 C_OBJS := $(filter-out $(S_OBJS),$(OBJS))
41 S_OBJS := $(filter $(S_OBJS),$(OBJS))
47 C_FILES := $(C_OBJS:%.o=%.c)
48 S_FILES := $(S_OBJS:%.o=%.$(ASM_SUFFIX))
50 LOCAL_MODULE := lib$(NAME)
51 LOCAL_MODULE_TAGS := optional
52 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
55 LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib
56 LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64
58 LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)
61 LOCAL_SRC_FILES := $(C_FILES) $(S_FILES)
64 -O3 -std=c99 -fno-math-errno -fno-signed-zeros -fomit-frame-pointer \
65 -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses \
66 -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -Wno-unused-parameter \
67 -Wno-unknown-attributes -Wno-missing-field-initializers -Wno-sign-compare \
68 -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes \
69 -Werror=return-type -Werror=vla -Wformat -Wno-maybe-uninitialized -fPIC
71 LOCAL_ASFLAGS_x86 := -Pconfig-x86.asm
72 LOCAL_ASFLAGS_x86_64 := -Pconfig-x86_64.asm
74 LOCAL_LDFLAGS := -Wl,--no-fatal-warnings -Wl,-Bsymbolic
76 LOCAL_CLANG_ASFLAGS += $(if $(filter x86,$(FFMPEG_ARCH_DIR)),,-no-integrated-as)
78 LOCAL_SHARED_LIBRARIES := $($(NAME)_FFLIBS:%=lib%)