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 | |
| 9 | ifneq ($(LOCAL_PREBUILT_LIBS),) |
| 10 | $(error dont use LOCAL_PREBUILT_LIBS anymore LOCAL_PATH=$(LOCAL_PATH)) |
| 11 | endif |
| 12 | ifneq ($(LOCAL_PREBUILT_EXECUTABLES),) |
| 13 | $(error dont use LOCAL_PREBUILT_EXECUTABLES anymore LOCAL_PATH=$(LOCAL_PATH)) |
| 14 | endif |
| 15 | ifneq ($(LOCAL_PREBUILT_JAVA_LIBRARIES),) |
| 16 | $(error dont use LOCAL_PREBUILT_JAVA_LIBRARIES anymore LOCAL_PATH=$(LOCAL_PATH)) |
| 17 | endif |
| 18 | |
| 19 | # Not much sense to check build prebuilts |
| 20 | LOCAL_DONT_CHECK_MODULE := true |
| 21 | |
Ying Wang | 34d5f1b | 2014-05-16 10:38:43 -0700 | [diff] [blame] | 22 | my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32) |
| 23 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 24 | ifdef LOCAL_PREBUILT_MODULE_FILE |
Ying Wang | c0adfb7 | 2014-02-27 14:10:53 -0800 | [diff] [blame] | 25 | my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 26 | else |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 27 | ifdef LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) |
| 28 | my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) |
Ying Wang | c0adfb7 | 2014-02-27 14:10:53 -0800 | [diff] [blame] | 29 | else |
Ying Wang | 34d5f1b | 2014-05-16 10:38:43 -0700 | [diff] [blame] | 30 | ifdef LOCAL_SRC_FILES_$(my_32_64_bit_suffix) |
| 31 | my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$(my_32_64_bit_suffix)) |
| 32 | else |
| 33 | my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES) |
| 34 | endif |
Ying Wang | c0adfb7 | 2014-02-27 14:10:53 -0800 | [diff] [blame] | 35 | endif |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 36 | endif |
| 37 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 38 | ifeq (SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)) |
| 39 | # Put the built targets of all shared libraries in a common directory |
| 40 | # to simplify the link line. |
| 41 | OVERRIDE_BUILT_MODULE_PATH := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATE_LIBRARIES) |
Ying Wang | bfb52a2 | 2014-08-20 17:12:32 -0700 | [diff] [blame] | 42 | ifeq ($(LOCAL_IS_HOST_MODULE)$(LOCAL_STRIP_MODULE),) |
| 43 | # Strip but not try to add debuglink |
| 44 | LOCAL_STRIP_MODULE := no_debuglink |
| 45 | endif |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 46 | |
| 47 | ifeq ($(LOCAL_IS_HOST_MODULE)$(LOCAL_PACK_MODULE_RELOCATIONS),) |
| 48 | # Do not pack relocations by default |
| 49 | LOCAL_PACK_MODULE_RELOCATIONS := false |
| 50 | endif |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 51 | endif |
| 52 | |
| 53 | ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),) |
| 54 | prebuilt_module_is_a_library := true |
| 55 | else |
| 56 | prebuilt_module_is_a_library := |
| 57 | endif |
| 58 | |
| 59 | # Don't install static libraries by default. |
| 60 | ifndef LOCAL_UNINSTALLABLE_MODULE |
| 61 | ifeq (STATIC_LIBRARIES,$(LOCAL_MODULE_CLASS)) |
| 62 | LOCAL_UNINSTALLABLE_MODULE := true |
| 63 | endif |
| 64 | endif |
| 65 | |
Ying Wang | af9757e | 2014-07-17 21:24:42 -0700 | [diff] [blame] | 66 | ifeq ($(LOCAL_MODULE_CLASS),APPS) |
| 67 | LOCAL_BUILT_MODULE_STEM := package.apk |
| 68 | LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk |
| 69 | endif |
| 70 | |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 71 | ifneq ($(filter true no_debuglink,$(LOCAL_STRIP_MODULE) $(LOCAL_PACK_MODULE_RELOCATIONS)),) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 72 | ifdef LOCAL_IS_HOST_MODULE |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 73 | $(error Cannot strip/pack host module LOCAL_PATH=$(LOCAL_PATH)) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 74 | endif |
| 75 | ifeq ($(filter SHARED_LIBRARIES EXECUTABLES,$(LOCAL_MODULE_CLASS)),) |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 76 | $(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] | 77 | endif |
| 78 | ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),) |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 79 | $(error Cannot strip/pack scripts LOCAL_PATH=$(LOCAL_PATH)) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 80 | endif |
| 81 | include $(BUILD_SYSTEM)/dynamic_binary.mk |
| 82 | built_module := $(linked_module) |
Ying Wang | bfb52a2 | 2014-08-20 17:12:32 -0700 | [diff] [blame] | 83 | |
Dmitriy Ivanov | 64762c3 | 2015-04-24 15:33:14 -0700 | [diff] [blame] | 84 | else # LOCAL_STRIP_MODULE and LOCAL_PACK_MODULE_RELOCATIONS not true |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 85 | include $(BUILD_SYSTEM)/base_rules.mk |
| 86 | built_module := $(LOCAL_BUILT_MODULE) |
| 87 | |
| 88 | ifdef prebuilt_module_is_a_library |
| 89 | export_includes := $(intermediates)/export_includes |
| 90 | $(export_includes): PRIVATE_EXPORT_C_INCLUDE_DIRS := $(LOCAL_EXPORT_C_INCLUDE_DIRS) |
Colin Cross | a4447e8 | 2015-09-28 16:26:00 -0700 | [diff] [blame] | 91 | $(export_includes) : $(LOCAL_MODULE_MAKEFILE_DEP) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 92 | @echo Export includes file: $< -- $@ |
| 93 | $(hide) mkdir -p $(dir $@) && rm -f $@ |
| 94 | ifdef LOCAL_EXPORT_C_INCLUDE_DIRS |
| 95 | $(hide) for d in $(PRIVATE_EXPORT_C_INCLUDE_DIRS); do \ |
| 96 | echo "-I $$d" >> $@; \ |
| 97 | done |
| 98 | else |
| 99 | $(hide) touch $@ |
| 100 | endif |
| 101 | |
| 102 | $(LOCAL_BUILT_MODULE) : | $(intermediates)/export_includes |
| 103 | endif # prebuilt_module_is_a_library |
| 104 | |
| 105 | # The real dependency will be added after all Android.mks are loaded and the install paths |
| 106 | # of the shared libraries are determined. |
| 107 | ifdef LOCAL_INSTALLED_MODULE |
| 108 | ifdef LOCAL_SHARED_LIBRARIES |
Ying Wang | 7c87739 | 2014-10-07 13:03:29 -0700 | [diff] [blame] | 109 | my_shared_libraries := $(LOCAL_SHARED_LIBRARIES) |
| 110 | # Extra shared libraries introduced by LOCAL_CXX_STL. |
| 111 | include $(BUILD_SYSTEM)/cxx_stl_setup.mk |
Ying Wang | 58f462f | 2014-02-25 18:26:29 -0800 | [diff] [blame] | 112 | $(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)DEPENDENCIES_ON_SHARED_LIBRARIES += \ |
Ying Wang | 7c87739 | 2014-10-07 13:03:29 -0700 | [diff] [blame] | 113 | $(my_register_name):$(LOCAL_INSTALLED_MODULE):$(subst $(space),$(comma),$(my_shared_libraries)) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 114 | |
| 115 | # We also need the LOCAL_BUILT_MODULE dependency, |
| 116 | # 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] | 117 | my_built_shared_libraries := \ |
Ying Wang | 58f462f | 2014-02-25 18:26:29 -0800 | [diff] [blame] | 118 | $(addprefix $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \ |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 119 | $(addsuffix $($(my_prefix)SHLIB_SUFFIX), \ |
Ying Wang | 7c87739 | 2014-10-07 13:03:29 -0700 | [diff] [blame] | 120 | $(my_shared_libraries))) |
| 121 | $(LOCAL_BUILT_MODULE) : $(my_built_shared_libraries) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 122 | endif |
| 123 | endif |
| 124 | |
Ying Wang | 7c87739 | 2014-10-07 13:03:29 -0700 | [diff] [blame] | 125 | # We need to enclose the above export_includes and my_built_shared_libraries in |
Ying Wang | bfb52a2 | 2014-08-20 17:12:32 -0700 | [diff] [blame] | 126 | # "LOCAL_STRIP_MODULE not true" because otherwise the rules are defined in dynamic_binary.mk. |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 127 | endif # LOCAL_STRIP_MODULE not true |
| 128 | |
Ying Wang | f0534c2 | 2014-04-15 11:12:21 -0700 | [diff] [blame] | 129 | ifeq ($(LOCAL_MODULE_CLASS),APPS) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 130 | PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES)) |
| 131 | |
Ying Wang | 43f7a32 | 2014-11-17 16:56:04 -0800 | [diff] [blame] | 132 | # Select dpi-specific source |
| 133 | ifdef LOCAL_DPI_VARIANTS |
Ying Wang | 6068658 | 2014-12-10 12:40:09 -0800 | [diff] [blame] | 134 | 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] | 135 | ifdef my_dpi |
| 136 | ifdef LOCAL_DPI_FILE_STEM |
| 137 | my_prebuilt_dpi_file_stem := $(LOCAL_DPI_FILE_STEM) |
| 138 | else |
| 139 | my_prebuilt_dpi_file_stem := $(LOCAL_MODULE)_%.apk |
| 140 | endif |
| 141 | my_prebuilt_src_file := $(dir $(my_prebuilt_src_file))$(subst %,$(my_dpi),$(my_prebuilt_dpi_file_stem)) |
| 142 | endif # my_dpi |
| 143 | endif # LOCAL_DPI_VARIANTS |
| 144 | |
Ying Wang | 96bcad4 | 2014-04-17 13:38:04 -0700 | [diff] [blame] | 145 | rs_compatibility_jni_libs := |
| 146 | include $(BUILD_SYSTEM)/install_jni_libs.mk |
| 147 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 148 | ifeq ($(LOCAL_CERTIFICATE),EXTERNAL) |
| 149 | # The magic string "EXTERNAL" means this package will be signed with |
| 150 | # the default dev key throughout the build process, but we expect |
| 151 | # the final package to be signed with a different key. |
| 152 | # |
| 153 | # This can be used for packages where we don't have access to the |
| 154 | # keys, but want the package to be predexopt'ed. |
| 155 | LOCAL_CERTIFICATE := $(DEFAULT_SYSTEM_DEV_CERTIFICATE) |
| 156 | PACKAGES.$(LOCAL_MODULE).EXTERNAL_KEY := 1 |
| 157 | |
| 158 | $(built_module) : PRIVATE_PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8 |
| 159 | $(built_module) : PRIVATE_CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem |
| 160 | endif |
| 161 | ifeq ($(LOCAL_CERTIFICATE),) |
Ying Wang | f0534c2 | 2014-04-15 11:12:21 -0700 | [diff] [blame] | 162 | # It is now a build error to add a prebuilt .apk without |
| 163 | # specifying a key for it. |
| 164 | $(error No LOCAL_CERTIFICATE specified for prebuilt "$(my_prebuilt_src_file)") |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 165 | else ifeq ($(LOCAL_CERTIFICATE),PRESIGNED) |
| 166 | # The magic string "PRESIGNED" means this package is already checked |
| 167 | # signed with its release key. |
| 168 | # |
| 169 | # By setting .CERTIFICATE but not .PRIVATE_KEY, this package will be |
| 170 | # mentioned in apkcerts.txt (with certificate set to "PRESIGNED") |
| 171 | # but the dexpreopt process will not try to re-sign the app. |
| 172 | PACKAGES.$(LOCAL_MODULE).CERTIFICATE := PRESIGNED |
| 173 | PACKAGES := $(PACKAGES) $(LOCAL_MODULE) |
| 174 | else |
| 175 | # If this is not an absolute certificate, assign it to a generic one. |
| 176 | ifeq ($(dir $(strip $(LOCAL_CERTIFICATE))),./) |
| 177 | LOCAL_CERTIFICATE := $(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))$(LOCAL_CERTIFICATE) |
| 178 | endif |
| 179 | |
| 180 | PACKAGES.$(LOCAL_MODULE).PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8 |
| 181 | PACKAGES.$(LOCAL_MODULE).CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem |
| 182 | PACKAGES := $(PACKAGES) $(LOCAL_MODULE) |
| 183 | |
| 184 | $(built_module) : PRIVATE_PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8 |
| 185 | $(built_module) : PRIVATE_CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem |
| 186 | endif |
| 187 | |
Andreas Gampe | 5e0dbe0 | 2014-10-01 22:01:16 -0700 | [diff] [blame] | 188 | # Disable dex-preopt of prebuilts to save space, if requested. |
| 189 | ifeq ($(DONT_DEXPREOPT_PREBUILTS),true) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 190 | LOCAL_DEX_PREOPT := false |
Andreas Gampe | 5e0dbe0 | 2014-10-01 22:01:16 -0700 | [diff] [blame] | 191 | endif |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 192 | |
| 193 | ####################################### |
| 194 | # defines built_odex along with rule to install odex |
| 195 | include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk |
| 196 | ####################################### |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 197 | # Sign and align non-presigned .apks. |
Ying Wang | 1fb0152 | 2015-05-01 14:02:26 -0700 | [diff] [blame] | 198 | |
| 199 | # The embedded prebuilt jni to uncompress. |
Ying Wang | 226eb92 | 2015-06-01 19:19:57 -0700 | [diff] [blame] | 200 | ifeq ($(LOCAL_CERTIFICATE),PRESIGNED) |
| 201 | # For PRESIGNED apks we must uncompress every .so file: |
| 202 | # even if the .so file isn't for the current TARGET_ARCH, |
| 203 | # we can't strip the file. |
| 204 | embedded_prebuilt_jni_libs := 'lib/*.so' |
| 205 | endif |
Ying Wang | 1fb0152 | 2015-05-01 14:02:26 -0700 | [diff] [blame] | 206 | ifndef embedded_prebuilt_jni_libs |
| 207 | # No LOCAL_PREBUILT_JNI_LIBS, uncompress all. |
| 208 | embedded_prebuilt_jni_libs := 'lib/*.so' |
| 209 | endif |
| 210 | $(built_module): PRIVATE_EMBEDDED_JNI_LIBS := $(embedded_prebuilt_jni_libs) |
| 211 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 212 | $(built_module) : $(my_prebuilt_src_file) | $(ACP) $(ZIPALIGN) $(SIGNAPK_JAR) |
| 213 | $(transform-prebuilt-to-target) |
Ying Wang | 226eb92 | 2015-06-01 19:19:57 -0700 | [diff] [blame] | 214 | $(uncompress-shared-libs) |
Kenny Root | dff3755 | 2015-04-15 12:09:32 -0700 | [diff] [blame] | 215 | ifneq ($(LOCAL_CERTIFICATE),PRESIGNED) |
| 216 | @# Only strip out files if we can re-sign the package. |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 217 | ifdef LOCAL_DEX_PREOPT |
Ying Wang | 36142f6 | 2014-05-21 16:13:33 -0700 | [diff] [blame] | 218 | ifneq (nostripping,$(LOCAL_DEX_PREOPT)) |
| 219 | $(call dexpreopt-remove-classes.dex,$@) |
| 220 | endif |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 221 | endif |
Kenny Root | dff3755 | 2015-04-15 12:09:32 -0700 | [diff] [blame] | 222 | $(sign-package) |
| 223 | endif |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 224 | $(align-package) |
| 225 | |
Ying Wang | 36142f6 | 2014-05-21 16:13:33 -0700 | [diff] [blame] | 226 | ############################### |
| 227 | ## Rule to build the odex file |
| 228 | ifdef LOCAL_DEX_PREOPT |
| 229 | $(built_odex) : $(my_prebuilt_src_file) |
| 230 | $(call dexpreopt-one-file,$<,$@) |
| 231 | endif |
| 232 | |
Ying Wang | 00fe587 | 2014-07-23 14:35:40 -0700 | [diff] [blame] | 233 | ############################### |
| 234 | ## Install split apks. |
| 235 | ifdef LOCAL_PACKAGE_SPLITS |
| 236 | # LOCAL_PACKAGE_SPLITS is a list of apks to be installed. |
| 237 | built_apk_splits := $(addprefix $(built_module_path)/,$(notdir $(LOCAL_PACKAGE_SPLITS))) |
| 238 | installed_apk_splits := $(addprefix $(my_module_path)/,$(notdir $(LOCAL_PACKAGE_SPLITS))) |
| 239 | |
| 240 | # Rules to sign and zipalign the split apks. |
| 241 | my_src_dir := $(sort $(dir $(LOCAL_PACKAGE_SPLITS))) |
| 242 | ifneq (1,$(words $(my_src_dir))) |
| 243 | $(error You must put all the split source apks in the same folder: $(LOCAL_PACKAGE_SPLITS)) |
| 244 | endif |
| 245 | my_src_dir := $(LOCAL_PATH)/$(my_src_dir) |
| 246 | |
| 247 | $(built_apk_splits) : PRIVATE_PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8 |
| 248 | $(built_apk_splits) : PRIVATE_CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem |
| 249 | $(built_apk_splits) : $(built_module_path)/%.apk : $(my_src_dir)/%.apk | $(ACP) |
| 250 | $(copy-file-to-new-target) |
| 251 | $(sign-package) |
| 252 | $(align-package) |
| 253 | |
| 254 | # Rules to install the split apks. |
| 255 | $(installed_apk_splits) : $(my_module_path)/%.apk : $(built_module_path)/%.apk | $(ACP) |
| 256 | @echo "Install: $@" |
| 257 | $(copy-file-to-new-target) |
| 258 | |
| 259 | # Register the additional built and installed files. |
| 260 | ALL_MODULES.$(my_register_name).INSTALLED += $(installed_apk_splits) |
| 261 | ALL_MODULES.$(my_register_name).BUILT_INSTALLED += \ |
| 262 | $(foreach s,$(LOCAL_PACKAGE_SPLITS),$(built_module_path)/$(notdir $(s)):$(my_module_path)/$(notdir $(s))) |
| 263 | |
| 264 | # Make sure to install the splits when you run "make <module_name>". |
| 265 | $(my_register_name): $(installed_apk_splits) |
| 266 | |
| 267 | endif # LOCAL_PACKAGE_SPLITS |
| 268 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 269 | else # LOCAL_MODULE_CLASS != APPS |
| 270 | ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),) |
| 271 | $(built_module) : $(my_prebuilt_src_file) |
| 272 | $(transform-prebuilt-to-target-strip-comments) |
| 273 | else |
| 274 | $(built_module) : $(my_prebuilt_src_file) | $(ACP) |
| 275 | $(transform-prebuilt-to-target) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 276 | endif |
| 277 | endif # LOCAL_MODULE_CLASS != APPS |
| 278 | |
| 279 | ifeq ($(LOCAL_IS_HOST_MODULE)$(LOCAL_MODULE_CLASS),JAVA_LIBRARIES) |
| 280 | # for target java libraries, the LOCAL_BUILT_MODULE is in a product-specific dir, |
| 281 | # while the deps should be in the common dir, so we make a copy in the common dir. |
| 282 | # For nonstatic library, $(common_javalib_jar) is the dependency file, |
| 283 | # while $(common_classes_jar) is used to link. |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 284 | common_classes_jar := $(intermediates.COMMON)/classes.jar |
| 285 | common_javalib_jar := $(intermediates.COMMON)/javalib.jar |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 286 | |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 287 | $(common_classes_jar) $(common_javalib_jar): PRIVATE_MODULE := $(LOCAL_MODULE) |
| 288 | |
| 289 | ifneq ($(filter %.aar, $(my_prebuilt_src_file)),) |
| 290 | # This is .aar file, archive of classes.jar and Android resources. |
| 291 | my_src_jar := $(intermediates.COMMON)/aar/classes.jar |
| 292 | |
| 293 | $(my_src_jar) : $(my_prebuilt_src_file) |
| 294 | $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) |
| 295 | $(hide) unzip -qo -d $(dir $@) $< |
| 296 | # Make sure the extracted classes.jar has a new timestamp. |
| 297 | $(hide) touch $@ |
| 298 | |
| 299 | else |
| 300 | # This is jar file. |
| 301 | my_src_jar := $(my_prebuilt_src_file) |
| 302 | endif |
| 303 | $(common_classes_jar) : $(my_src_jar) | $(ACP) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 304 | $(transform-prebuilt-to-target) |
| 305 | |
| 306 | $(common_javalib_jar) : $(common_classes_jar) | $(ACP) |
| 307 | $(transform-prebuilt-to-target) |
| 308 | |
| 309 | # make sure the classes.jar and javalib.jar are built before $(LOCAL_BUILT_MODULE) |
| 310 | $(built_module) : $(common_javalib_jar) |
| 311 | endif # TARGET JAVA_LIBRARIES |
| 312 | |
Yohann Roussel | b4c49cb | 2014-09-08 14:45:14 +0200 | [diff] [blame] | 313 | ifeq ($(LOCAL_MODULE_CLASS),JAVA_LIBRARIES) |
Yohann Roussel | 801f2c4 | 2015-03-03 17:14:09 +0100 | [diff] [blame] | 314 | $(intermediates.COMMON)/classes.jack : PRIVATE_JILL_FLAGS:=$(LOCAL_JILL_FLAGS) |
Colin Cross | 7ee3b85 | 2015-09-28 18:45:23 -0700 | [diff] [blame] | 315 | $(intermediates.COMMON)/classes.jack : $(my_src_jar) $(LOCAL_MODULE_MAKEFILE_DEP) \ |
Yohann Roussel | b2c5558 | 2015-07-02 12:10:17 +0200 | [diff] [blame] | 316 | $(LOCAL_ADDITIONAL_DEPENDENCIES) $(JILL_JAR) $(JACK) |
Yohann Roussel | b4c49cb | 2014-09-08 14:45:14 +0200 | [diff] [blame] | 317 | $(transform-jar-to-jack) |
| 318 | |
| 319 | endif # JAVA_LIBRARIES |
| 320 | |
Colin Cross | a4447e8 | 2015-09-28 16:26:00 -0700 | [diff] [blame] | 321 | $(built_module) : $(LOCAL_MODULE_MAKEFILE_DEP) $(LOCAL_ADDITIONAL_DEPENDENCIES) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 322 | |
| 323 | my_prebuilt_src_file := |