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