1ifneq ($(filter $(YOUR_DEVICE_NAME),$(TARGET_DEVICE)),)
2
3
4VNDK_SP_LIBRARIES := ##_VNDK_SP_##
5
6VNDK_SP_EXT_LIBRARIES := ##_VNDK_SP_EXT_##
7
8EXTRA_VENDOR_LIBRARIES := ##_EXTRA_VENDOR_LIBS_##
9
10
11#-------------------------------------------------------------------------------
12# VNDK Modules
13#-------------------------------------------------------------------------------
14LOCAL_PATH := $(call my-dir)
15
16define define-vndk-lib
17include $$(CLEAR_VARS)
18LOCAL_MODULE := $1.$2
19LOCAL_MODULE_CLASS := SHARED_LIBRARIES
20LOCAL_PREBUILT_MODULE_FILE := $$(TARGET_OUT_INTERMEDIATE_LIBRARIES)/$1.so
21LOCAL_STRIP_MODULE := false
22LOCAL_MULTILIB := first
23LOCAL_MODULE_TAGS := optional
24LOCAL_INSTALLED_MODULE_STEM := $1.so
25LOCAL_MODULE_SUFFIX := .so
26LOCAL_MODULE_RELATIVE_PATH := $3
27LOCAL_VENDOR_MODULE := $4
28include $$(BUILD_PREBUILT)
29
30ifneq ($$(TARGET_2ND_ARCH),)
31ifneq ($$(TARGET_TRANSLATE_2ND_ARCH),true)
32include $$(CLEAR_VARS)
33LOCAL_MODULE := $1.$2
34LOCAL_MODULE_CLASS := SHARED_LIBRARIES
35LOCAL_PREBUILT_MODULE_FILE := $$($$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES)/$1.so
36LOCAL_STRIP_MODULE := false
37LOCAL_MULTILIB := 32
38LOCAL_MODULE_TAGS := optional
39LOCAL_INSTALLED_MODULE_STEM := $1.so
40LOCAL_MODULE_SUFFIX := .so
41LOCAL_MODULE_RELATIVE_PATH := $3
42LOCAL_VENDOR_MODULE := $4
43include $$(BUILD_PREBUILT)
44endif  # TARGET_TRANSLATE_2ND_ARCH is not true
45endif  # TARGET_2ND_ARCH is not empty
46endef
47
48$(foreach lib,$(VNDK_SP_LIBRARIES),\
49    $(eval $(call define-vndk-lib,$(lib),vndk-sp-gen,vndk-sp,)))
50$(foreach lib,$(VNDK_SP_EXT_LIBRARIES),\
51    $(eval $(call define-vndk-lib,$(lib),vndk-sp-ext-gen,vndk-sp,true)))
52$(foreach lib,$(EXTRA_VENDOR_LIBRARIES),\
53    $(eval $(call define-vndk-lib,$(lib),vndk-ext-gen,,true)))
54
55
56#-------------------------------------------------------------------------------
57# Phony Package
58#-------------------------------------------------------------------------------
59
60include $(CLEAR_VARS)
61LOCAL_MODULE := $(YOUR_DEVICE_NAME)-vndk
62LOCAL_MODULE_TAGS := optional
63LOCAL_REQUIRED_MODULES := \
64    $(addsuffix .vndk-sp-gen,$(VNDK_SP_LIBRARIES)) \
65    $(addsuffix .vndk-sp-ext-gen,$(VNDK_SP_EXT_LIBRARIES)) \
66    $(addsuffix .vndk-ext-gen,$(EXTRA_VENDOR_LIBRARIES))
67include $(BUILD_PHONY_PACKAGE)
68
69endif  # ifneq ($(filter $(YOUR_DEVICE_NAME),$(TARGET_DEVICE)),)
70