1# 2# Copyright (C) 2008 The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17########################################################### 18## Standard rules for building an application package. 19## 20## Additional inputs from base_rules.make: 21## LOCAL_PACKAGE_NAME: The name of the package; the directory 22## will be called this. 23## 24## MODULE, MODULE_PATH, and MODULE_SUFFIX will 25## be set for you. 26########################################################### 27 28# If this makefile is being read from within an inheritance, 29# use the new values. 30skip_definition:= 31ifdef LOCAL_PACKAGE_OVERRIDES 32 package_overridden := $(call set-inherited-package-variables) 33 ifeq ($(strip $(package_overridden)),) 34 skip_definition := true 35 endif 36endif 37 38ifndef skip_definition 39 40LOCAL_PACKAGE_NAME := $(strip $(LOCAL_PACKAGE_NAME)) 41ifeq ($(LOCAL_PACKAGE_NAME),) 42$(error $(LOCAL_PATH): Package modules must define LOCAL_PACKAGE_NAME) 43endif 44 45ifneq ($(strip $(LOCAL_MODULE_SUFFIX)),) 46$(error $(LOCAL_PATH): Package modules may not define LOCAL_MODULE_SUFFIX) 47endif 48LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) 49 50ifneq ($(strip $(LOCAL_MODULE)),) 51$(error $(LOCAL_PATH): Package modules may not define LOCAL_MODULE) 52endif 53LOCAL_MODULE := $(LOCAL_PACKAGE_NAME) 54 55ifneq ($(strip $(LOCAL_MODULE_CLASS)),) 56$(error $(LOCAL_PATH): Package modules may not set LOCAL_MODULE_CLASS) 57endif 58LOCAL_MODULE_CLASS := APPS 59 60# Package LOCAL_MODULE_TAGS default to optional 61LOCAL_MODULE_TAGS := $(strip $(LOCAL_MODULE_TAGS)) 62ifeq ($(LOCAL_MODULE_TAGS),) 63LOCAL_MODULE_TAGS := optional 64endif 65 66ifeq ($(filter tests, $(LOCAL_MODULE_TAGS)),) 67# Force localization check if it's not tagged as tests. 68LOCAL_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) -z 69endif 70 71ifdef LOCAL_PACKAGE_SPLITS 72LOCAL_AAPT_FLAGS += $(addprefix --split ,$(LOCAL_PACKAGE_SPLITS)) 73endif 74 75need_compile_asset := 76ifeq (,$(LOCAL_ASSET_DIR)) 77LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets 78else 79need_compile_asset := true 80endif 81 82# LOCAL_RESOURCE_DIR may point to resource generated during the build 83need_compile_res := 84ifeq (,$(LOCAL_RESOURCE_DIR)) 85 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res 86else 87 need_compile_res := true 88endif 89 90package_resource_overlays := $(strip \ 91 $(wildcard $(foreach dir, $(PRODUCT_PACKAGE_OVERLAYS), \ 92 $(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR)))) \ 93 $(wildcard $(foreach dir, $(DEVICE_PACKAGE_OVERLAYS), \ 94 $(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR))))) 95 96LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR) 97 98all_assets := $(strip \ 99 $(foreach dir, $(LOCAL_ASSET_DIR), \ 100 $(addprefix $(dir)/, \ 101 $(patsubst assets/%,%, \ 102 $(call find-subdir-assets, $(dir)) \ 103 ) \ 104 ) \ 105 )) 106 107ifneq ($(all_assets),) 108need_compile_asset := true 109endif 110 111all_resources := $(strip \ 112 $(foreach dir, $(LOCAL_RESOURCE_DIR), \ 113 $(addprefix $(dir)/, \ 114 $(patsubst res/%,%, \ 115 $(call find-subdir-assets,$(dir)) \ 116 ) \ 117 ) \ 118 )) 119 120ifneq ($(all_resources),) 121 need_compile_res := true 122endif 123 124all_res_assets := $(strip $(all_assets) $(all_resources)) 125 126package_expected_intermediates_COMMON := $(call local-intermediates-dir,COMMON) 127# If no assets or resources were found, clear the directory variables so 128# we don't try to build them. 129ifneq (true,$(need_compile_asset)) 130LOCAL_ASSET_DIR:= 131endif 132ifneq (true,$(need_compile_res)) 133LOCAL_RESOURCE_DIR:= 134R_file_stamp := 135else 136# Make sure that R_file_stamp inherits the proper PRIVATE vars. 137# If R.stamp moves, be sure to update the framework makefile, 138# which has intimate knowledge of its location. 139R_file_stamp := $(package_expected_intermediates_COMMON)/src/R.stamp 140LOCAL_INTERMEDIATE_TARGETS += $(R_file_stamp) 141endif 142 143LOCAL_BUILT_MODULE_STEM := package.apk 144LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk 145 146LOCAL_PROGUARD_ENABLED:=$(strip $(LOCAL_PROGUARD_ENABLED)) 147ifndef LOCAL_PROGUARD_ENABLED 148ifneq ($(DISABLE_PROGUARD),true) 149 LOCAL_PROGUARD_ENABLED :=full 150endif 151endif 152ifeq ($(LOCAL_PROGUARD_ENABLED),disabled) 153 # the package explicitly request to disable proguard. 154 LOCAL_PROGUARD_ENABLED := 155endif 156proguard_options_file := 157ifneq ($(LOCAL_PROGUARD_ENABLED),custom) 158ifeq ($(need_compile_res),true) 159 proguard_options_file := $(package_expected_intermediates_COMMON)/proguard_options 160endif # need_compile_res 161endif # !custom 162LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS) 163 164ifeq (true,$(EMMA_INSTRUMENT)) 165ifndef LOCAL_EMMA_INSTRUMENT 166# No emma for test apks. 167ifeq (,$(filer tests,$(LOCAL_MODULE_TAGS))$(LOCAL_INSTRUMENTATION_FOR)) 168LOCAL_EMMA_INSTRUMENT := true 169endif # No test apk 170endif # LOCAL_EMMA_INSTRUMENT is not set 171else 172LOCAL_EMMA_INSTRUMENT := false 173endif # EMMA_INSTRUMENT is true 174 175ifeq (true,$(LOCAL_EMMA_INSTRUMENT)) 176ifeq (true,$(EMMA_INSTRUMENT_STATIC)) 177LOCAL_STATIC_JAVA_LIBRARIES += emma 178else 179ifdef LOCAL_SDK_VERSION 180ifdef TARGET_BUILD_APPS 181# In unbundled build merge the emma library into the apk. 182LOCAL_STATIC_JAVA_LIBRARIES += emma 183else 184# If build against the SDK in full build, core.jar is not used, 185# we have to use prebiult emma.jar to make Proguard happy; 186# Otherwise emma classes are included in core.jar. 187LOCAL_PROGUARD_FLAGS += -libraryjars $(EMMA_JAR) 188endif # full build 189endif # LOCAL_SDK_VERSION 190endif # EMMA_INSTRUMENT_STATIC 191endif # LOCAL_EMMA_INSTRUMENT 192 193rs_compatibility_jni_libs := 194 195################################# 196include $(BUILD_SYSTEM)/java.mk 197################################# 198 199LOCAL_SDK_RES_VERSION:=$(strip $(LOCAL_SDK_RES_VERSION)) 200ifeq ($(LOCAL_SDK_RES_VERSION),) 201 LOCAL_SDK_RES_VERSION:=$(LOCAL_SDK_VERSION) 202endif 203 204include $(BUILD_SYSTEM)/android_manifest.mk 205 206$(LOCAL_INTERMEDIATE_TARGETS): \ 207 PRIVATE_ANDROID_MANIFEST := $(full_android_manifest) 208ifneq (,$(filter-out current system_current, $(LOCAL_SDK_VERSION))) 209$(LOCAL_INTERMEDIATE_TARGETS): \ 210 PRIVATE_DEFAULT_APP_TARGET_SDK := $(LOCAL_SDK_VERSION) 211else 212$(LOCAL_INTERMEDIATE_TARGETS): \ 213 PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK) 214endif 215 216ifeq ($(need_compile_res),true) 217 218# Since we don't know where the real R.java file is going to end up, 219# we need to use another file to stand in its place. We'll just 220# copy the generated file to src/R.stamp, which means it will 221# have the same contents and timestamp as the actual file. 222# 223# At the same time, this will copy the R.java file to a central 224# 'R' directory to make it easier to add the files to an IDE. 225# 226#TODO: use PRIVATE_SOURCE_INTERMEDIATES_DIR instead of 227# $(intermediates.COMMON)/src 228ifneq ($(package_expected_intermediates_COMMON),$(intermediates.COMMON)) 229 $(error $(LOCAL_MODULE): internal error: expected intermediates.COMMON "$(package_expected_intermediates_COMMON)" != intermediates.COMMON "$(intermediates.COMMON)") 230endif 231 232$(R_file_stamp): PRIVATE_RESOURCE_PUBLICS_OUTPUT := \ 233 $(intermediates.COMMON)/public_resources.xml 234$(R_file_stamp): PRIVATE_PROGUARD_OPTIONS_FILE := $(proguard_options_file) 235$(R_file_stamp): $(all_res_assets) $(full_android_manifest) $(RenderScript_file_stamp) $(AAPT) | $(ACP) 236 @echo "target R.java/Manifest.java: $(PRIVATE_MODULE) ($@)" 237 @rm -f $@ 238 $(create-resource-java-files) 239 $(hide) for GENERATED_MANIFEST_FILE in `find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) \ 240 -name Manifest.java 2> /dev/null`; do \ 241 dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_MANIFEST_FILE`; \ 242 mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \ 243 $(ACP) -fp $$GENERATED_MANIFEST_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \ 244 done; 245 $(hide) for GENERATED_R_FILE in `find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) \ 246 -name R.java 2> /dev/null`; do \ 247 dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_R_FILE`; \ 248 mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \ 249 $(ACP) -fp $$GENERATED_R_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir \ 250 || exit 31; \ 251 $(ACP) -fp $$GENERATED_R_FILE $@ || exit 32; \ 252 done; \ 253 254$(proguard_options_file): $(R_file_stamp) 255 256resource_export_package := 257ifdef LOCAL_EXPORT_PACKAGE_RESOURCES 258# Put this module's resources into a PRODUCT-agnositc package that 259# other packages can use to build their own PRODUCT-agnostic R.java (etc.) 260# files. 261resource_export_package := $(intermediates.COMMON)/package-export.apk 262$(R_file_stamp): $(resource_export_package) 263 264# add-assets-to-package looks at PRODUCT_AAPT_CONFIG, but this target 265# can't know anything about PRODUCT. Clear it out just for this target. 266$(resource_export_package): PRIVATE_PRODUCT_AAPT_CONFIG := 267$(resource_export_package): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := 268$(resource_export_package): $(all_res_assets) $(full_android_manifest) $(RenderScript_file_stamp) $(AAPT) 269 @echo "target Export Resources: $(PRIVATE_MODULE) ($@)" 270 $(create-empty-package) 271 $(add-assets-to-package) 272endif 273 274# Other modules should depend on the BUILT module if 275# they want to use this module's R.java file. 276$(LOCAL_BUILT_MODULE): $(R_file_stamp) 277 278ifneq ($(full_classes_jar),) 279# If full_classes_jar is non-empty, we're building sources. 280# If we're building sources, the initial javac step (which 281# produces full_classes_compiled_jar) needs to ensure the 282# R.java and Manifest.java files have been generated first. 283$(full_classes_compiled_jar): $(R_file_stamp) 284endif 285 286endif # need_compile_res 287 288ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true) 289# We need to explicitly clear this var so that we don't 290# inherit the value from whomever caused us to be built. 291$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_INCLUDES := 292else 293# Most packages should link against the resources defined by framework-res. 294# Even if they don't have their own resources, they may use framework 295# resources. 296ifneq ($(filter-out current system_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current,$(LOCAL_SDK_RES_VERSION))),) 297# for released sdk versions, the platform resources were built into android.jar. 298framework_res_package_export := \ 299 $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_RES_VERSION)/android.jar 300framework_res_package_export_deps := $(framework_res_package_export) 301else # LOCAL_SDK_RES_VERSION 302framework_res_package_export := \ 303 $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk 304# We can't depend directly on the export.apk file; it won't get its 305# PRIVATE_ vars set up correctly if we do. Instead, depend on the 306# corresponding R.stamp file, which lists the export.apk as a dependency. 307framework_res_package_export_deps := \ 308 $(dir $(framework_res_package_export))src/R.stamp 309endif # LOCAL_SDK_RES_VERSION 310all_library_res_package_exports := \ 311 $(framework_res_package_export) \ 312 $(foreach lib,$(LOCAL_RES_LIBRARIES),\ 313 $(call intermediates-dir-for,APPS,$(lib),,COMMON)/package-export.apk) 314 315all_library_res_package_export_deps := \ 316 $(framework_res_package_export_deps) \ 317 $(foreach lib,$(LOCAL_RES_LIBRARIES),\ 318 $(call intermediates-dir-for,APPS,$(lib),,COMMON)/src/R.stamp) 319 320$(resource_export_package) $(R_file_stamp) $(LOCAL_BUILT_MODULE): $(all_library_res_package_export_deps) 321$(LOCAL_INTERMEDIATE_TARGETS): \ 322 PRIVATE_AAPT_INCLUDES := $(all_library_res_package_exports) 323endif # LOCAL_NO_STANDARD_LIBRARIES 324 325ifneq ($(full_classes_jar),) 326$(LOCAL_BUILT_MODULE): PRIVATE_DEX_FILE := $(built_dex) 327$(LOCAL_BUILT_MODULE): $(built_dex) 328endif # full_classes_jar 329 330include $(BUILD_SYSTEM)/install_jni_libs.mk 331 332# Pick a key to sign the package with. If this package hasn't specified 333# an explicit certificate, use the default. 334# Secure release builds will have their packages signed after the fact, 335# so it's ok for these private keys to be in the clear. 336ifeq ($(LOCAL_CERTIFICATE),) 337 LOCAL_CERTIFICATE := $(DEFAULT_SYSTEM_DEV_CERTIFICATE) 338endif 339 340ifeq ($(LOCAL_CERTIFICATE),EXTERNAL) 341 # The special value "EXTERNAL" means that we will sign it with the 342 # default devkey, apply predexopt, but then expect the final .apk 343 # (after dexopting) to be signed by an outside tool. 344 LOCAL_CERTIFICATE := $(DEFAULT_SYSTEM_DEV_CERTIFICATE) 345 PACKAGES.$(LOCAL_PACKAGE_NAME).EXTERNAL_KEY := 1 346endif 347 348# If this is not an absolute certificate, assign it to a generic one. 349ifeq ($(dir $(strip $(LOCAL_CERTIFICATE))),./) 350 LOCAL_CERTIFICATE := $(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))$(LOCAL_CERTIFICATE) 351endif 352private_key := $(LOCAL_CERTIFICATE).pk8 353certificate := $(LOCAL_CERTIFICATE).x509.pem 354 355$(LOCAL_BUILT_MODULE): $(private_key) $(certificate) $(SIGNAPK_JAR) 356$(LOCAL_BUILT_MODULE): PRIVATE_PRIVATE_KEY := $(private_key) 357$(LOCAL_BUILT_MODULE): PRIVATE_CERTIFICATE := $(certificate) 358 359PACKAGES.$(LOCAL_PACKAGE_NAME).PRIVATE_KEY := $(private_key) 360PACKAGES.$(LOCAL_PACKAGE_NAME).CERTIFICATE := $(certificate) 361 362$(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(foreach c,\ 363 $(LOCAL_ADDITIONAL_CERTIFICATES), $(c).x509.pem $(c).pk8) 364 365# Define the rule to build the actual package. 366$(LOCAL_BUILT_MODULE): $(AAPT) | $(ZIPALIGN) 367# PRIVATE_JNI_SHARED_LIBRARIES is a list of <abi>:<path_of_built_lib>. 368$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries_with_abis) 369# PRIVATE_JNI_SHARED_LIBRARIES_ABI is a list of ABI names. 370$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES_ABI := $(jni_shared_libraries_abis) 371ifneq ($(TARGET_BUILD_APPS),) 372 # Include all resources for unbundled apps. 373 LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true 374endif 375ifeq ($(LOCAL_AAPT_INCLUDE_ALL_RESOURCES),true) 376 $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_CONFIG := 377 $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := 378else 379 $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_CONFIG := $(PRODUCT_AAPT_CONFIG) 380ifdef LOCAL_PACKAGE_SPLITS 381 $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := 382else 383 $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := $(PRODUCT_AAPT_PREF_CONFIG) 384endif 385endif 386$(LOCAL_BUILT_MODULE): $(all_res_assets) $(jni_shared_libraries) $(full_android_manifest) 387 @echo "target Package: $(PRIVATE_MODULE) ($@)" 388 $(create-empty-package) 389 $(add-assets-to-package) 390ifneq ($(jni_shared_libraries),) 391 $(add-jni-shared-libs-to-package) 392endif 393ifneq ($(full_classes_jar),) 394 $(add-dex-to-package) 395endif 396 $(add-carried-java-resources) 397ifneq ($(extra_jar_args),) 398 $(add-java-resources-to-package) 399endif 400 $(sign-package) 401ifdef LOCAL_DEX_PREOPT 402ifneq (nostripping,$(LOCAL_DEX_PREOPT)) 403 $(call dexpreopt-remove-classes.dex,$@) 404endif 405endif 406 @# Alignment must happen after all other zip operations. 407 $(align-package) 408 409############################### 410## Rule to build the odex file 411ifdef LOCAL_DEX_PREOPT 412$(built_odex): PRIVATE_DEX_FILE := $(built_dex) 413# Use pattern rule - we may have multiple built odex files. 414$(built_odex) : $(dir $(LOCAL_BUILT_MODULE))% : $(built_dex) 415 $(hide) mkdir -p $(dir $@) && rm -f $@ 416 $(add-dex-to-package) 417 $(hide) mv $@ $@.input 418 $(call dexpreopt-one-file,$@.input,$@) 419 $(hide) rm $@.input 420endif 421 422############################### 423## APK splits 424ifdef LOCAL_PACKAGE_SPLITS 425# LOCAL_PACKAGE_SPLITS is a list of resource labels. 426# aapt will convert comma inside resource lable to underscore in the file names. 427my_split_suffixes := $(subst $(comma),_,$(LOCAL_PACKAGE_SPLITS)) 428built_apk_splits := $(foreach s,$(my_split_suffixes),$(built_module_path)/package_$(s).apk) 429installed_apk_splits := $(foreach s,$(my_split_suffixes),$(my_module_path)/$(LOCAL_MODULE)_$(s).apk) 430 431# The splits should have been built in the same command building the base apk. 432# This rule just runs signing and zipalign etc. 433# Note that we explicily check the existence of the split apk and remove the 434# built base apk if the split apk isn't there. 435# That way the build system will rerun the aapt after the user changes the splitting parameters. 436$(built_apk_splits): PRIVATE_PRIVATE_KEY := $(private_key) 437$(built_apk_splits): PRIVATE_CERTIFICATE := $(certificate) 438$(built_apk_splits) : $(built_module_path)/%.apk : $(LOCAL_BUILT_MODULE) 439 $(hide) if [ ! -f $@ ]; then \ 440 echo 'No $@ generated, check your apk splitting parameters.' 1>&2; \ 441 rm $<; exit 1; \ 442 fi 443 $(sign-package) 444 $(align-package) 445 446# Rules to install the splits 447$(installed_apk_splits) : $(my_module_path)/$(LOCAL_MODULE)_%.apk : $(built_module_path)/package_%.apk | $(ACP) 448 @echo "Install: $@" 449 $(copy-file-to-new-target) 450 451# Register the additional built and installed files. 452ALL_MODULES.$(my_register_name).INSTALLED += $(installed_apk_splits) 453ALL_MODULES.$(my_register_name).BUILT_INSTALLED += \ 454 $(foreach s,$(my_split_suffixes),$(built_module_path)/package_$(s).apk:$(my_module_path)/$(LOCAL_MODULE)_$(s).apk) 455 456# Make sure to install the splits when you run "make <module_name>". 457$(my_register_name): $(installed_apk_splits) 458endif # LOCAL_PACKAGE_SPLITS 459 460# Save information about this package 461PACKAGES.$(LOCAL_PACKAGE_NAME).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES)) 462PACKAGES.$(LOCAL_PACKAGE_NAME).RESOURCE_FILES := $(all_resources) 463ifdef package_resource_overlays 464PACKAGES.$(LOCAL_PACKAGE_NAME).RESOURCE_OVERLAYS := $(package_resource_overlays) 465endif 466 467PACKAGES := $(PACKAGES) $(LOCAL_PACKAGE_NAME) 468 469# Dist the files that can be bundled in system.img. 470# They include the jni shared libraries and the apk with jni libraries stripped. 471ifeq ($(LOCAL_DIST_BUNDLED_BINARIES),true) 472ifneq ($(filter $(LOCAL_PACKAGE_NAME),$(TARGET_BUILD_APPS)),) 473ifneq ($(strip $(jni_shared_libraries)),) 474dist_subdir := bundled_$(LOCAL_PACKAGE_NAME) 475$(foreach f, $(jni_shared_libraries), \ 476 $(call dist-for-goals, apps_only, $(f):$(dist_subdir)/$(notdir $(f)))) 477 478apk_jni_stripped := $(intermediates)/jni_stripped/package.apk 479$(apk_jni_stripped): PRIVATE_JNI_SHARED_LIBRARIES := $(notdir $(jni_shared_libraries)) 480$(apk_jni_stripped) : $(LOCAL_BUILT_MODULE) | $(ZIPALIGN) 481 @rm -rf $(dir $@) && mkdir -p $(dir $@) 482 $(hide) cp $< $@ 483 $(hide) zip -d $@ $(foreach f,$(PRIVATE_JNI_SHARED_LIBRARIES),\*/$(f)) 484 $(call align-package) 485 486$(call dist-for-goals, apps_only, $(apk_jni_stripped):$(dist_subdir)/$(LOCAL_PACKAGE_NAME).apk) 487 488endif # jni_shared_libraries 489endif # apps_only build 490endif # LOCAL_DIST_BUNDLED_BINARIES 491 492# Lint phony targets 493.PHONY: lint-$(LOCAL_PACKAGE_NAME) 494lint-$(LOCAL_PACKAGE_NAME): PRIVATE_PATH := $(LOCAL_PATH) 495lint-$(LOCAL_PACKAGE_NAME): PRIVATE_LINT_FLAGS := $(LOCAL_LINT_FLAGS) 496lint-$(LOCAL_PACKAGE_NAME) : 497 @echo lint $(PRIVATE_PATH) 498 $(LINT) $(PRIVATE_LINT_FLAGS) $(PRIVATE_PATH) 499 500lintall : lint-$(LOCAL_PACKAGE_NAME) 501 502endif # skip_definition 503 504# Reset internal variables. 505all_res_assets := 506