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 29 # If this makefile is being read from within an inheritance, 30 # use the new values. 31 skip_definition:= 32 ifdef LOCAL_PACKAGE_OVERRIDES 33 package_overridden := $(call set-inherited-package-variables) 34 ifeq ($(strip $(package_overridden)),) 35 skip_definition := true 36 endif 37 endif 38 39 ifndef skip_definition 40 41 LOCAL_PACKAGE_NAME := $(strip $(LOCAL_PACKAGE_NAME)) 42 ifeq ($(LOCAL_PACKAGE_NAME),) 43 $(error $(LOCAL_PATH): Package modules must define LOCAL_PACKAGE_NAME) 44 endif 45 46 ifneq ($(strip $(LOCAL_MODULE_SUFFIX)),) 47 $(error $(LOCAL_PATH): Package modules may not define LOCAL_MODULE_SUFFIX) 48 endif 49 LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) 50 51 ifneq ($(strip $(LOCAL_MODULE)),) 52 $(error $(LOCAL_PATH): Package modules may not define LOCAL_MODULE) 53 endif 54 LOCAL_MODULE := $(LOCAL_PACKAGE_NAME) 55 56 ifeq ($(strip $(LOCAL_MANIFEST_FILE)),) 57 LOCAL_MANIFEST_FILE := AndroidManifest.xml 58 endif 59 60 # If you need to put the MANIFEST_FILE outside of LOCAL_PATH 61 # you can use FULL_MANIFEST_FILE 62 ifeq ($(strip $(LOCAL_FULL_MANIFEST_FILE)),) 63 LOCAL_FULL_MANIFEST_FILE := $(LOCAL_PATH)/$(LOCAL_MANIFEST_FILE) 64 endif 65 66 ifneq ($(strip $(LOCAL_MODULE_CLASS)),) 67 $(error $(LOCAL_PATH): Package modules may not set LOCAL_MODULE_CLASS) 68 endif 69 LOCAL_MODULE_CLASS := APPS 70 71 # Package LOCAL_MODULE_TAGS default to optional 72 LOCAL_MODULE_TAGS := $(strip $(LOCAL_MODULE_TAGS)) 73 ifeq ($(LOCAL_MODULE_TAGS),) 74 LOCAL_MODULE_TAGS := optional 75 endif 76 77 ifeq ($(filter tests, $(LOCAL_MODULE_TAGS)),) 78 # Force localization check if it's not tagged as tests. 79 LOCAL_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) -z 80 endif 81 82 ifeq (,$(LOCAL_ASSET_DIR)) 83 LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets 84 endif 85 86 ifeq (,$(LOCAL_RESOURCE_DIR)) 87 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res 88 endif 89 90 package_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 96 LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR) 97 98 all_assets := $(call find-subdir-assets,$(LOCAL_ASSET_DIR)) 99 all_assets := $(addprefix $(LOCAL_ASSET_DIR)/,$(patsubst assets/%,%,$(all_assets))) 100 101 all_resources := $(strip \ 102 $(foreach dir, $(LOCAL_RESOURCE_DIR), \ 103 $(addprefix $(dir)/, \ 104 $(patsubst res/%,%, \ 105 $(call find-subdir-assets,$(dir)) \ 106 ) \ 107 ) \ 108 )) 109 110 all_res_assets := $(strip $(all_assets) $(all_resources)) 111 112 package_expected_intermediates_COMMON := $(call local-intermediates-dir,COMMON) 113 # If no assets or resources were found, clear the directory variables so 114 # we don't try to build them. 115 ifeq (,$(all_assets)) 116 LOCAL_ASSET_DIR:= 117 endif 118 ifeq (,$(all_resources)) 119 LOCAL_RESOURCE_DIR:= 120 R_file_stamp := 121 else 122 # Make sure that R_file_stamp inherits the proper PRIVATE vars. 123 # If R.stamp moves, be sure to update the framework makefile, 124 # which has intimate knowledge of its location. 125 R_file_stamp := $(package_expected_intermediates_COMMON)/src/R.stamp 126 LOCAL_INTERMEDIATE_TARGETS += $(R_file_stamp) 127 endif 128 129 LOCAL_BUILT_MODULE_STEM := package.apk 130 131 LOCAL_PROGUARD_ENABLED:=$(strip $(LOCAL_PROGUARD_ENABLED)) 132 ifndef LOCAL_PROGUARD_ENABLED 133 ifneq ($(DISABLE_PROGUARD),true) 134 ifneq ($(filter user userdebug, $(TARGET_BUILD_VARIANT)),) 135 # turn on Proguard by default for user & userdebug build 136 LOCAL_PROGUARD_ENABLED :=full 137 endif 138 endif 139 endif 140 ifeq ($(LOCAL_PROGUARD_ENABLED),disabled) 141 # the package explicitly request to disable proguard. 142 LOCAL_PROGUARD_ENABLED := 143 endif 144 proguard_options_file := 145 ifneq ($(LOCAL_PROGUARD_ENABLED),custom) 146 ifneq ($(all_resources),) 147 proguard_options_file := $(package_expected_intermediates_COMMON)/proguard_options 148 endif # all_resources 149 endif # !custom 150 LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS) 151 152 ifneq (true,$(WITH_DEXPREOPT)) 153 LOCAL_DEX_PREOPT := 154 else 155 ifeq (,$(TARGET_BUILD_APPS)) 156 ifeq (,$(LOCAL_APK_LIBRARIES)) 157 ifneq (,$(LOCAL_SRC_FILES)) 158 ifndef LOCAL_DEX_PREOPT 159 LOCAL_DEX_PREOPT := true 160 endif 161 endif 162 endif 163 endif 164 endif 165 ifeq (false,$(LOCAL_DEX_PREOPT)) 166 LOCAL_DEX_PREOPT := 167 endif 168 169 ifeq (true,$(EMMA_INSTRUMENT)) 170 ifndef LOCAL_EMMA_INSTRUMENT 171 # No emma for test apks. 172 ifeq (,$(filer tests,$(LOCAL_MODULE_TAGS))$(LOCAL_INSTRUMENTATION_FOR)) 173 LOCAL_EMMA_INSTRUMENT := true 174 endif # No test apk 175 endif # LOCAL_EMMA_INSTRUMENT is not set 176 else 177 LOCAL_EMMA_INSTRUMENT := false 178 endif # EMMA_INSTRUMENT is true 179 180 ifeq (true,$(LOCAL_EMMA_INSTRUMENT)) 181 ifeq (true,$(EMMA_INSTRUMENT_STATIC)) 182 LOCAL_STATIC_JAVA_LIBRARIES += emma 183 else 184 ifdef LOCAL_SDK_VERSION 185 ifdef TARGET_BUILD_APPS 186 # In unbundled build merge the emma library into the apk. 187 LOCAL_STATIC_JAVA_LIBRARIES += emma 188 else 189 # If build against the SDK in full build, core.jar is not used, 190 # we have to use prebiult emma.jar to make Proguard happy; 191 # Otherwise emma classes are included in core.jar. 192 LOCAL_PROGUARD_FLAGS += -libraryjars $(EMMA_JAR) 193 endif # full build 194 endif # LOCAL_SDK_VERSION 195 endif # EMMA_INSTRUMENT_STATIC 196 endif # LOCAL_EMMA_INSTRUMENT 197 198 rs_compatibility_jni_libs := 199 200 ################################# 201 include $(BUILD_SYSTEM)/java.mk 202 ################################# 203 204 LOCAL_SDK_RES_VERSION:=$(strip $(LOCAL_SDK_RES_VERSION)) 205 ifeq ($(LOCAL_SDK_RES_VERSION),) 206 LOCAL_SDK_RES_VERSION:=$(LOCAL_SDK_VERSION) 207 endif 208 209 full_android_manifest := $(LOCAL_FULL_MANIFEST_FILE) 210 $(LOCAL_INTERMEDIATE_TARGETS): \ 211 PRIVATE_ANDROID_MANIFEST := $(full_android_manifest) 212 ifneq (,$(filter-out current, $(LOCAL_SDK_VERSION))) 213 $(LOCAL_INTERMEDIATE_TARGETS): \ 214 PRIVATE_DEFAULT_APP_TARGET_SDK := $(LOCAL_SDK_VERSION) 215 else 216 $(LOCAL_INTERMEDIATE_TARGETS): \ 217 PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK) 218 endif 219 220 ifneq ($(all_resources),) 221 222 # Since we don't know where the real R.java file is going to end up, 223 # we need to use another file to stand in its place. We'll just 224 # copy the generated file to src/R.stamp, which means it will 225 # have the same contents and timestamp as the actual file. 226 # 227 # At the same time, this will copy the R.java file to a central 228 # 'R' directory to make it easier to add the files to an IDE. 229 # 230 #TODO: use PRIVATE_SOURCE_INTERMEDIATES_DIR instead of 231 # $(intermediates.COMMON)/src 232 ifneq ($(package_expected_intermediates_COMMON),$(intermediates.COMMON)) 233 $(error $(LOCAL_MODULE): internal error: expected intermediates.COMMON "$(package_expected_intermediates_COMMON)" != intermediates.COMMON "$(intermediates.COMMON)") 234 endif 235 236 $(R_file_stamp): PRIVATE_RESOURCE_PUBLICS_OUTPUT := \ 237 $(intermediates.COMMON)/public_resources.xml 238 $(R_file_stamp): PRIVATE_PROGUARD_OPTIONS_FILE := $(proguard_options_file) 239 $(R_file_stamp): $(all_res_assets) $(full_android_manifest) $(RenderScript_file_stamp) $(AAPT) | $(ACP) 240 @echo "target R.java/Manifest.java: $(PRIVATE_MODULE) ($@)" 241 @rm -f $@ 242 $(create-resource-java-files) 243 $(hide) for GENERATED_MANIFEST_FILE in `find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) \ 244 -name Manifest.java 2> /dev/null`; do \ 245 dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_MANIFEST_FILE`; \ 246 mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \ 247 $(ACP) -fp $$GENERATED_MANIFEST_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \ 248 done; 249 $(hide) for GENERATED_R_FILE in `find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) \ 250 -name R.java 2> /dev/null`; do \ 251 dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_R_FILE`; \ 252 mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \ 253 $(ACP) -fp $$GENERATED_R_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir \ 254 || exit 31; \ 255 $(ACP) -fp $$GENERATED_R_FILE $@ || exit 32; \ 256 done; \ 257 258 $(proguard_options_file): $(R_file_stamp) 259 260 ifdef LOCAL_EXPORT_PACKAGE_RESOURCES 261 # Put this module's resources into a PRODUCT-agnositc package that 262 # other packages can use to build their own PRODUCT-agnostic R.java (etc.) 263 # files. 264 resource_export_package := $(intermediates.COMMON)/package-export.apk 265 $(R_file_stamp): $(resource_export_package) 266 267 # add-assets-to-package looks at PRODUCT_AAPT_CONFIG, but this target 268 # can't know anything about PRODUCT. Clear it out just for this target. 269 $(resource_export_package): PRIVATE_PRODUCT_AAPT_CONFIG := 270 $(resource_export_package): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := 271 $(resource_export_package): $(all_res_assets) $(full_android_manifest) $(RenderScript_file_stamp) $(AAPT) 272 @echo "target Export Resources: $(PRIVATE_MODULE) ($@)" 273 $(create-empty-package) 274 $(add-assets-to-package) 275 endif 276 277 # Other modules should depend on the BUILT module if 278 # they want to use this module's R.java file. 279 $(LOCAL_BUILT_MODULE): $(R_file_stamp) 280 281 ifneq ($(full_classes_jar),) 282 # If full_classes_jar is non-empty, we're building sources. 283 # If we're building sources, the initial javac step (which 284 # produces full_classes_compiled_jar) needs to ensure the 285 # R.java and Manifest.java files have been generated first. 286 $(full_classes_compiled_jar): $(R_file_stamp) 287 endif 288 289 endif # all_resources 290 291 ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true) 292 # We need to explicitly clear this var so that we don't 293 # inherit the value from whomever caused us to be built. 294 $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_INCLUDES := 295 else 296 # Most packages should link against the resources defined by framework-res. 297 # Even if they don't have their own resources, they may use framework 298 # resources. 299 ifneq ($(filter-out current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current,$(LOCAL_SDK_RES_VERSION))),) 300 # for released sdk versions, the platform resources were built into android.jar. 301 framework_res_package_export := \ 302 $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_RES_VERSION)/android.jar 303 framework_res_package_export_deps := $(framework_res_package_export) 304 else # LOCAL_SDK_RES_VERSION 305 framework_res_package_export := \ 306 $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk 307 # We can't depend directly on the export.apk file; it won't get its 308 # PRIVATE_ vars set up correctly if we do. Instead, depend on the 309 # corresponding R.stamp file, which lists the export.apk as a dependency. 310 framework_res_package_export_deps := \ 311 $(dir $(framework_res_package_export))src/R.stamp 312 endif # LOCAL_SDK_RES_VERSION 313 $(R_file_stamp): $(framework_res_package_export_deps) 314 $(LOCAL_INTERMEDIATE_TARGETS): \ 315 PRIVATE_AAPT_INCLUDES := $(framework_res_package_export) 316 endif # LOCAL_NO_STANDARD_LIBRARIES 317 318 ifneq ($(full_classes_jar),) 319 $(LOCAL_BUILT_MODULE): PRIVATE_DEX_FILE := $(built_dex) 320 $(LOCAL_BUILT_MODULE): $(built_dex) 321 endif # full_classes_jar 322 323 324 # Get the list of jni libraries to be included in the apk file. 325 326 so_suffix := $($(my_prefix)SHLIB_SUFFIX) 327 328 jni_shared_libraries := \ 329 $(addprefix $($(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \ 330 $(addsuffix $(so_suffix), \ 331 $(LOCAL_JNI_SHARED_LIBRARIES))) 332 333 # Include RS dynamically-generated libraries as well 334 # Keep this ifneq, as the += otherwise adds spaces that need to be stripped. 335 ifneq ($(rs_compatibility_jni_libs),) 336 jni_shared_libraries += $(rs_compatibility_jni_libs) 337 endif 338 339 # App explicitly requires the prebuilt NDK libstlport_shared.so. 340 # libstlport_shared.so should never go to the system image. 341 # Instead it should be packaged into the apk. 342 ifeq (stlport_shared,$(LOCAL_NDK_STL_VARIANT)) 343 ifndef LOCAL_SDK_VERSION 344 $(error LOCAL_SDK_VERSION has to be defined together with LOCAL_NDK_STL_VARIANT, \ 345 LOCAL_PACKAGE_NAME=$(LOCAL_PACKAGE_NAME)) 346 endif 347 jni_shared_libraries += \ 348 $(HISTORICAL_NDK_VERSIONS_ROOT)/current/sources/cxx-stl/stlport/libs/$(TARGET_CPU_ABI)/libstlport_shared.so 349 endif 350 351 # Set the abi directory used by the local JNI shared libraries. 352 # (Doesn't change how the local shared libraries are compiled, just 353 # sets where they are stored in the apk.) 354 355 ifeq ($(LOCAL_JNI_SHARED_LIBRARIES_ABI),) 356 jni_shared_libraries_abi := $(TARGET_CPU_ABI) 357 else 358 jni_shared_libraries_abi := $(LOCAL_JNI_SHARED_LIBRARIES_ABI) 359 endif 360 361 # Pick a key to sign the package with. If this package hasn't specified 362 # an explicit certificate, use the default. 363 # Secure release builds will have their packages signed after the fact, 364 # so it's ok for these private keys to be in the clear. 365 ifeq ($(LOCAL_CERTIFICATE),) 366 LOCAL_CERTIFICATE := $(DEFAULT_SYSTEM_DEV_CERTIFICATE) 367 endif 368 369 ifeq ($(LOCAL_CERTIFICATE),EXTERNAL) 370 # The special value "EXTERNAL" means that we will sign it with the 371 # default devkey, apply predexopt, but then expect the final .apk 372 # (after dexopting) to be signed by an outside tool. 373 LOCAL_CERTIFICATE := $(DEFAULT_SYSTEM_DEV_CERTIFICATE) 374 PACKAGES.$(LOCAL_PACKAGE_NAME).EXTERNAL_KEY := 1 375 endif 376 377 # If this is not an absolute certificate, assign it to a generic one. 378 ifeq ($(dir $(strip $(LOCAL_CERTIFICATE))),./) 379 LOCAL_CERTIFICATE := $(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))$(LOCAL_CERTIFICATE) 380 endif 381 private_key := $(LOCAL_CERTIFICATE).pk8 382 certificate := $(LOCAL_CERTIFICATE).x509.pem 383 384 $(LOCAL_BUILT_MODULE): $(private_key) $(certificate) $(SIGNAPK_JAR) 385 $(LOCAL_BUILT_MODULE): PRIVATE_PRIVATE_KEY := $(private_key) 386 $(LOCAL_BUILT_MODULE): PRIVATE_CERTIFICATE := $(certificate) 387 388 PACKAGES.$(LOCAL_PACKAGE_NAME).PRIVATE_KEY := $(private_key) 389 PACKAGES.$(LOCAL_PACKAGE_NAME).CERTIFICATE := $(certificate) 390 391 $(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(foreach c,\ 392 $(LOCAL_ADDITIONAL_CERTIFICATES), $(c).x509.pem $(c).pk8) 393 394 # Define the rule to build the actual package. 395 $(LOCAL_BUILT_MODULE): $(AAPT) | $(ZIPALIGN) 396 ifdef LOCAL_DEX_PREOPT 397 # Make sure the boot jars get dexpreopt-ed first 398 $(LOCAL_BUILT_MODULE): $(DEXPREOPT_BOOT_ODEXS) | $(DEXPREOPT) $(DEXOPT) 399 endif 400 $(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries) 401 $(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES_ABI := $(jni_shared_libraries_abi) 402 ifneq ($(TARGET_BUILD_APPS),) 403 # Include all resources for unbundled apps. 404 LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true 405 endif 406 ifeq ($(LOCAL_AAPT_INCLUDE_ALL_RESOURCES),true) 407 $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_CONFIG := 408 $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := 409 else 410 $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_CONFIG := $(PRODUCT_AAPT_CONFIG) 411 $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := $(PRODUCT_AAPT_PREF_CONFIG) 412 endif 413 $(LOCAL_BUILT_MODULE): $(all_res_assets) $(jni_shared_libraries) $(full_android_manifest) 414 @echo "target Package: $(PRIVATE_MODULE) ($@)" 415 $(create-empty-package) 416 $(add-assets-to-package) 417 ifneq ($(jni_shared_libraries),) 418 $(add-jni-shared-libs-to-package) 419 endif 420 ifneq ($(full_classes_jar),) 421 $(add-dex-to-package) 422 endif 423 $(add-carried-java-resources) 424 ifneq ($(extra_jar_args),) 425 $(add-java-resources-to-package) 426 endif 427 $(sign-package) 428 ifdef LOCAL_DEX_PREOPT 429 $(hide) rm -f $(patsubst %.apk,%.odex,$@) 430 $(call dexpreopt-one-file,$@,$(patsubst %.apk,%.odex,$@)) 431 ifneq (nostripping,$(LOCAL_DEX_PREOPT)) 432 $(call dexpreopt-remove-classes.dex,$@) 433 endif 434 endif 435 @# Alignment must happen after all other zip operations. 436 $(align-package) 437 438 ifdef LOCAL_DEX_PREOPT 439 built_odex := $(basename $(LOCAL_BUILT_MODULE)).odex 440 $(built_odex): $(LOCAL_BUILT_MODULE) 441 endif 442 443 # Save information about this package 444 PACKAGES.$(LOCAL_PACKAGE_NAME).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES)) 445 PACKAGES.$(LOCAL_PACKAGE_NAME).RESOURCE_FILES := $(all_resources) 446 ifdef package_resource_overlays 447 PACKAGES.$(LOCAL_PACKAGE_NAME).RESOURCE_OVERLAYS := $(package_resource_overlays) 448 endif 449 450 PACKAGES := $(PACKAGES) $(LOCAL_PACKAGE_NAME) 451 452 # Dist the files that can be bundled in system.img. 453 # They include the jni shared libraries and the apk with jni libraries stripped. 454 ifeq ($(LOCAL_DIST_BUNDLED_BINARIES),true) 455 ifneq ($(filter $(LOCAL_PACKAGE_NAME),$(TARGET_BUILD_APPS)),) 456 ifneq ($(strip $(jni_shared_libraries)),) 457 dist_subdir := bundled_$(LOCAL_PACKAGE_NAME) 458 $(foreach f, $(jni_shared_libraries), \ 459 $(call dist-for-goals, apps_only, $(f):$(dist_subdir)/$(notdir $(f)))) 460 461 apk_jni_stripped := $(intermediates)/jni_stripped/package.apk 462 $(apk_jni_stripped): PRIVATE_JNI_SHARED_LIBRARIES := $(notdir $(jni_shared_libraries)) 463 $(apk_jni_stripped) : $(LOCAL_BUILT_MODULE) | $(ZIPALIGN) 464 @rm -rf $(dir $@) && mkdir -p $(dir $@) 465 $(hide) cp $< $@ 466 $(hide) zip -d $@ $(foreach f,$(PRIVATE_JNI_SHARED_LIBRARIES),\*/$(f)) 467 $(call align-package) 468 469 $(call dist-for-goals, apps_only, $(apk_jni_stripped):$(dist_subdir)/$(LOCAL_PACKAGE_NAME).apk) 470 471 endif # jni_shared_libraries 472 endif # apps_only build 473 endif # LOCAL_DIST_BUNDLED_BINARIES 474 475 # Lint phony targets 476 .PHONY: lint-$(LOCAL_PACKAGE_NAME) 477 lint-$(LOCAL_PACKAGE_NAME): PRIVATE_PATH := $(LOCAL_PATH) 478 lint-$(LOCAL_PACKAGE_NAME): PRIVATE_LINT_FLAGS := $(LOCAL_LINT_FLAGS) 479 lint-$(LOCAL_PACKAGE_NAME) : 480 @echo lint $(PRIVATE_PATH) 481 $(LINT) $(PRIVATE_LINT_FLAGS) $(PRIVATE_PATH) 482 483 lintall : lint-$(LOCAL_PACKAGE_NAME) 484 485 endif # skip_definition 486