Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 1 | ########################################################### |
| 2 | ## Standard rules for copying files that are prebuilt |
| 3 | ## |
| 4 | ## Additional inputs from base_rules.make: |
| 5 | ## None. |
| 6 | ## |
| 7 | ########################################################### |
| 8 | |
Chih-Hung Hsieh | 32427d6 | 2018-04-12 10:55:54 -0700 | [diff] [blame] | 9 | include $(BUILD_SYSTEM)/use_lld_setup.mk |
| 10 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 11 | ifneq ($(LOCAL_PREBUILT_LIBS),) |
| 12 | $(error dont use LOCAL_PREBUILT_LIBS anymore LOCAL_PATH=$(LOCAL_PATH)) |
| 13 | endif |
| 14 | ifneq ($(LOCAL_PREBUILT_EXECUTABLES),) |
| 15 | $(error dont use LOCAL_PREBUILT_EXECUTABLES anymore LOCAL_PATH=$(LOCAL_PATH)) |
| 16 | endif |
| 17 | ifneq ($(LOCAL_PREBUILT_JAVA_LIBRARIES),) |
| 18 | $(error dont use LOCAL_PREBUILT_JAVA_LIBRARIES anymore LOCAL_PATH=$(LOCAL_PATH)) |
| 19 | endif |
| 20 | |
Ying Wang | 34d5f1b | 2014-05-16 10:38:43 -0700 | [diff] [blame] | 21 | my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32) |
| 22 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 23 | ifdef LOCAL_PREBUILT_MODULE_FILE |
Ying Wang | c0adfb7 | 2014-02-27 14:10:53 -0800 | [diff] [blame] | 24 | my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE) |
Dan Willemsen | 926ee44 | 2018-02-27 23:27:30 +0000 | [diff] [blame] | 25 | else ifdef LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) |
| 26 | my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) |
| 27 | LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) := |
| 28 | else ifdef LOCAL_SRC_FILES_$(my_32_64_bit_suffix) |
| 29 | my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$(my_32_64_bit_suffix)) |
| 30 | LOCAL_SRC_FILES_$(my_32_64_bit_suffix) := |
| 31 | else ifdef LOCAL_SRC_FILES |
| 32 | my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES) |
| 33 | LOCAL_SRC_FILES := |
| 34 | else ifdef LOCAL_REPLACE_PREBUILT_APK_INSTALLED |
| 35 | # This is handled specially below |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 36 | else |
Dan Willemsen | 926ee44 | 2018-02-27 23:27:30 +0000 | [diff] [blame] | 37 | $(call pretty-error,No source files specified) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 38 | endif |
| 39 | |
Colin Cross | 01e1b8f | 2016-10-27 22:10:55 +0000 | [diff] [blame] | 40 | LOCAL_CHECKED_MODULE := $(my_prebuilt_src_file) |
| 41 | |
Ying Wang | b6eb8dd | 2016-03-01 20:14:52 -0800 | [diff] [blame] | 42 | my_strip_module := $(firstword \ |
| 43 | $(LOCAL_STRIP_MODULE_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) \ |
| 44 | $(LOCAL_STRIP_MODULE)) |
| 45 | my_pack_module_relocations := $(firstword \ |
| 46 | $(LOCAL_PACK_MODULE_RELOCATIONS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) \ |
| 47 | $(LOCAL_PACK_MODULE_RELOCATIONS)) |
| 48 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 49 | ifeq (SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)) |
Dan Albert | 4ac4231 | 2016-07-20 11:02:18 -0700 | [diff] [blame] | 50 | # LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES indicates that this prebuilt should be |
| 51 | # installed to the common directory of libraries. This is needed for the NDK |
| 52 | # shared libraries built by soong, as we build many different versions of each |
| 53 | # library (one for each API level). Since they all have the same basename, |
| 54 | # they'd clobber each other (as well as any platform libraries by the same |
| 55 | # name). |
| 56 | ifneq ($(LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES),false) |
| 57 | # Put the built targets of all shared libraries in a common directory |
| 58 | # to simplify the link line. |
| 59 | OVERRIDE_BUILT_MODULE_PATH := \ |
| 60 | $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATE_LIBRARIES) |
| 61 | endif |
Ying Wang | b6eb8dd | 2016-03-01 20:14:52 -0800 | [diff] [blame] | 62 | ifeq ($(LOCAL_IS_HOST_MODULE)$(my_strip_module),) |
Ying Wang | bfb52a2 | 2014-08-20 17:12:32 -0700 | [diff] [blame] | 63 | # Strip but not try to add debuglink |
Ying Wang | b6eb8dd | 2016-03-01 20:14:52 -0800 | [diff] [blame] | 64 | my_strip_module := no_debuglink |
Ying Wang | bfb52a2 | 2014-08-20 17:12:32 -0700 | [diff] [blame] | 65 | endif |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 66 | |
Ying Wang | b6eb8dd | 2016-03-01 20:14:52 -0800 | [diff] [blame] | 67 | ifeq ($(LOCAL_IS_HOST_MODULE)$(my_pack_module_relocations),) |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 68 | # Do not pack relocations by default |
Ying Wang | b6eb8dd | 2016-03-01 20:14:52 -0800 | [diff] [blame] | 69 | my_pack_module_relocations := false |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 70 | endif |
Dan Albert | 52831d1 | 2015-11-12 15:27:49 -0800 | [diff] [blame] | 71 | |
| 72 | ifeq ($(DISABLE_RELOCATION_PACKER),true) |
Ying Wang | b6eb8dd | 2016-03-01 20:14:52 -0800 | [diff] [blame] | 73 | my_pack_module_relocations := false |
Dan Albert | 52831d1 | 2015-11-12 15:27:49 -0800 | [diff] [blame] | 74 | endif |
Chih-Hung Hsieh | 32427d6 | 2018-04-12 10:55:54 -0700 | [diff] [blame] | 75 | |
| 76 | # Relocation packer does not work with LLD yet. |
Chih-Hung Hsieh | d1caff4 | 2018-04-13 13:15:46 -0700 | [diff] [blame] | 77 | # my_use_clang_lld might be used before being set up in binary.mk |
Chih-Hung Hsieh | 32427d6 | 2018-04-12 10:55:54 -0700 | [diff] [blame] | 78 | ifeq ($(my_use_clang_lld),true) |
| 79 | my_pack_module_relocations := false |
| 80 | endif |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 81 | endif |
| 82 | |
| 83 | ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),) |
| 84 | prebuilt_module_is_a_library := true |
| 85 | else |
| 86 | prebuilt_module_is_a_library := |
| 87 | endif |
| 88 | |
Dan Willemsen | fc92fb2 | 2016-08-26 13:27:13 -0700 | [diff] [blame] | 89 | ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) |
Dan Willemsen | 9d2b328 | 2017-04-07 20:58:43 -0700 | [diff] [blame] | 90 | ifeq ($(prebuilt_module_is_a_library),true) |
| 91 | SOONG_ALREADY_CONV := $(SOONG_ALREADY_CONV) $(LOCAL_MODULE) |
| 92 | endif |
| 93 | |
| 94 | ifdef LOCAL_USE_VNDK |
Jiyong Park | a9c4c71 | 2017-07-18 13:35:27 +0900 | [diff] [blame] | 95 | name_without_suffix := $(patsubst %.vendor,%,$(LOCAL_MODULE)) |
| 96 | ifneq ($(name_without_suffix),$(LOCAL_MODULE) |
| 97 | SPLIT_VENDOR.$(LOCAL_MODULE_CLASS).$(name_without_suffix) := 1 |
| 98 | endif |
| 99 | name_without_suffix := |
Dan Willemsen | 9d2b328 | 2017-04-07 20:58:43 -0700 | [diff] [blame] | 100 | endif |
Dan Willemsen | fc92fb2 | 2016-08-26 13:27:13 -0700 | [diff] [blame] | 101 | endif |
| 102 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 103 | # Don't install static libraries by default. |
| 104 | ifndef LOCAL_UNINSTALLABLE_MODULE |
| 105 | ifeq (STATIC_LIBRARIES,$(LOCAL_MODULE_CLASS)) |
| 106 | LOCAL_UNINSTALLABLE_MODULE := true |
| 107 | endif |
| 108 | endif |
| 109 | |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 110 | ifeq (JAVA_LIBRARIES,$(LOCAL_IS_HOST_MODULE)$(LOCAL_MODULE_CLASS)$(filter true,$(LOCAL_UNINSTALLABLE_MODULE))) |
| 111 | prebuilt_module_is_dex_javalib := true |
| 112 | else |
| 113 | prebuilt_module_is_dex_javalib := |
| 114 | endif |
| 115 | |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 116 | ifdef LOCAL_COMPRESSED_MODULE |
| 117 | ifneq (true,$(LOCAL_COMPRESSED_MODULE)) |
| 118 | $(call pretty-error, Unknown value for LOCAL_COMPRESSED_MODULE $(LOCAL_COMPRESSED_MODULE)) |
Ying Wang | af9757e | 2014-07-17 21:24:42 -0700 | [diff] [blame] | 119 | endif |
Dan Willemsen | dc1ddfc | 2016-08-05 17:23:33 -0700 | [diff] [blame] | 120 | endif |
Ying Wang | af9757e | 2014-07-17 21:24:42 -0700 | [diff] [blame] | 121 | |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 122 | ifeq ($(LOCAL_MODULE_CLASS),APPS) |
| 123 | ifdef LOCAL_COMPRESSED_MODULE |
| 124 | LOCAL_BUILT_MODULE_STEM := package.apk.gz |
| 125 | else |
| 126 | LOCAL_BUILT_MODULE_STEM := package.apk |
| 127 | endif # LOCAL_COMPRESSED_MODULE |
| 128 | |
| 129 | ifndef LOCAL_INSTALLED_MODULE_STEM |
| 130 | ifdef LOCAL_COMPRESSED_MODULE |
Narayan Kamath | 6a4bd69 | 2017-08-14 10:53:50 +0100 | [diff] [blame] | 131 | PACKAGES.$(LOCAL_MODULE).COMPRESSED := gz |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 132 | LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk.gz |
| 133 | else |
| 134 | LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk |
| 135 | endif # LOCAL_COMPRESSED_MODULE |
| 136 | endif # LOCAL_INSTALLED_MODULE_STEM |
| 137 | |
| 138 | else # $(LOCAL_MODULE_CLASS) != APPS) |
| 139 | ifdef LOCAL_COMPRESSED_MODULE |
| 140 | $(error $(LOCAL_MODULE) : LOCAL_COMPRESSED_MODULE can only be defined for module class APPS) |
| 141 | endif # LOCAL_COMPRESSED_MODULE |
| 142 | endif |
| 143 | |
Dan Willemsen | 4598fbc | 2016-07-13 16:08:36 -0700 | [diff] [blame] | 144 | ifneq ($(filter true keep_symbols no_debuglink mini-debug-info,$(my_strip_module) $(my_pack_module_relocations)),) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 145 | ifdef LOCAL_IS_HOST_MODULE |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 146 | $(error Cannot strip/pack host module LOCAL_PATH=$(LOCAL_PATH)) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 147 | endif |
Dan Willemsen | 7fe992c | 2016-03-02 13:54:51 -0800 | [diff] [blame] | 148 | ifeq ($(filter SHARED_LIBRARIES EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),) |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 149 | $(error Can strip/pack only shared libraries or executables LOCAL_PATH=$(LOCAL_PATH)) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 150 | endif |
| 151 | ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),) |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 152 | $(error Cannot strip/pack scripts LOCAL_PATH=$(LOCAL_PATH)) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 153 | endif |
Ying Wang | b6eb8dd | 2016-03-01 20:14:52 -0800 | [diff] [blame] | 154 | # Set the arch-specific variables to set up the strip/pack rules. |
| 155 | LOCAL_STRIP_MODULE_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) := $(my_strip_module) |
| 156 | LOCAL_PACK_MODULE_RELOCATIONS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) := $(my_pack_module_relocations) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 157 | include $(BUILD_SYSTEM)/dynamic_binary.mk |
| 158 | built_module := $(linked_module) |
Ying Wang | bfb52a2 | 2014-08-20 17:12:32 -0700 | [diff] [blame] | 159 | |
Ying Wang | b6eb8dd | 2016-03-01 20:14:52 -0800 | [diff] [blame] | 160 | else # my_strip_module and my_pack_module_relocations not true |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 161 | include $(BUILD_SYSTEM)/base_rules.mk |
| 162 | built_module := $(LOCAL_BUILT_MODULE) |
| 163 | |
| 164 | ifdef prebuilt_module_is_a_library |
| 165 | export_includes := $(intermediates)/export_includes |
Dan Willemsen | 05909fa | 2017-03-19 13:22:45 -0700 | [diff] [blame] | 166 | export_cflags := $(foreach d,$(LOCAL_EXPORT_C_INCLUDE_DIRS),-I $(d)) |
| 167 | # Soong exports cflags instead of include dirs, so that -isystem can be included. |
| 168 | ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) |
| 169 | export_cflags += $(LOCAL_EXPORT_CFLAGS) |
| 170 | else ifdef LOCAL_EXPORT_CFLAGS |
| 171 | $(call pretty-error,LOCAL_EXPORT_CFLAGS can only be used by Soong, use LOCAL_EXPORT_C_INCLUDE_DIRS instead) |
| 172 | endif |
| 173 | $(export_includes): PRIVATE_EXPORT_CFLAGS := $(export_cflags) |
Dan Willemsen | ba6a164 | 2016-09-29 12:08:29 -0700 | [diff] [blame] | 174 | $(export_includes): $(LOCAL_EXPORT_C_INCLUDE_DEPS) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 175 | @echo Export includes file: $< -- $@ |
| 176 | $(hide) mkdir -p $(dir $@) && rm -f $@ |
Dan Willemsen | 05909fa | 2017-03-19 13:22:45 -0700 | [diff] [blame] | 177 | ifdef export_cflags |
| 178 | $(hide) echo "$(PRIVATE_EXPORT_CFLAGS)" >$@ |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 179 | else |
| 180 | $(hide) touch $@ |
| 181 | endif |
Dan Willemsen | 05909fa | 2017-03-19 13:22:45 -0700 | [diff] [blame] | 182 | export_cflags := |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 183 | |
Dan Albert | 975e303 | 2017-12-19 11:26:05 -0800 | [diff] [blame] | 184 | include $(BUILD_SYSTEM)/allowed_ndk_types.mk |
| 185 | |
Dan Willemsen | 9d2b328 | 2017-04-07 20:58:43 -0700 | [diff] [blame] | 186 | ifdef LOCAL_SDK_VERSION |
Dan Albert | 4297c39 | 2017-12-19 11:27:39 -0800 | [diff] [blame] | 187 | my_link_type := native:ndk:$(my_ndk_stl_family):$(my_ndk_stl_link_type) |
Dan Willemsen | 9d2b328 | 2017-04-07 20:58:43 -0700 | [diff] [blame] | 188 | else ifdef LOCAL_USE_VNDK |
Jiyong Park | a3fb158 | 2017-08-16 18:28:12 +0900 | [diff] [blame] | 189 | _name := $(patsubst %.vendor,%,$(LOCAL_MODULE)) |
| 190 | ifneq ($(filter $(_name),$(VNDK_CORE_LIBRARIES) $(VNDK_SAMEPROCESS_LIBRARIES) $(LLNDK_LIBRARIES)),) |
| 191 | ifeq ($(filter $(_name),$(VNDK_PRIVATE_LIBRARIES)),) |
| 192 | my_link_type := native:vndk |
| 193 | else |
| 194 | my_link_type := native:vndk_private |
| 195 | endif |
| 196 | else |
| 197 | my_link_type := native:vendor |
| 198 | endif |
Dan Willemsen | 9d2b328 | 2017-04-07 20:58:43 -0700 | [diff] [blame] | 199 | else |
Dan Willemsen | b47d4e9 | 2017-04-08 00:31:31 -0700 | [diff] [blame] | 200 | my_link_type := native:platform |
Dan Willemsen | 9d2b328 | 2017-04-07 20:58:43 -0700 | [diff] [blame] | 201 | endif |
Dan Willemsen | b097fbe | 2016-06-07 14:25:14 -0700 | [diff] [blame] | 202 | |
Dan Willemsen | b47d4e9 | 2017-04-08 00:31:31 -0700 | [diff] [blame] | 203 | # TODO: check dependencies of prebuilt files |
| 204 | my_link_deps := |
| 205 | |
| 206 | my_2nd_arch_prefix := $(LOCAL_2ND_ARCH_VAR_PREFIX) |
| 207 | my_common := |
| 208 | include $(BUILD_SYSTEM)/link_type.mk |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 209 | endif # prebuilt_module_is_a_library |
| 210 | |
| 211 | # The real dependency will be added after all Android.mks are loaded and the install paths |
| 212 | # of the shared libraries are determined. |
| 213 | ifdef LOCAL_INSTALLED_MODULE |
| 214 | ifdef LOCAL_SHARED_LIBRARIES |
Ying Wang | 7c87739 | 2014-10-07 13:03:29 -0700 | [diff] [blame] | 215 | my_shared_libraries := $(LOCAL_SHARED_LIBRARIES) |
| 216 | # Extra shared libraries introduced by LOCAL_CXX_STL. |
| 217 | include $(BUILD_SYSTEM)/cxx_stl_setup.mk |
Dan Willemsen | 9d2b328 | 2017-04-07 20:58:43 -0700 | [diff] [blame] | 218 | ifdef LOCAL_USE_VNDK |
Jiyong Park | a9c4c71 | 2017-07-18 13:35:27 +0900 | [diff] [blame] | 219 | ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) |
Dan Willemsen | 9d2b328 | 2017-04-07 20:58:43 -0700 | [diff] [blame] | 220 | my_shared_libraries := $(foreach l,$(my_shared_libraries),\ |
| 221 | $(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l))) |
| 222 | endif |
| 223 | endif |
Ying Wang | 58f462f | 2014-02-25 18:26:29 -0800 | [diff] [blame] | 224 | $(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)DEPENDENCIES_ON_SHARED_LIBRARIES += \ |
Ying Wang | 7c87739 | 2014-10-07 13:03:29 -0700 | [diff] [blame] | 225 | $(my_register_name):$(LOCAL_INSTALLED_MODULE):$(subst $(space),$(comma),$(my_shared_libraries)) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 226 | |
| 227 | # We also need the LOCAL_BUILT_MODULE dependency, |
| 228 | # since we use -rpath-link which points to the built module's path. |
Ying Wang | 7c87739 | 2014-10-07 13:03:29 -0700 | [diff] [blame] | 229 | my_built_shared_libraries := \ |
Ying Wang | 58f462f | 2014-02-25 18:26:29 -0800 | [diff] [blame] | 230 | $(addprefix $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \ |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 231 | $(addsuffix $($(my_prefix)SHLIB_SUFFIX), \ |
Ying Wang | 7c87739 | 2014-10-07 13:03:29 -0700 | [diff] [blame] | 232 | $(my_shared_libraries))) |
| 233 | $(LOCAL_BUILT_MODULE) : $(my_built_shared_libraries) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 234 | endif |
| 235 | endif |
| 236 | |
Ying Wang | 7c87739 | 2014-10-07 13:03:29 -0700 | [diff] [blame] | 237 | # We need to enclose the above export_includes and my_built_shared_libraries in |
Ying Wang | b6eb8dd | 2016-03-01 20:14:52 -0800 | [diff] [blame] | 238 | # "my_strip_module not true" because otherwise the rules are defined in dynamic_binary.mk. |
| 239 | endif # my_strip_module not true |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 240 | |
Dan Willemsen | 9f95665 | 2016-10-21 15:04:12 -0700 | [diff] [blame] | 241 | ifeq ($(NATIVE_COVERAGE),true) |
Dan Willemsen | 0f90908 | 2017-02-10 00:07:17 -0800 | [diff] [blame] | 242 | ifneq (,$(strip $(LOCAL_PREBUILT_COVERAGE_ARCHIVE))) |
| 243 | $(eval $(call copy-one-file,$(LOCAL_PREBUILT_COVERAGE_ARCHIVE),$(intermediates)/$(LOCAL_MODULE).gcnodir)) |
| 244 | ifneq ($(LOCAL_UNINSTALLABLE_MODULE),true) |
| 245 | ifdef LOCAL_IS_HOST_MODULE |
| 246 | my_coverage_path := $($(my_prefix)OUT_COVERAGE)/$(patsubst $($(my_prefix)OUT)/%,%,$(my_module_path)) |
| 247 | else |
| 248 | my_coverage_path := $(TARGET_OUT_COVERAGE)/$(patsubst $(PRODUCT_OUT)/%,%,$(my_module_path)) |
| 249 | endif |
Dan Willemsen | ba9badf | 2017-11-20 12:45:48 -0800 | [diff] [blame] | 250 | my_coverage_path := $(my_coverage_path)/$(patsubst %.so,%,$(my_installed_module_stem)).gcnodir |
Dan Willemsen | 0f90908 | 2017-02-10 00:07:17 -0800 | [diff] [blame] | 251 | $(eval $(call copy-one-file,$(LOCAL_PREBUILT_COVERAGE_ARCHIVE),$(my_coverage_path))) |
| 252 | $(LOCAL_BUILT_MODULE): $(my_coverage_path) |
| 253 | endif |
| 254 | else |
Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 255 | # Coverage information is needed when static lib is a dependency of another |
| 256 | # coverage-enabled module. |
| 257 | ifeq (STATIC_LIBRARIES, $(LOCAL_MODULE_CLASS)) |
| 258 | GCNO_ARCHIVE := $(LOCAL_MODULE).gcnodir |
| 259 | $(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_OBJECTS := |
| 260 | $(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_WHOLE_STATIC_LIBRARIES := |
Dan Willemsen | 9f95665 | 2016-10-21 15:04:12 -0700 | [diff] [blame] | 261 | $(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_PREFIX := $(my_prefix) |
| 262 | $(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX) |
Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 263 | $(intermediates)/$(GCNO_ARCHIVE) : |
| 264 | $(transform-o-to-static-lib) |
| 265 | endif |
Dan Willemsen | 9f95665 | 2016-10-21 15:04:12 -0700 | [diff] [blame] | 266 | endif |
Dan Willemsen | 0f90908 | 2017-02-10 00:07:17 -0800 | [diff] [blame] | 267 | endif |
Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 268 | |
Ying Wang | f0534c2 | 2014-04-15 11:12:21 -0700 | [diff] [blame] | 269 | ifeq ($(LOCAL_MODULE_CLASS),APPS) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 270 | PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES)) |
| 271 | |
Dan Willemsen | 048f56d | 2016-06-18 20:43:51 -0700 | [diff] [blame] | 272 | my_extract_apk := $(strip $(LOCAL_EXTRACT_APK)) |
| 273 | |
Ying Wang | 43f7a32 | 2014-11-17 16:56:04 -0800 | [diff] [blame] | 274 | # Select dpi-specific source |
| 275 | ifdef LOCAL_DPI_VARIANTS |
Ying Wang | 6068658 | 2014-12-10 12:40:09 -0800 | [diff] [blame] | 276 | my_dpi := $(firstword $(filter $(LOCAL_DPI_VARIANTS),$(PRODUCT_AAPT_PREF_CONFIG) $(PRODUCT_AAPT_PREBUILT_DPI))) |
Ying Wang | 43f7a32 | 2014-11-17 16:56:04 -0800 | [diff] [blame] | 277 | ifdef my_dpi |
| 278 | ifdef LOCAL_DPI_FILE_STEM |
| 279 | my_prebuilt_dpi_file_stem := $(LOCAL_DPI_FILE_STEM) |
| 280 | else |
| 281 | my_prebuilt_dpi_file_stem := $(LOCAL_MODULE)_%.apk |
| 282 | endif |
| 283 | my_prebuilt_src_file := $(dir $(my_prebuilt_src_file))$(subst %,$(my_dpi),$(my_prebuilt_dpi_file_stem)) |
Dan Willemsen | 048f56d | 2016-06-18 20:43:51 -0700 | [diff] [blame] | 284 | |
| 285 | ifneq ($(strip $(LOCAL_EXTRACT_DPI_APK)),) |
| 286 | my_extract_apk := $(subst %,$(my_dpi),$(LOCAL_EXTRACT_DPI_APK)) |
| 287 | endif # LOCAL_EXTRACT_DPI_APK |
Ying Wang | 43f7a32 | 2014-11-17 16:56:04 -0800 | [diff] [blame] | 288 | endif # my_dpi |
| 289 | endif # LOCAL_DPI_VARIANTS |
| 290 | |
Dan Willemsen | 048f56d | 2016-06-18 20:43:51 -0700 | [diff] [blame] | 291 | ifdef my_extract_apk |
| 292 | my_extracted_apk := $(intermediates)/extracted.apk |
| 293 | |
| 294 | $(my_extracted_apk): PRIVATE_EXTRACT := $(my_extract_apk) |
| 295 | $(my_extracted_apk): $(my_prebuilt_src_file) |
| 296 | @echo Extract APK: $@ |
| 297 | $(hide) mkdir -p $(dir $@) && rm -f $@ |
| 298 | $(hide) unzip -p $< $(PRIVATE_EXTRACT) >$@ |
| 299 | |
| 300 | my_prebuilt_src_file := $(my_extracted_apk) |
| 301 | my_extracted_apk := |
| 302 | my_extract_apk := |
Mathieu Chartier | 55eabd5 | 2017-09-15 13:40:48 -0700 | [diff] [blame] | 303 | ifeq ($(PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK),true) |
| 304 | # If the product property is set, always preopt for extracted modules to prevent executing out of |
| 305 | # the APK. |
| 306 | my_preopt_for_extracted_apk := true |
| 307 | endif |
Dan Willemsen | 048f56d | 2016-06-18 20:43:51 -0700 | [diff] [blame] | 308 | endif |
| 309 | |
Narayan Kamath | bbcdc07 | 2017-08-22 15:47:08 +0100 | [diff] [blame] | 310 | dex_preopt_profile_src_file := $(my_prebuilt_src_file) |
| 311 | |
Ying Wang | 96bcad4 | 2014-04-17 13:38:04 -0700 | [diff] [blame] | 312 | rs_compatibility_jni_libs := |
| 313 | include $(BUILD_SYSTEM)/install_jni_libs.mk |
| 314 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 315 | ifeq ($(LOCAL_CERTIFICATE),EXTERNAL) |
| 316 | # The magic string "EXTERNAL" means this package will be signed with |
| 317 | # the default dev key throughout the build process, but we expect |
| 318 | # the final package to be signed with a different key. |
| 319 | # |
| 320 | # This can be used for packages where we don't have access to the |
| 321 | # keys, but want the package to be predexopt'ed. |
| 322 | LOCAL_CERTIFICATE := $(DEFAULT_SYSTEM_DEV_CERTIFICATE) |
| 323 | PACKAGES.$(LOCAL_MODULE).EXTERNAL_KEY := 1 |
| 324 | |
Shinichiro Hamaji | 641e61c | 2016-05-13 16:03:24 +0900 | [diff] [blame] | 325 | $(built_module) : $(LOCAL_CERTIFICATE).pk8 $(LOCAL_CERTIFICATE).x509.pem |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 326 | $(built_module) : PRIVATE_PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8 |
| 327 | $(built_module) : PRIVATE_CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem |
| 328 | endif |
| 329 | ifeq ($(LOCAL_CERTIFICATE),) |
Ying Wang | f0534c2 | 2014-04-15 11:12:21 -0700 | [diff] [blame] | 330 | # It is now a build error to add a prebuilt .apk without |
| 331 | # specifying a key for it. |
| 332 | $(error No LOCAL_CERTIFICATE specified for prebuilt "$(my_prebuilt_src_file)") |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 333 | else ifeq ($(LOCAL_CERTIFICATE),PRESIGNED) |
| 334 | # The magic string "PRESIGNED" means this package is already checked |
| 335 | # signed with its release key. |
| 336 | # |
| 337 | # By setting .CERTIFICATE but not .PRIVATE_KEY, this package will be |
| 338 | # mentioned in apkcerts.txt (with certificate set to "PRESIGNED") |
| 339 | # but the dexpreopt process will not try to re-sign the app. |
| 340 | PACKAGES.$(LOCAL_MODULE).CERTIFICATE := PRESIGNED |
| 341 | PACKAGES := $(PACKAGES) $(LOCAL_MODULE) |
| 342 | else |
| 343 | # If this is not an absolute certificate, assign it to a generic one. |
| 344 | ifeq ($(dir $(strip $(LOCAL_CERTIFICATE))),./) |
| 345 | LOCAL_CERTIFICATE := $(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))$(LOCAL_CERTIFICATE) |
| 346 | endif |
| 347 | |
| 348 | PACKAGES.$(LOCAL_MODULE).PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8 |
| 349 | PACKAGES.$(LOCAL_MODULE).CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem |
| 350 | PACKAGES := $(PACKAGES) $(LOCAL_MODULE) |
| 351 | |
Shinichiro Hamaji | 641e61c | 2016-05-13 16:03:24 +0900 | [diff] [blame] | 352 | $(built_module) : $(LOCAL_CERTIFICATE).pk8 $(LOCAL_CERTIFICATE).x509.pem |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 353 | $(built_module) : PRIVATE_PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8 |
| 354 | $(built_module) : PRIVATE_CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem |
| 355 | endif |
| 356 | |
Andreas Gampe | 5e0dbe0 | 2014-10-01 22:01:16 -0700 | [diff] [blame] | 357 | # Disable dex-preopt of prebuilts to save space, if requested. |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 358 | ifndef LOCAL_DEX_PREOPT |
Andreas Gampe | 5e0dbe0 | 2014-10-01 22:01:16 -0700 | [diff] [blame] | 359 | ifeq ($(DONT_DEXPREOPT_PREBUILTS),true) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 360 | LOCAL_DEX_PREOPT := false |
Andreas Gampe | 5e0dbe0 | 2014-10-01 22:01:16 -0700 | [diff] [blame] | 361 | endif |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 362 | endif |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 363 | |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 364 | # If the module is a compressed module, we don't pre-opt it because its final |
| 365 | # installation location will be the data partition. |
| 366 | ifdef LOCAL_COMPRESSED_MODULE |
| 367 | LOCAL_DEX_PREOPT := false |
| 368 | endif |
| 369 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 370 | ####################################### |
| 371 | # defines built_odex along with rule to install odex |
| 372 | include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk |
| 373 | ####################################### |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 374 | ifneq ($(LOCAL_REPLACE_PREBUILT_APK_INSTALLED),) |
| 375 | # There is a replacement for the prebuilt .apk we can install without any processing. |
| 376 | $(built_module) : $(LOCAL_REPLACE_PREBUILT_APK_INSTALLED) |
| 377 | $(transform-prebuilt-to-target) |
Ying Wang | b7d33c0 | 2016-03-15 16:28:57 -0700 | [diff] [blame] | 378 | |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 379 | else # ! LOCAL_REPLACE_PREBUILT_APK_INSTALLED |
| 380 | # Sign and align non-presigned .apks. |
Ying Wang | 1fb0152 | 2015-05-01 14:02:26 -0700 | [diff] [blame] | 381 | # The embedded prebuilt jni to uncompress. |
Ying Wang | 226eb92 | 2015-06-01 19:19:57 -0700 | [diff] [blame] | 382 | ifeq ($(LOCAL_CERTIFICATE),PRESIGNED) |
| 383 | # For PRESIGNED apks we must uncompress every .so file: |
| 384 | # even if the .so file isn't for the current TARGET_ARCH, |
| 385 | # we can't strip the file. |
| 386 | embedded_prebuilt_jni_libs := 'lib/*.so' |
| 387 | endif |
Ying Wang | 1fb0152 | 2015-05-01 14:02:26 -0700 | [diff] [blame] | 388 | ifndef embedded_prebuilt_jni_libs |
| 389 | # No LOCAL_PREBUILT_JNI_LIBS, uncompress all. |
| 390 | embedded_prebuilt_jni_libs := 'lib/*.so' |
| 391 | endif |
| 392 | $(built_module): PRIVATE_EMBEDDED_JNI_LIBS := $(embedded_prebuilt_jni_libs) |
| 393 | |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 394 | ifdef LOCAL_COMPRESSED_MODULE |
| 395 | $(built_module) : $(MINIGZIP) |
| 396 | endif |
| 397 | |
Alex Klyubin | 1b391c0 | 2016-12-15 12:51:25 -0800 | [diff] [blame] | 398 | $(built_module) : $(my_prebuilt_src_file) | $(ZIPALIGN) $(SIGNAPK_JAR) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 399 | $(transform-prebuilt-to-target) |
Ying Wang | 226eb92 | 2015-06-01 19:19:57 -0700 | [diff] [blame] | 400 | $(uncompress-shared-libs) |
Nicolas Geoffray | 3972a47 | 2018-01-09 11:46:30 +0000 | [diff] [blame] | 401 | ifeq (true, $(LOCAL_UNCOMPRESS_DEX)) |
Nicolas Geoffray | b06c30b | 2017-09-19 11:51:45 +0000 | [diff] [blame] | 402 | $(uncompress-dexs) |
Nicolas Geoffray | 3972a47 | 2018-01-09 11:46:30 +0000 | [diff] [blame] | 403 | endif # LOCAL_UNCOMPRESS_DEX |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 404 | ifdef LOCAL_DEX_PREOPT |
| 405 | ifneq ($(BUILD_PLATFORM_ZIP),) |
| 406 | @# Keep a copy of apk with classes.dex unstripped |
| 407 | $(hide) cp -f $@ $(dir $@)package.dex.apk |
| 408 | endif # BUILD_PLATFORM_ZIP |
| 409 | endif # LOCAL_DEX_PREOPT |
Kenny Root | dff3755 | 2015-04-15 12:09:32 -0700 | [diff] [blame] | 410 | ifneq ($(LOCAL_CERTIFICATE),PRESIGNED) |
| 411 | @# Only strip out files if we can re-sign the package. |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 412 | ifdef LOCAL_DEX_PREOPT |
Ying Wang | 36142f6 | 2014-05-21 16:13:33 -0700 | [diff] [blame] | 413 | ifneq (nostripping,$(LOCAL_DEX_PREOPT)) |
| 414 | $(call dexpreopt-remove-classes.dex,$@) |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 415 | endif # LOCAL_DEX_PREOPT != nostripping |
| 416 | endif # LOCAL_DEX_PREOPT |
Kenny Root | dff3755 | 2015-04-15 12:09:32 -0700 | [diff] [blame] | 417 | $(sign-package) |
Alex Klyubin | 5b826ac | 2015-12-04 10:07:41 -0800 | [diff] [blame] | 418 | # No need for align-package because sign-package takes care of alignment |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 419 | else # LOCAL_CERTIFICATE == PRESIGNED |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 420 | $(align-package) |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 421 | endif # LOCAL_CERTIFICATE |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 422 | ifdef LOCAL_COMPRESSED_MODULE |
| 423 | $(compress-package) |
| 424 | endif # LOCAL_COMPRESSED_MODULE |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 425 | endif # ! LOCAL_REPLACE_PREBUILT_APK_INSTALLED |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 426 | |
Ying Wang | 36142f6 | 2014-05-21 16:13:33 -0700 | [diff] [blame] | 427 | ############################### |
Nicolas Geoffray | e3e19f0 | 2018-01-24 14:00:33 +0000 | [diff] [blame] | 428 | ## Rule to build the odex file. |
| 429 | # In case we don't strip the built module, use it, as dexpreopt |
| 430 | # can do optimizations based on whether the built module only |
| 431 | # contains uncompressed dex code. |
Ying Wang | 36142f6 | 2014-05-21 16:13:33 -0700 | [diff] [blame] | 432 | ifdef LOCAL_DEX_PREOPT |
Nicolas Geoffray | e3e19f0 | 2018-01-24 14:00:33 +0000 | [diff] [blame] | 433 | ifeq (nostripping,$(LOCAL_DEX_PREOPT)) |
| 434 | $(built_odex) : $(built_module) |
| 435 | $(call dexpreopt-one-file,$<,$@) |
| 436 | else |
Ying Wang | 36142f6 | 2014-05-21 16:13:33 -0700 | [diff] [blame] | 437 | $(built_odex) : $(my_prebuilt_src_file) |
| 438 | $(call dexpreopt-one-file,$<,$@) |
| 439 | endif |
Nicolas Geoffray | e3e19f0 | 2018-01-24 14:00:33 +0000 | [diff] [blame] | 440 | endif |
Ying Wang | 36142f6 | 2014-05-21 16:13:33 -0700 | [diff] [blame] | 441 | |
Ying Wang | 00fe587 | 2014-07-23 14:35:40 -0700 | [diff] [blame] | 442 | ############################### |
| 443 | ## Install split apks. |
| 444 | ifdef LOCAL_PACKAGE_SPLITS |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 445 | ifdef LOCAL_COMPRESSED_MODULE |
| 446 | $(error $(LOCAL_MODULE): LOCAL_COMPRESSED_MODULE is not currently supported for split installs) |
| 447 | endif # LOCAL_COMPRESSED_MODULE |
| 448 | |
Ying Wang | 00fe587 | 2014-07-23 14:35:40 -0700 | [diff] [blame] | 449 | # LOCAL_PACKAGE_SPLITS is a list of apks to be installed. |
Dan Willemsen | f72308a | 2017-05-15 23:38:04 -0700 | [diff] [blame] | 450 | built_apk_splits := $(addprefix $(intermediates)/,$(notdir $(LOCAL_PACKAGE_SPLITS))) |
Ying Wang | 00fe587 | 2014-07-23 14:35:40 -0700 | [diff] [blame] | 451 | installed_apk_splits := $(addprefix $(my_module_path)/,$(notdir $(LOCAL_PACKAGE_SPLITS))) |
| 452 | |
Alex Klyubin | 5b826ac | 2015-12-04 10:07:41 -0800 | [diff] [blame] | 453 | # Rules to sign the split apks. |
Ying Wang | 00fe587 | 2014-07-23 14:35:40 -0700 | [diff] [blame] | 454 | my_src_dir := $(sort $(dir $(LOCAL_PACKAGE_SPLITS))) |
| 455 | ifneq (1,$(words $(my_src_dir))) |
| 456 | $(error You must put all the split source apks in the same folder: $(LOCAL_PACKAGE_SPLITS)) |
| 457 | endif |
| 458 | my_src_dir := $(LOCAL_PATH)/$(my_src_dir) |
| 459 | |
Shinichiro Hamaji | 641e61c | 2016-05-13 16:03:24 +0900 | [diff] [blame] | 460 | $(built_apk_splits) : $(LOCAL_CERTIFICATE).pk8 $(LOCAL_CERTIFICATE).x509.pem |
Ying Wang | 00fe587 | 2014-07-23 14:35:40 -0700 | [diff] [blame] | 461 | $(built_apk_splits) : PRIVATE_PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8 |
| 462 | $(built_apk_splits) : PRIVATE_CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem |
Dan Willemsen | f72308a | 2017-05-15 23:38:04 -0700 | [diff] [blame] | 463 | $(built_apk_splits) : $(intermediates)/%.apk : $(my_src_dir)/%.apk |
Ying Wang | 00fe587 | 2014-07-23 14:35:40 -0700 | [diff] [blame] | 464 | $(copy-file-to-new-target) |
| 465 | $(sign-package) |
Ying Wang | 00fe587 | 2014-07-23 14:35:40 -0700 | [diff] [blame] | 466 | |
| 467 | # Rules to install the split apks. |
Dan Willemsen | f72308a | 2017-05-15 23:38:04 -0700 | [diff] [blame] | 468 | $(installed_apk_splits) : $(my_module_path)/%.apk : $(intermediates)/%.apk |
Ying Wang | 00fe587 | 2014-07-23 14:35:40 -0700 | [diff] [blame] | 469 | @echo "Install: $@" |
| 470 | $(copy-file-to-new-target) |
| 471 | |
| 472 | # Register the additional built and installed files. |
| 473 | ALL_MODULES.$(my_register_name).INSTALLED += $(installed_apk_splits) |
| 474 | ALL_MODULES.$(my_register_name).BUILT_INSTALLED += \ |
Dan Willemsen | f72308a | 2017-05-15 23:38:04 -0700 | [diff] [blame] | 475 | $(foreach s,$(LOCAL_PACKAGE_SPLITS),$(intermediates)/$(notdir $(s)):$(my_module_path)/$(notdir $(s))) |
Ying Wang | 00fe587 | 2014-07-23 14:35:40 -0700 | [diff] [blame] | 476 | |
| 477 | # Make sure to install the splits when you run "make <module_name>". |
Colin Cross | 3388670 | 2016-09-20 16:01:28 -0700 | [diff] [blame] | 478 | $(my_all_targets): $(installed_apk_splits) |
Ying Wang | 00fe587 | 2014-07-23 14:35:40 -0700 | [diff] [blame] | 479 | |
| 480 | endif # LOCAL_PACKAGE_SPLITS |
| 481 | |
Ying Wang | da36635 | 2016-03-15 17:05:52 -0700 | [diff] [blame] | 482 | else ifeq ($(prebuilt_module_is_dex_javalib),true) # ! LOCAL_MODULE_CLASS != APPS |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 483 | # This is a target shared library, i.e. a jar with classes.dex. |
| 484 | ####################################### |
| 485 | # defines built_odex along with rule to install odex |
| 486 | include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk |
| 487 | ####################################### |
| 488 | ifdef LOCAL_DEX_PREOPT |
| 489 | ifneq ($(dexpreopt_boot_jar_module),) # boot jar |
| 490 | # boot jar's rules are defined in dex_preopt.mk |
| 491 | dexpreopted_boot_jar := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/$(dexpreopt_boot_jar_module)_nodex.jar |
| 492 | $(built_module) : $(dexpreopted_boot_jar) |
| 493 | $(call copy-file-to-target) |
Dan Willemsen | 08420cb | 2016-03-01 22:04:57 -0800 | [diff] [blame] | 494 | |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 495 | # For libart boot jars, we don't have .odex files. |
| 496 | else # ! boot jar |
| 497 | $(built_odex): PRIVATE_MODULE := $(LOCAL_MODULE) |
| 498 | # Use pattern rule - we may have multiple built odex files. |
| 499 | $(built_odex) : $(dir $(LOCAL_BUILT_MODULE))% : $(my_prebuilt_src_file) |
| 500 | @echo "Dexpreopt Jar: $(PRIVATE_MODULE) ($@)" |
| 501 | $(call dexpreopt-one-file,$<,$@) |
| 502 | |
Colin Cross | ea1629e | 2017-10-06 13:55:48 -0700 | [diff] [blame] | 503 | $(eval $(call dexpreopt-copy-jar,$(my_prebuilt_src_file),$(built_module),$(LOCAL_DEX_PREOPT))) |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 504 | endif # boot jar |
| 505 | else # ! LOCAL_DEX_PREOPT |
| 506 | $(built_module) : $(my_prebuilt_src_file) |
| 507 | $(call copy-file-to-target) |
| 508 | endif # LOCAL_DEX_PREOPT |
| 509 | |
| 510 | else # ! prebuilt_module_is_dex_javalib |
Tom Cherry | 03303f9 | 2018-06-13 14:51:05 -0700 | [diff] [blame] | 511 | ifneq ($(filter init%rc,$(notdir $(LOCAL_INSTALLED_MODULE)))$(filter %/etc/init,$(dir $(LOCAL_INSTALLED_MODULE))),) |
| 512 | $(eval $(call copy-init-script-file-checked,$(my_prebuilt_src_file),$(built_module))) |
| 513 | else ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 514 | $(built_module) : $(my_prebuilt_src_file) |
| 515 | $(transform-prebuilt-to-target-strip-comments) |
| 516 | else |
Tom Cherry | 03303f9 | 2018-06-13 14:51:05 -0700 | [diff] [blame] | 517 | $(built_module) : $(my_prebuilt_src_file) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 518 | $(transform-prebuilt-to-target) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 519 | endif |
Dan Willemsen | 7fe992c | 2016-03-02 13:54:51 -0800 | [diff] [blame] | 520 | ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),) |
Dan Willemsen | 08420cb | 2016-03-01 22:04:57 -0800 | [diff] [blame] | 521 | $(hide) chmod +x $@ |
| 522 | endif |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 523 | endif # ! prebuilt_module_is_dex_javalib |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 524 | |
Ying Wang | 8c89b4b | 2016-02-22 15:54:27 -0800 | [diff] [blame] | 525 | ifeq ($(LOCAL_MODULE_CLASS),JAVA_LIBRARIES) |
| 526 | my_src_jar := $(my_prebuilt_src_file) |
Colin Cross | 941b682 | 2017-03-29 13:53:29 -0700 | [diff] [blame] | 527 | |
| 528 | ifdef LOCAL_IS_HOST_MODULE |
| 529 | # for host java libraries deps should be in the common dir, so we make a copy in |
| 530 | # the common dir. |
| 531 | common_classes_jar := $(intermediates.COMMON)/classes.jar |
Nan Zhang | b3ec534 | 2017-08-31 21:43:04 +0000 | [diff] [blame] | 532 | common_header_jar := $(intermediates.COMMON)/classes-header.jar |
Colin Cross | 941b682 | 2017-03-29 13:53:29 -0700 | [diff] [blame] | 533 | |
Colin Cross | 96476c1 | 2017-04-06 09:56:19 -0700 | [diff] [blame] | 534 | $(common_classes_jar): PRIVATE_MODULE := $(LOCAL_MODULE) |
Colin Cross | d2e778f | 2017-04-14 15:14:33 -0700 | [diff] [blame] | 535 | $(common_classes_jar): PRIVATE_PREFIX := $(my_prefix) |
Colin Cross | 941b682 | 2017-03-29 13:53:29 -0700 | [diff] [blame] | 536 | |
| 537 | $(common_classes_jar) : $(my_src_jar) |
| 538 | $(transform-prebuilt-to-target) |
| 539 | |
Colin Cross | 7dc9043 | 2017-09-26 16:17:24 -0700 | [diff] [blame] | 540 | ifneq ($(TURBINE_ENABLED),false) |
Nan Zhang | b3ec534 | 2017-08-31 21:43:04 +0000 | [diff] [blame] | 541 | $(common_header_jar) : $(my_src_jar) |
| 542 | $(transform-prebuilt-to-target) |
Colin Cross | 7dc9043 | 2017-09-26 16:17:24 -0700 | [diff] [blame] | 543 | endif |
Nan Zhang | b3ec534 | 2017-08-31 21:43:04 +0000 | [diff] [blame] | 544 | |
Colin Cross | 941b682 | 2017-03-29 13:53:29 -0700 | [diff] [blame] | 545 | else # !LOCAL_IS_HOST_MODULE |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 546 | # for target java libraries, the LOCAL_BUILT_MODULE is in a product-specific dir, |
| 547 | # while the deps should be in the common dir, so we make a copy in the common dir. |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 548 | common_classes_jar := $(intermediates.COMMON)/classes.jar |
Nan Zhang | b3ec534 | 2017-08-31 21:43:04 +0000 | [diff] [blame] | 549 | common_header_jar := $(intermediates.COMMON)/classes-header.jar |
Colin Cross | 950f1ef | 2017-04-05 15:30:42 -0700 | [diff] [blame] | 550 | common_classes_pre_proguard_jar := $(intermediates.COMMON)/classes-pre-proguard.jar |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 551 | common_javalib_jar := $(intermediates.COMMON)/javalib.jar |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 552 | |
Colin Cross | d2e778f | 2017-04-14 15:14:33 -0700 | [diff] [blame] | 553 | $(common_classes_jar) $(common_classes_pre_proguard_jar) $(common_javalib_jar): PRIVATE_MODULE := $(LOCAL_MODULE) |
| 554 | $(common_classes_jar) $(common_classes_pre_proguard_jar) $(common_javalib_jar): PRIVATE_PREFIX := $(my_prefix) |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 555 | |
Dan Willemsen | 62dfb59 | 2016-07-08 21:33:05 -0700 | [diff] [blame] | 556 | ifeq ($(LOCAL_SDK_VERSION),system_current) |
Dan Willemsen | b47d4e9 | 2017-04-08 00:31:31 -0700 | [diff] [blame] | 557 | my_link_type := java:system |
Sundong Ahn | 5a44d1f | 2017-10-16 19:20:34 +0900 | [diff] [blame] | 558 | else ifneq (,$(call has-system-sdk-version,$(LOCAL_SDK_VERSION))) |
| 559 | my_link_type := java:system |
Jiyong Park | 5ebca30 | 2018-01-31 00:14:55 +0900 | [diff] [blame] | 560 | else ifeq ($(LOCAL_SDK_VERSION),core_current) |
| 561 | my_link_type := java:core |
Dan Willemsen | 62dfb59 | 2016-07-08 21:33:05 -0700 | [diff] [blame] | 562 | else ifneq ($(LOCAL_SDK_VERSION),) |
Dan Willemsen | b47d4e9 | 2017-04-08 00:31:31 -0700 | [diff] [blame] | 563 | my_link_type := java:sdk |
Dan Willemsen | 62dfb59 | 2016-07-08 21:33:05 -0700 | [diff] [blame] | 564 | else |
Dan Willemsen | b47d4e9 | 2017-04-08 00:31:31 -0700 | [diff] [blame] | 565 | my_link_type := java:platform |
Dan Willemsen | 62dfb59 | 2016-07-08 21:33:05 -0700 | [diff] [blame] | 566 | endif |
Dan Willemsen | b47d4e9 | 2017-04-08 00:31:31 -0700 | [diff] [blame] | 567 | |
| 568 | # TODO: check dependencies of prebuilt files |
| 569 | my_link_deps := |
| 570 | |
| 571 | my_2nd_arch_prefix := $(LOCAL_2ND_ARCH_VAR_PREFIX) |
| 572 | my_common := COMMON |
| 573 | include $(BUILD_SYSTEM)/link_type.mk |
Dan Willemsen | 62dfb59 | 2016-07-08 21:33:05 -0700 | [diff] [blame] | 574 | |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 575 | ifeq ($(prebuilt_module_is_dex_javalib),true) |
| 576 | # For prebuilt shared Java library we don't have classes.jar. |
| 577 | $(common_javalib_jar) : $(my_src_jar) |
| 578 | $(transform-prebuilt-to-target) |
| 579 | |
| 580 | else # ! prebuilt_module_is_dex_javalib |
| 581 | |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 582 | my_src_aar := $(filter %.aar, $(my_prebuilt_src_file)) |
| 583 | ifneq ($(my_src_aar),) |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 584 | # This is .aar file, archive of classes.jar and Android resources. |
Jeff Gaston | db6557e | 2018-02-27 14:05:40 -0500 | [diff] [blame] | 585 | |
| 586 | # run Jetifier if needed |
| 587 | LOCAL_JETIFIER_INPUT_FILE := $(my_src_aar) |
| 588 | include $(BUILD_SYSTEM)/jetifier.mk |
| 589 | my_src_aar := $(LOCAL_JETIFIER_OUTPUT_FILE) |
| 590 | |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 591 | my_src_jar := $(intermediates.COMMON)/aar/classes.jar |
Dan Willemsen | 1d64623 | 2017-11-17 13:11:26 -0800 | [diff] [blame] | 592 | my_src_proguard_options := $(intermediates.COMMON)/aar/proguard.txt |
Colin Cross | 93fbe84 | 2018-06-12 14:02:41 -0700 | [diff] [blame] | 593 | my_src_android_manifest := $(intermediates.COMMON)/aar/AndroidManifest.xml |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 594 | |
Dan Willemsen | 1d64623 | 2017-11-17 13:11:26 -0800 | [diff] [blame] | 595 | $(my_src_jar) : .KATI_IMPLICIT_OUTPUTS := $(my_src_proguard_options) |
Colin Cross | 93fbe84 | 2018-06-12 14:02:41 -0700 | [diff] [blame] | 596 | $(my_src_jar) : .KATI_IMPLICIT_OUTPUTS += $(my_src_android_manifest) |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 597 | $(my_src_jar) : $(my_src_aar) |
Dan Willemsen | 7a1ad6c | 2017-04-27 23:10:47 -0700 | [diff] [blame] | 598 | $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) $(dir $@)/res |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 599 | $(hide) unzip -qo -d $(dir $@) $< |
| 600 | # Make sure the extracted classes.jar has a new timestamp. |
| 601 | $(hide) touch $@ |
Colin Cross | 93fbe84 | 2018-06-12 14:02:41 -0700 | [diff] [blame] | 602 | # Make sure the proguard and AndroidManifest.xml files exist |
| 603 | # and have a new timestamp. |
Dan Willemsen | 1d64623 | 2017-11-17 13:11:26 -0800 | [diff] [blame] | 604 | $(hide) touch $(dir $@)/proguard.txt |
Colin Cross | 93fbe84 | 2018-06-12 14:02:41 -0700 | [diff] [blame] | 605 | $(hide) touch $(dir $@)/AndroidManifest.xml |
Colin Cross | 8e92179 | 2018-06-07 16:44:07 -0700 | [diff] [blame^] | 606 | |
| 607 | my_prebuilt_android_manifest := $(intermediates.COMMON)/manifest/AndroidManifest.xml |
| 608 | $(eval $(call copy-one-file,$(my_src_android_manifest),$(my_prebuilt_android_manifest))) |
| 609 | $(call add-dependency,$(LOCAL_BUILT_MODULE),$(my_prebuilt_android_manifest)) |
| 610 | |
Jeff Gaston | db6557e | 2018-02-27 14:05:40 -0500 | [diff] [blame] | 611 | else |
| 612 | |
| 613 | # run Jetifier if needed |
| 614 | LOCAL_JETIFIER_INPUT_FILE := $(my_src_jar) |
| 615 | include $(BUILD_SYSTEM)/jetifier.mk |
| 616 | my_src_jar := $(LOCAL_JETIFIER_OUTPUT_FILE) |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 617 | |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 618 | endif |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 619 | |
Dan Willemsen | 7f01615 | 2016-02-29 17:52:39 -0800 | [diff] [blame] | 620 | $(common_classes_jar) : $(my_src_jar) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 621 | $(transform-prebuilt-to-target) |
| 622 | |
Colin Cross | 7dc9043 | 2017-09-26 16:17:24 -0700 | [diff] [blame] | 623 | ifneq ($(TURBINE_ENABLED),false) |
Nan Zhang | b3ec534 | 2017-08-31 21:43:04 +0000 | [diff] [blame] | 624 | $(common_header_jar) : $(my_src_jar) |
| 625 | $(transform-prebuilt-to-target) |
Colin Cross | 7dc9043 | 2017-09-26 16:17:24 -0700 | [diff] [blame] | 626 | endif |
Nan Zhang | b3ec534 | 2017-08-31 21:43:04 +0000 | [diff] [blame] | 627 | |
Colin Cross | 950f1ef | 2017-04-05 15:30:42 -0700 | [diff] [blame] | 628 | $(common_classes_pre_proguard_jar) : $(my_src_jar) |
| 629 | $(transform-prebuilt-to-target) |
| 630 | |
Dan Willemsen | 7f01615 | 2016-02-29 17:52:39 -0800 | [diff] [blame] | 631 | $(common_javalib_jar) : $(common_classes_jar) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 632 | $(transform-prebuilt-to-target) |
| 633 | |
Colin Cross | 2029903 | 2018-05-09 13:29:51 -0700 | [diff] [blame] | 634 | include $(BUILD_SYSTEM)/force_aapt2.mk |
| 635 | |
Dan Willemsen | bb6393c | 2017-11-17 15:39:52 -0800 | [diff] [blame] | 636 | ifdef LOCAL_AAPT2_ONLY |
| 637 | LOCAL_USE_AAPT2 := true |
| 638 | endif |
| 639 | |
Colin Cross | 2029903 | 2018-05-09 13:29:51 -0700 | [diff] [blame] | 640 | ifeq ($(LOCAL_USE_AAPT2),true) |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 641 | ifneq ($(my_src_aar),) |
Dan Willemsen | 1d64623 | 2017-11-17 13:11:26 -0800 | [diff] [blame] | 642 | |
| 643 | $(intermediates.COMMON)/export_proguard_flags : $(my_src_proguard_options) |
| 644 | $(transform-prebuilt-to-target) |
| 645 | |
Dan Willemsen | 470e0e1 | 2017-04-27 22:28:06 -0700 | [diff] [blame] | 646 | LOCAL_SDK_RES_VERSION:=$(strip $(LOCAL_SDK_RES_VERSION)) |
| 647 | ifeq ($(LOCAL_SDK_RES_VERSION),) |
| 648 | LOCAL_SDK_RES_VERSION:=$(LOCAL_SDK_VERSION) |
| 649 | endif |
| 650 | |
| 651 | framework_res_package_export := |
Dan Willemsen | 470e0e1 | 2017-04-27 22:28:06 -0700 | [diff] [blame] | 652 | # Please refer to package.mk |
| 653 | ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) |
| 654 | ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) |
| 655 | framework_res_package_export := \ |
Anton Hansson | 66d47b8 | 2018-04-27 14:11:17 +0100 | [diff] [blame] | 656 | $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION)) |
Dan Willemsen | 470e0e1 | 2017-04-27 22:28:06 -0700 | [diff] [blame] | 657 | else |
| 658 | framework_res_package_export := \ |
| 659 | $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk |
Dan Willemsen | 470e0e1 | 2017-04-27 22:28:06 -0700 | [diff] [blame] | 660 | endif |
| 661 | endif |
| 662 | |
Ying Wang | e295c3d | 2016-02-24 14:11:55 -0800 | [diff] [blame] | 663 | my_res_package := $(intermediates.COMMON)/package-res.apk |
| 664 | |
| 665 | # We needed only very few PRIVATE variables and aapt2.mk input variables. Reset the unnecessary ones. |
| 666 | $(my_res_package): PRIVATE_AAPT2_CFLAGS := |
Dan Willemsen | e3c9901 | 2017-10-05 13:22:30 -0700 | [diff] [blame] | 667 | $(my_res_package): PRIVATE_AAPT_FLAGS := --static-lib --no-static-lib-packages --auto-add-overlay |
Colin Cross | 93fbe84 | 2018-06-12 14:02:41 -0700 | [diff] [blame] | 668 | $(my_res_package): PRIVATE_ANDROID_MANIFEST := $(my_src_android_manifest) |
Dan Willemsen | 470e0e1 | 2017-04-27 22:28:06 -0700 | [diff] [blame] | 669 | $(my_res_package): PRIVATE_AAPT_INCLUDES := $(framework_res_package_export) |
Ying Wang | e295c3d | 2016-02-24 14:11:55 -0800 | [diff] [blame] | 670 | $(my_res_package): PRIVATE_SOURCE_INTERMEDIATES_DIR := |
| 671 | $(my_res_package): PRIVATE_PROGUARD_OPTIONS_FILE := |
| 672 | $(my_res_package): PRIVATE_DEFAULT_APP_TARGET_SDK := |
| 673 | $(my_res_package): PRIVATE_DEFAULT_APP_TARGET_SDK := |
Adam Lesinski | e758f93 | 2016-02-26 11:13:43 -0800 | [diff] [blame] | 674 | $(my_res_package): PRIVATE_PRODUCT_AAPT_CONFIG := |
| 675 | $(my_res_package): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := |
| 676 | $(my_res_package): PRIVATE_TARGET_AAPT_CHARACTERISTICS := |
Colin Cross | 65c7cdf | 2018-02-20 14:31:33 -0800 | [diff] [blame] | 677 | $(my_res_package) : $(framework_res_package_export) |
Colin Cross | 93fbe84 | 2018-06-12 14:02:41 -0700 | [diff] [blame] | 678 | $(my_res_package) : $(my_src_android_manifest) |
Ying Wang | e295c3d | 2016-02-24 14:11:55 -0800 | [diff] [blame] | 679 | |
| 680 | full_android_manifest := |
| 681 | my_res_resources := |
| 682 | my_overlay_resources := |
Dan Willemsen | 4884525 | 2017-04-27 21:25:34 -0700 | [diff] [blame] | 683 | my_compiled_res_base_dir := $(intermediates.COMMON)/flat-res |
Ying Wang | e295c3d | 2016-02-24 14:11:55 -0800 | [diff] [blame] | 684 | R_file_stamp := |
| 685 | proguard_options_file := |
| 686 | my_generated_res_dirs := $(intermediates.COMMON)/aar/res |
| 687 | my_generated_res_dirs_deps := $(my_src_jar) |
| 688 | include $(BUILD_SYSTEM)/aapt2.mk |
| 689 | |
| 690 | # Make sure my_res_package is created when you run mm/mmm. |
| 691 | $(built_module) : $(my_res_package) |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 692 | endif # $(my_src_aar) |
Ying Wang | e295c3d | 2016-02-24 14:11:55 -0800 | [diff] [blame] | 693 | endif # LOCAL_USE_AAPT2 |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 694 | # make sure the classes.jar and javalib.jar are built before $(LOCAL_BUILT_MODULE) |
| 695 | $(built_module) : $(common_javalib_jar) |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 696 | |
Jiyong Park | 1cf8ee6 | 2018-05-22 15:39:59 +0900 | [diff] [blame] | 697 | my_exported_sdk_libs_file := $(intermediates.COMMON)/exported-sdk-libs |
| 698 | $(my_exported_sdk_libs_file): PRIVATE_EXPORTED_SDK_LIBS := $(LOCAL_EXPORT_SDK_LIBRARIES) |
| 699 | $(my_exported_sdk_libs_file): |
| 700 | @echo "Export SDK libs $@" |
| 701 | $(hide) mkdir -p $(dir $@) && rm -f $@ |
| 702 | $(if $(PRIATE_EXPORTED_SDK_LIBS),\ |
| 703 | $(hide) echo $(PRIVATE_EXPORTED_SDK_LIBS) | tr ' ' '\n' > $@,\ |
| 704 | $(hide) touch $@) |
| 705 | |
Ying Wang | 09c306c | 2016-03-15 16:36:29 -0700 | [diff] [blame] | 706 | endif # ! prebuilt_module_is_dex_javalib |
Ying Wang | 8c89b4b | 2016-02-22 15:54:27 -0800 | [diff] [blame] | 707 | endif # LOCAL_IS_HOST_MODULE is not set |
Yohann Roussel | d87cc99 | 2016-01-19 16:08:34 +0100 | [diff] [blame] | 708 | |
Yohann Roussel | b4c49cb | 2014-09-08 14:45:14 +0200 | [diff] [blame] | 709 | endif # JAVA_LIBRARIES |
| 710 | |
Dan Willemsen | 1c6dc5b | 2016-01-06 14:28:36 -0800 | [diff] [blame] | 711 | $(built_module) : $(LOCAL_ADDITIONAL_DEPENDENCIES) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 712 | |
| 713 | my_prebuilt_src_file := |
Mathieu Chartier | 55eabd5 | 2017-09-15 13:40:48 -0700 | [diff] [blame] | 714 | my_preopt_for_extracted_apk := |