Skip to content

Commit

Permalink
Android make files clean-up + refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Brazhkin <[email protected]>
  • Loading branch information
dmitrybrazhkin authored and Oleg Nabiullin committed May 30, 2018
1 parent 47d7bdc commit a94fff7
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 102 deletions.
10 changes: 5 additions & 5 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ifneq ($(BOARD_HAVE_MEDIASDK_SRC),true)
ifeq ($(BOARD_HAVE_MEDIASDK_OPEN_SOURCE),true)
MFX_HOME:= $(call my-dir)
ifeq ($(BOARD_HAVE_MEDIASDK_OPEN_SOURCE),true)
MFX_HOME:= $(call my-dir)

# Recursively call sub-folder Android.mk
include $(call all-subdir-makefiles)
endif
# Recursively call sub-folder Android.mk
include $(call all-subdir-makefiles)
endif
endif
10 changes: 5 additions & 5 deletions _studio/hevce_hw/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MFX_LOCAL_SRC_FILES := $(addprefix h265/src/, \
mfx_h265_encode_hw_utils.cpp \
mfx_h265_encode_vaapi.cpp)

MFX_LOCAL_C_INCLUDES := \
MFX_LOCAL_INCLUDES := \
$(LOCAL_PATH)/h265/include \
$(MFX_HOME)/_studio/shared/umc/codec/brc/include

Expand All @@ -32,8 +32,8 @@ include $(MFX_HOME)/android/mfx_defs.mk
LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES) \
$(MFX_C_INCLUDES_INTERNAL_HW)
$(MFX_LOCAL_INCLUDES) \
$(MFX_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := \
$(MFX_CFLAGS_INTERNAL) \
Expand Down Expand Up @@ -62,8 +62,8 @@ include $(MFX_HOME)/android/mfx_defs.mk
LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES) \
$(MFX_C_INCLUDES_INTERNAL_HW)
$(MFX_LOCAL_INCLUDES) \
$(MFX_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := \
$(MFX_CFLAGS_INTERNAL) \
Expand Down
46 changes: 22 additions & 24 deletions _studio/mfx_lib/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ MFX_LOCAL_SRC_FILES_HW := \
$(MFX_LOCAL_SRC_FILES_IMPL) \
$(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/src/*.cpp)))

MFX_LOCAL_C_INCLUDES := \
MFX_LOCAL_INCLUDES := \
$(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include))

MFX_LOCAL_C_INCLUDES_IMPL := \
$(MFX_LOCAL_C_INCLUDES) \
MFX_LOCAL_INCLUDES_IMPL := \
$(MFX_LOCAL_INCLUDES) \
$(foreach dir, $(MFX_LOCAL_DIRS_IMPL), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include))

MFX_LOCAL_C_INCLUDES_HW := \
$(MFX_LOCAL_C_INCLUDES_IMPL) \
MFX_LOCAL_INCLUDES_HW := \
$(MFX_LOCAL_INCLUDES_IMPL) \
$(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include)) \
$(MFX_HOME)/_studio/mfx_lib/genx/field_copy/include \
$(MFX_HOME)/_studio/mfx_lib/genx/copy_kernels/include \
Expand All @@ -55,7 +55,7 @@ MFX_LOCAL_STATIC_LIBRARIES_HW := \
libasc \
libsafec

MFX_LOCAL_LDFLAGS_HW += \
MFX_LOCAL_LDFLAGS_HW := \
$(MFX_LDFLAGS) \
-Wl,--version-script=$(LOCAL_PATH)/mfx_lib/libmfx.map

Expand All @@ -69,15 +69,15 @@ UMC_DIRS_IMPL := \
h265_dec h264_dec mpeg2_dec vc1_dec jpeg_dec vp9_dec \
vc1_common jpeg_common

UMC_LOCAL_C_INCLUDES := \
UMC_LOCAL_INCLUDES := \
$(foreach dir, $(UMC_DIRS), $(wildcard $(MFX_HOME)/_studio/shared/umc/codec/$(dir)/include))

UMC_LOCAL_C_INCLUDES_IMPL := \
$(UMC_LOCAL_C_INCLUDES) \
UMC_LOCAL_INCLUDES_IMPL := \
$(UMC_LOCAL_INCLUDES) \
$(foreach dir, $(UMC_DIRS_IMPL), $(wildcard $(MFX_HOME)/_studio/shared/umc/codec/$(dir)/include))

UMC_LOCAL_C_INCLUDES_HW := \
$(UMC_LOCAL_C_INCLUDES_IMPL)
UMC_LOCAL_INCLUDES_HW := \
$(UMC_LOCAL_INCLUDES_IMPL)

# =============================================================================

Expand Down Expand Up @@ -150,9 +150,9 @@ LOCAL_SRC_FILES := \
$(MFX_SHARED_FILES_HW)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES_HW) \
$(UMC_LOCAL_C_INCLUDES_HW) \
$(MFX_C_INCLUDES_INTERNAL_HW)
$(MFX_LOCAL_INCLUDES_HW) \
$(UMC_LOCAL_INCLUDES_HW) \
$(MFX_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32)
Expand All @@ -171,17 +171,16 @@ include $(MFX_HOME)/android/mfx_defs.mk
LOCAL_SRC_FILES := $(MFX_LIB_SHARED_FILES_1) $(MFX_LIB_SHARED_FILES_2)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES_HW) \
$(UMC_LOCAL_C_INCLUDES_HW) \
$(MFX_C_INCLUDES_INTERNAL_HW)
$(MFX_LOCAL_INCLUDES_HW) \
$(UMC_LOCAL_INCLUDES_HW) \
$(MFX_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32)

LOCAL_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW)

LOCAL_LDFLAGS := $(MFX_LOCAL_LDFLAGS_HW)

LOCAL_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW)
LOCAL_SHARED_LIBRARIES := libva

LOCAL_MODULE_TAGS := optional
Expand All @@ -199,17 +198,16 @@ include $(MFX_HOME)/android/mfx_defs.mk
LOCAL_SRC_FILES := $(MFX_LIB_SHARED_FILES_1) $(MFX_LIB_SHARED_FILES_2)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES_HW) \
$(UMC_LOCAL_C_INCLUDES_HW) \
$(MFX_C_INCLUDES_INTERNAL_HW)
$(MFX_LOCAL_INCLUDES_HW) \
$(UMC_LOCAL_INCLUDES_HW) \
$(MFX_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64)

LOCAL_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW)

LOCAL_LDFLAGS := $(MFX_LOCAL_LDFLAGS_HW)

LOCAL_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW)
LOCAL_SHARED_LIBRARIES := libva

LOCAL_MODULE_TAGS := optional
Expand Down
2 changes: 1 addition & 1 deletion _studio/shared/asc/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include $(MFX_HOME)/android/mfx_defs.mk
LOCAL_SRC_FILES := $(addprefix src/, $(notdir $(wildcard $(LOCAL_PATH)/src/*.cpp)))

LOCAL_C_INCLUDES := \
$(MFX_C_INCLUDES_INTERNAL_HW) \
$(MFX_INCLUDES_INTERNAL_HW) \
$(MFX_HOME)/_studio/mfx_lib/cmrt_cross_platform/include

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
Expand Down
2 changes: 1 addition & 1 deletion _studio/shared/mfx_trace/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include $(MFX_HOME)/android/mfx_defs.mk
LOCAL_SRC_FILES := $(addprefix src/, $(notdir $(wildcard $(LOCAL_PATH)/src/*.cpp)))

LOCAL_C_INCLUDES := \
$(MFX_C_INCLUDES_INTERNAL_HW) \
$(MFX_INCLUDES_INTERNAL_HW) \
$(MFX_HOME)/api/mediasdk_structures

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
Expand Down
18 changes: 9 additions & 9 deletions _studio/shared/umc/codec/Android.mk
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
LOCAL_PATH:= $(call my-dir)

# Setting subdirectories to march thru
MFX_LOCAL_DIRS = \
MFX_LOCAL_DIRS := \
brc \
h264_enc \
vc1_common \
jpeg_common

MFX_LOCAL_DIRS_IMPL = \
MFX_LOCAL_DIRS_IMPL := \
mpeg2_dec \
h265_dec \
h264_dec \
vc1_dec \
jpeg_dec \
vp9_dec

MFX_LOCAL_SRC_FILES = \
MFX_LOCAL_SRC_FILES := \
$(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.cpp)))

MFX_LOCAL_SRC_FILES_IMPL = \
MFX_LOCAL_SRC_FILES_IMPL := \
$(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS_IMPL), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.cpp)))

MFX_LOCAL_C_INCLUDES = \
MFX_LOCAL_INCLUDES := \
$(foreach dir, $(MFX_LOCAL_DIRS) $(MFX_LOCAL_DIRS_IMPL), $(wildcard $(LOCAL_PATH)/$(dir)/include))

# =============================================================================
Expand All @@ -32,8 +32,8 @@ include $(MFX_HOME)/android/mfx_defs.mk
LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES) \
$(MFX_C_INCLUDES_INTERNAL)
$(MFX_LOCAL_INCLUDES) \
$(MFX_INCLUDES_INTERNAL)

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32)
Expand All @@ -52,8 +52,8 @@ include $(MFX_HOME)/android/mfx_defs.mk
LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES_IMPL)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES) \
$(MFX_C_INCLUDES_INTERNAL_HW)
$(MFX_LOCAL_INCLUDES) \
$(MFX_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32)
Expand Down
10 changes: 5 additions & 5 deletions _studio/shared/umc/core/Android.mk
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
LOCAL_PATH:= $(call my-dir)

# Setting subdirectories to march thru
MFX_LOCAL_DIRS = \
MFX_LOCAL_DIRS := \
vm \
vm_plus \
umc

MFX_LOCAL_SRC_FILES = \
MFX_LOCAL_SRC_FILES := \
$(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.c))) \
$(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.cpp)))

MFX_LOCAL_C_INCLUDES = \
MFX_LOCAL_INCLUDES := \
$(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/include))

# =============================================================================
Expand All @@ -21,8 +21,8 @@ include $(MFX_HOME)/android/mfx_defs.mk
LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES) \
$(MFX_C_INCLUDES_INTERNAL_HW)
$(MFX_LOCAL_INCLUDES) \
$(MFX_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32)
Expand Down
10 changes: 5 additions & 5 deletions _studio/shared/umc/io/Android.mk
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
LOCAL_PATH:= $(call my-dir)

MFX_LOCAL_DIRS_HW = \
MFX_LOCAL_DIRS_HW := \
umc_va

MFX_LOCAL_SRC_FILES_HW = \
MFX_LOCAL_SRC_FILES_HW := \
$(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.cpp)))

MFX_LOCAL_C_INCLUDES_HW = \
MFX_LOCAL_INCLUDES_HW := \
$(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/$(dir)/include))

# =============================================================================
Expand All @@ -17,8 +17,8 @@ include $(MFX_HOME)/android/mfx_defs.mk
LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES_HW)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES_HW) \
$(MFX_C_INCLUDES_INTERNAL_HW)
$(MFX_LOCAL_INCLUDES_HW) \
$(MFX_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32)
Expand Down
10 changes: 10 additions & 0 deletions android/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := libmfx_headers
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(MFX_HOME)/api/include \
$(MFX_HOME)/android/include

include $(BUILD_HEADER_LIBRARY)
8 changes: 0 additions & 8 deletions android/build/mfx_android_os.mk

This file was deleted.

7 changes: 0 additions & 7 deletions android/build/mfx_stl.mk

This file was deleted.

32 changes: 15 additions & 17 deletions android/mfx_defs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#
# Defined variables:
# MFX_CFLAGS - common flags for all targets
# MFX_C_INCLUDES - common include paths for all targets
# MFX_INCLUDES - common include paths for all targets
# MFX_INCLUDES_LIBVA - include paths to LibVA headers
# MFX_LDFLAGS - common link flags for all targets

# =============================================================================
Expand All @@ -23,26 +24,29 @@ endif
# Passing Android-dependency information to the code
MFX_CFLAGS += \
-DMFX_ANDROID_VERSION=$(MFX_ANDROID_VERSION) \
-include $(MFX_HOME)/android/include/mfx_config.h
-include mfx_config.h

# Security
MFX_CFLAGS += \
-fstack-protector \
-fPIE -fPIC -pie \
-O2 -D_FORTIFY_SOURCE=2 \
-Wformat -Wformat-security \
-fexceptions -frtti

# Setting usual paths to include files
MFX_C_INCLUDES := \
MFX_INCLUDES := \
$(LOCAL_PATH)/include \
$(MFX_HOME)/api/include \
$(MFX_HOME)/android/include

MFX_INCLUDES_LIBVA := $(TARGET_OUT_HEADERS)/libva

# Setting usual link flags
MFX_LDFLAGS := \
-z noexecstack \
-z relro -z now

# Security
MFX_CFLAGS += \
-fstack-protector \
-fPIE -fPIC -pie \
-O2 -D_FORTIFY_SOURCE=2 \
-Wformat -Wformat-security

# Setting vendor
LOCAL_MODULE_OWNER := intel

Expand All @@ -51,11 +55,5 @@ LOCAL_PROPRIETARY_MODULE := true

# =============================================================================

# Android OS specifics
include $(MFX_HOME)/android/build/mfx_android_os.mk

# STL support definitions
include $(MFX_HOME)/android/build/mfx_stl.mk

# Definitions specific to Media SDK internal things
include $(MFX_HOME)/android/build/mfx_defs_internal.mk
include $(MFX_HOME)/android/mfx_defs_internal.mk
Loading

0 comments on commit a94fff7

Please sign in to comment.