1# Only use ANDROID_BUILD_SHELL to wrap around bash. 2# DO NOT use other shells such as zsh. 3ifdef ANDROID_BUILD_SHELL 4SHELL := $(ANDROID_BUILD_SHELL) 5else 6# Use bash, not whatever shell somebody has installed as /bin/sh 7# This is repeated in config.mk, since envsetup.sh runs that file 8# directly. 9SHELL := /bin/bash 10endif 11 12ifndef KATI 13 14host_prebuilts := linux-x86 15ifeq ($(shell uname),Darwin) 16host_prebuilts := darwin-x86 17endif 18 19.PHONY: run_soong_ui 20run_soong_ui: 21 +@prebuilts/build-tools/$(host_prebuilts)/bin/makeparallel --ninja build/soong/soong_ui.bash --make-mode $(MAKECMDGOALS) 22 23.PHONY: $(MAKECMDGOALS) 24$(sort $(MAKECMDGOALS)) : run_soong_ui 25 @#empty 26 27else # KATI 28 29$(info [1/1] initializing build system ...) 30 31# Absolute path of the present working direcotry. 32# This overrides the shell variable $PWD, which does not necessarily points to 33# the top of the source tree, for example when "make -C" is used in m/mm/mmm. 34PWD := $(shell pwd) 35 36TOP := . 37TOPDIR := 38 39# This is the default target. It must be the first declared target. 40.PHONY: droid 41DEFAULT_GOAL := droid 42$(DEFAULT_GOAL): droid_targets 43 44.PHONY: droid_targets 45droid_targets: 46 47# Set up various standard variables based on configuration 48# and host information. 49include build/make/core/config.mk 50 51ifneq ($(filter $(dont_bother_goals), $(MAKECMDGOALS)),) 52dont_bother := true 53endif 54 55.KATI_READONLY := SOONG_CONFIG_NAMESPACES 56.KATI_READONLY := $(foreach n,$(SOONG_CONFIG_NAMESPACES),SOONG_CONFIG_$(n)) 57.KATI_READONLY := $(foreach n,$(SOONG_CONFIG_NAMESPACES),$(foreach k,$(SOONG_CONFIG_$(n)),SOONG_CONFIG_$(n)_$(k))) 58 59include $(SOONG_MAKEVARS_MK) 60 61include $(BUILD_SYSTEM)/clang/config.mk 62 63# Write the build number to a file so it can be read back in 64# without changing the command line every time. Avoids rebuilds 65# when using ninja. 66$(shell mkdir -p $(OUT_DIR) && \ 67 echo -n $(BUILD_NUMBER) > $(OUT_DIR)/build_number.txt) 68BUILD_NUMBER_FILE := $(OUT_DIR)/build_number.txt 69.KATI_READONLY := BUILD_NUMBER_FILE 70$(KATI_obsolete_var BUILD_NUMBER,See https://android.googlesource.com/platform/build/+/master/Changes.md#BUILD_NUMBER) 71 72ifeq ($(HOST_OS),darwin) 73DATE_FROM_FILE := date -r $(BUILD_DATETIME_FROM_FILE) 74else 75DATE_FROM_FILE := date -d @$(BUILD_DATETIME_FROM_FILE) 76endif 77.KATI_READONLY := DATE_FROM_FILE 78 79# Pick a reasonable string to use to identify files. 80ifeq ($(strip $(HAS_BUILD_NUMBER)),false) 81 # BUILD_NUMBER has a timestamp in it, which means that 82 # it will change every time. Pick a stable value. 83 FILE_NAME_TAG := eng.$(BUILD_USERNAME) 84else 85 FILE_NAME_TAG := $(file <$(BUILD_NUMBER_FILE)) 86endif 87.KATI_READONLY := FILE_NAME_TAG 88 89# Make an empty directory, which can be used to make empty jars 90EMPTY_DIRECTORY := $(OUT_DIR)/empty 91$(shell mkdir -p $(EMPTY_DIRECTORY) && rm -rf $(EMPTY_DIRECTORY)/*) 92 93# CTS-specific config. 94-include cts/build/config.mk 95# VTS-specific config. 96-include test/vts/tools/vts-tradefed/build/config.mk 97# device-tests-specific-config. 98-include tools/tradefederation/build/suites/device-tests/config.mk 99# general-tests-specific-config. 100-include tools/tradefederation/build/suites/general-tests/config.mk 101# STS-specific config. 102-include test/sts/tools/sts-tradefed/build/config.mk 103# CTS-Instant-specific config 104-include test/suite_harness/tools/cts-instant-tradefed/build/config.mk 105 106# Clean rules 107.PHONY: clean-dex-files 108clean-dex-files: 109 $(hide) find $(OUT_DIR) -name "*.dex" | xargs rm -f 110 $(hide) for i in `find $(OUT_DIR) -name "*.jar" -o -name "*.apk"` ; do ((unzip -l $$i 2> /dev/null | \ 111 grep -q "\.dex$$" && rm -f $$i) || continue ) ; done 112 @echo "All dex files and archives containing dex files have been removed." 113 114# Include the google-specific config 115-include vendor/google/build/config.mk 116 117# These are the modifier targets that don't do anything themselves, but 118# change the behavior of the build. 119# (must be defined before including definitions.make) 120INTERNAL_MODIFIER_TARGETS := all 121 122# EMMA_INSTRUMENT_STATIC merges the static jacoco library to each 123# jacoco-enabled module. 124ifeq (true,$(EMMA_INSTRUMENT_STATIC)) 125EMMA_INSTRUMENT := true 126endif 127 128ifeq (true,$(EMMA_INSTRUMENT)) 129# Adding the jacoco library can cause the inclusion of 130# some typically banned classes 131# So if the user didn't specify SKIP_BOOT_JARS_CHECK, enable it here 132ifndef SKIP_BOOT_JARS_CHECK 133SKIP_BOOT_JARS_CHECK := true 134endif 135endif 136 137# 138# ----------------------------------------------------------------- 139# Validate ADDITIONAL_DEFAULT_PROPERTIES. 140ifneq ($(ADDITIONAL_DEFAULT_PROPERTIES),) 141$(error ADDITIONAL_DEFAULT_PROPERTIES must not be set before here: $(ADDITIONAL_DEFAULT_PROPERTIES)) 142endif 143 144# 145# ----------------------------------------------------------------- 146# Validate ADDITIONAL_BUILD_PROPERTIES. 147ifneq ($(ADDITIONAL_BUILD_PROPERTIES),) 148$(error ADDITIONAL_BUILD_PROPERTIES must not be set before here: $(ADDITIONAL_BUILD_PROPERTIES)) 149endif 150 151ADDITIONAL_BUILD_PROPERTIES := 152 153# 154# ----------------------------------------------------------------- 155# Validate ADDITIONAL_PRODUCT_PROPERTIES. 156ifneq ($(ADDITIONAL_PRODUCT_PROPERTIES),) 157$(error ADDITIONAL_PRODUCT_PROPERTIES must not be set before here: $(ADDITIONAL_PRODUCT_PROPERTIES)) 158endif 159 160ADDITIONAL_PRODUCT_PROPERTIES := 161 162# 163# ----------------------------------------------------------------- 164# Add the product-defined properties to the build properties. 165ifdef PRODUCT_SHIPPING_API_LEVEL 166ADDITIONAL_BUILD_PROPERTIES += \ 167 ro.product.first_api_level=$(PRODUCT_SHIPPING_API_LEVEL) 168endif 169 170ifneq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true) 171 ADDITIONAL_BUILD_PROPERTIES += $(PRODUCT_PROPERTY_OVERRIDES) 172else 173 ifndef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE 174 ADDITIONAL_BUILD_PROPERTIES += $(PRODUCT_PROPERTY_OVERRIDES) 175 endif 176endif 177 178 179# Bring in standard build system definitions. 180include $(BUILD_SYSTEM)/definitions.mk 181 182# Bring in dex_preopt.mk 183include $(BUILD_SYSTEM)/dex_preopt.mk 184 185ifneq ($(filter user userdebug eng,$(MAKECMDGOALS)),) 186$(info ***************************************************************) 187$(info ***************************************************************) 188$(info Do not pass '$(filter user userdebug eng,$(MAKECMDGOALS))' on \ 189 the make command line.) 190$(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or) 191$(info choosecombo.) 192$(info ***************************************************************) 193$(info ***************************************************************) 194$(error stopping) 195endif 196 197ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),) 198$(info ***************************************************************) 199$(info ***************************************************************) 200$(info Invalid variant: $(TARGET_BUILD_VARIANT)) 201$(info Valid values are: $(INTERNAL_VALID_VARIANTS)) 202$(info ***************************************************************) 203$(info ***************************************************************) 204$(error stopping) 205endif 206 207# ----------------------------------------------------------------- 208# Variable to check java support level inside PDK build. 209# Not necessary if the components is not in PDK. 210# not defined : not supported 211# "sdk" : sdk API only 212# "platform" : platform API supproted 213TARGET_BUILD_JAVA_SUPPORT_LEVEL := platform 214 215# ----------------------------------------------------------------- 216# The pdk (Platform Development Kit) build 217include build/make/core/pdk_config.mk 218 219# 220# ----------------------------------------------------------------- 221# Enable dynamic linker warnings for userdebug, eng and non-REL builds 222ifneq ($(TARGET_BUILD_VARIANT),user) 223 ADDITIONAL_BUILD_PROPERTIES += ro.bionic.ld.warning=1 224else 225# Enable it for user builds as long as they are not final. 226ifneq ($(PLATFORM_VERSION_CODENAME),REL) 227 ADDITIONAL_BUILD_PROPERTIES += ro.bionic.ld.warning=1 228endif 229endif 230 231ADDITIONAL_BUILD_PROPERTIES += ro.treble.enabled=${PRODUCT_FULL_TREBLE} 232 233$(KATI_obsolete_var PRODUCT_FULL_TREBLE,\ 234 Code should be written to work regardless of a device being Treble or \ 235 variables like PRODUCT_SEPOLICY_SPLIT should be used until that is \ 236 possible.) 237 238# Sets ro.actionable_compatible_property.enabled to know on runtime whether the whitelist 239# of actionable compatible properties is enabled or not. 240ifeq ($(PRODUCT_ACTIONABLE_COMPATIBLE_PROPERTY_DISABLE),true) 241ADDITIONAL_DEFAULT_PROPERTIES += ro.actionable_compatible_property.enabled=false 242else 243ADDITIONAL_DEFAULT_PROPERTIES += ro.actionable_compatible_property.enabled=${PRODUCT_COMPATIBLE_PROPERTY} 244endif 245 246# Add the system server compiler filter if they are specified for the product. 247ifneq (,$(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER)) 248ADDITIONAL_PRODUCT_PROPERTIES += dalvik.vm.systemservercompilerfilter=$(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER) 249endif 250 251# Enable core platform API violation warnings on userdebug and eng builds. 252ifneq ($(TARGET_BUILD_VARIANT),user) 253ADDITIONAL_BUILD_PROPERTIES += persist.debug.dalvik.vm.core_platform_api_policy=just-warn 254endif 255 256# Sets the default value of ro.postinstall.fstab.prefix to /system. 257# Device board config should override the value to /product when needed by: 258# 259# PRODUCT_PRODUCT_PROPERTIES += ro.postinstall.fstab.prefix=/product 260# 261# It then uses ${ro.postinstall.fstab.prefix}/etc/fstab.postinstall to 262# mount system_other partition. 263ADDITIONAL_DEFAULT_PROPERTIES += ro.postinstall.fstab.prefix=/system 264 265# ----------------------------------------------------------------- 266### 267### In this section we set up the things that are different 268### between the build variants 269### 270 271is_sdk_build := 272 273ifneq ($(filter sdk win_sdk sdk_addon,$(MAKECMDGOALS)),) 274is_sdk_build := true 275endif 276 277## user/userdebug ## 278 279user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT)) 280enable_target_debugging := true 281tags_to_install := 282ifneq (,$(user_variant)) 283 # Target is secure in user builds. 284 ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1 285 ADDITIONAL_DEFAULT_PROPERTIES += security.perf_harden=1 286 287 ifeq ($(user_variant),user) 288 ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1 289 endif 290 291 ifeq ($(user_variant),userdebug) 292 # Pick up some extra useful tools 293 tags_to_install += debug 294 else 295 # Disable debugging in plain user builds. 296 enable_target_debugging := 297 endif 298 299 # Disallow mock locations by default for user builds 300 ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=0 301 302else # !user_variant 303 # Turn on checkjni for non-user builds. 304 ADDITIONAL_BUILD_PROPERTIES += ro.kernel.android.checkjni=1 305 # Set device insecure for non-user builds. 306 ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0 307 # Allow mock locations by default for non user builds 308 ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=1 309endif # !user_variant 310 311ifeq (true,$(strip $(enable_target_debugging))) 312 # Target is more debuggable and adbd is on by default 313 ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1 314 # Enable Dalvik lock contention logging. 315 ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500 316else # !enable_target_debugging 317 # Target is less debuggable and adbd is off by default 318 ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0 319endif # !enable_target_debugging 320 321## eng ## 322 323ifeq ($(TARGET_BUILD_VARIANT),eng) 324tags_to_install := debug eng 325ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))),) 326 # Don't require the setup wizard on eng builds 327 ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\ 328 $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))) \ 329 ro.setupwizard.mode=OPTIONAL 330endif 331ifndef is_sdk_build 332 # To speedup startup of non-preopted builds, don't verify or compile the boot image. 333 ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.image-dex2oat-filter=verify-at-runtime 334endif 335endif 336 337## asan ## 338 339# Install some additional tools on ASAN builds IFF we are also installing debug tools 340ifneq ($(filter address,$(SANITIZE_TARGET)),) 341ifneq (,$(filter debug,$(tags_to_install))) 342 tags_to_install += asan 343endif 344endif 345 346## sdk ## 347 348ifdef is_sdk_build 349 350# Detect if we want to build a repository for the SDK 351sdk_repo_goal := $(strip $(filter sdk_repo,$(MAKECMDGOALS))) 352MAKECMDGOALS := $(strip $(filter-out sdk_repo,$(MAKECMDGOALS))) 353 354ifneq ($(words $(sort $(filter-out $(INTERNAL_MODIFIER_TARGETS) checkbuild emulator_tests target-files-package,$(MAKECMDGOALS)))),1) 355$(error The 'sdk' target may not be specified with any other targets) 356endif 357 358# AUX dependencies are already added by now; remove triggers from the MAKECMDGOALS 359MAKECMDGOALS := $(strip $(filter-out AUX-%,$(MAKECMDGOALS))) 360 361# TODO: this should be eng I think. Since the sdk is built from the eng 362# variant. 363tags_to_install := debug eng 364ADDITIONAL_BUILD_PROPERTIES += xmpp.auto-presence=true 365ADDITIONAL_BUILD_PROPERTIES += ro.config.nocheckin=yes 366else # !sdk 367endif 368 369BUILD_WITHOUT_PV := true 370 371ADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android 372 373# ------------------------------------------------------------ 374# Define a function that, given a list of module tags, returns 375# non-empty if that module should be installed in /system. 376 377# For most goals, anything not tagged with the "tests" tag should 378# be installed in /system. 379define should-install-to-system 380$(if $(filter tests,$(1)),,true) 381endef 382 383ifdef is_sdk_build 384# For the sdk goal, anything with the "samples" tag should be 385# installed in /data even if that module also has "eng"/"debug"/"user". 386define should-install-to-system 387$(if $(filter samples tests,$(1)),,true) 388endef 389endif 390 391 392# If they only used the modifier goals (all, etc), we'll actually 393# build the default target. 394ifeq ($(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS)),) 395.PHONY: $(INTERNAL_MODIFIER_TARGETS) 396$(INTERNAL_MODIFIER_TARGETS): $(DEFAULT_GOAL) 397endif 398 399# 400# Typical build; include any Android.mk files we can find. 401# 402 403# Strip and readonly a few more variables so they won't be modified. 404$(readonly-final-product-vars) 405ADDITIONAL_DEFAULT_PROPERTIES := $(strip $(ADDITIONAL_DEFAULT_PROPERTIES)) 406.KATI_READONLY := ADDITIONAL_DEFAULT_PROPERTIES 407ADDITIONAL_BUILD_PROPERTIES := $(strip $(ADDITIONAL_BUILD_PROPERTIES)) 408.KATI_READONLY := ADDITIONAL_BUILD_PROPERTIES 409ADDITIONAL_PRODUCT_PROPERTIES := $(strip $(ADDITIONAL_PRODUCT_PROPERTIES)) 410.KATI_READONLY := ADDITIONAL_PRODUCT_PROPERTIES 411 412ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) 413ENFORCE_RRO_SOURCES := 414endif 415 416# Color-coded warnings including current module info 417# $(1): message to print 418define pretty-warning 419$(shell $(call echo-warning,$(LOCAL_MODULE_MAKEFILE),$(LOCAL_MODULE): $(1))) 420endef 421 422# Color-coded errors including current module info 423# $(1): message to print 424define pretty-error 425$(shell $(call echo-error,$(LOCAL_MODULE_MAKEFILE),$(LOCAL_MODULE): $(1))) 426$(error done) 427endef 428 429subdir_makefiles_inc := . 430FULL_BUILD := 431 432ifneq ($(ONE_SHOT_MAKEFILE),) 433# We've probably been invoked by the "mm" shell function 434# with a subdirectory's makefile. 435include $(SOONG_ANDROID_MK) $(wildcard $(ONE_SHOT_MAKEFILE)) 436# Change CUSTOM_MODULES to include only modules that were 437# defined by this makefile; this will install all of those 438# modules as a side-effect. Do this after including ONE_SHOT_MAKEFILE 439# so that the modules will be installed in the same place they 440# would have been with a normal make. 441CUSTOM_MODULES := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS))) 442 443# A helper goal printing out install paths 444define register_module_install_path 445.PHONY: GET-MODULE-INSTALL-PATH-$(1) 446GET-MODULE-INSTALL-PATH-$(1): 447 echo 'INSTALL-PATH: $(1) $(ALL_MODULES.$(1).INSTALLED)' 448endef 449 450SORTED_ALL_MODULES := $(sort $(ALL_MODULES)) 451UNIQUE_ALL_MODULES := 452$(foreach m,$(SORTED_ALL_MODULES),\ 453 $(if $(call streq,$(m),$(lastword $(UNIQUE_ALL_MODULES))),,\ 454 $(eval UNIQUE_ALL_MODULES += $(m)))) 455SORTED_ALL_MODULES := 456 457$(foreach mod,$(UNIQUE_ALL_MODULES),$(if $(ALL_MODULES.$(mod).INSTALLED),\ 458 $(eval $(call register_module_install_path,$(mod)))\ 459 $(foreach path,$(ALL_MODULES.$(mod).PATH),\ 460 $(eval my_path_prefix := GET-INSTALL-PATH-IN)\ 461 $(foreach component,$(subst /,$(space),$(path)),\ 462 $(eval my_path_prefix := $$(my_path_prefix)-$$(component))\ 463 $(eval .PHONY: $$(my_path_prefix))\ 464 $(eval $$(my_path_prefix): GET-MODULE-INSTALL-PATH-$(mod)))))) 465UNIQUE_ALL_MODULES := 466 467else # ONE_SHOT_MAKEFILE 468 469ifneq ($(dont_bother),true) 470FULL_BUILD := true 471# 472# Include all of the makefiles in the system 473# 474 475subdir_makefiles := $(SOONG_ANDROID_MK) $(file <$(OUT_DIR)/.module_paths/Android.mk.list) 476subdir_makefiles_total := $(words int $(subdir_makefiles) post finish) 477.KATI_READONLY := subdir_makefiles_total 478 479$(foreach mk,$(subdir_makefiles),$(info [$(call inc_and_print,subdir_makefiles_inc)/$(subdir_makefiles_total)] including $(mk) ...)$(eval include $(mk))) 480 481ifneq (,$(PDK_FUSION_PLATFORM_ZIP)$(PDK_FUSION_PLATFORM_DIR)) 482# Bring in the PDK platform.zip modules. 483include $(BUILD_SYSTEM)/pdk_fusion_modules.mk 484endif # PDK_FUSION_PLATFORM_ZIP || PDK_FUSION_PLATFORM_DIR 485 486droid_targets : blueprint_tools 487 488endif # dont_bother 489 490endif # ONE_SHOT_MAKEFILE 491 492ifndef subdir_makefiles_total 493subdir_makefiles_total := $(words init post finish) 494endif 495 496droid_targets: no_vendor_variant_vndk_check 497.PHONY: no_vendor_variant_vndk_check 498no_vendor_variant_vndk_check: 499 500$(info [$(call inc_and_print,subdir_makefiles_inc)/$(subdir_makefiles_total)] finishing build rules ...) 501 502# ------------------------------------------------------------------- 503# All module makefiles have been included at this point. 504# ------------------------------------------------------------------- 505 506# ------------------------------------------------------------------- 507# Use basic warning/error messages now that LOCAL_MODULE_MAKEFILE 508# and LOCAL_MODULE aren't useful anymore. 509# ------------------------------------------------------------------- 510define pretty-warning 511$(warning $(1)) 512endef 513 514define pretty-error 515$(error $(1)) 516endef 517 518# ------------------------------------------------------------------- 519# Enforce to generate all RRO packages for modules having resource 520# overlays. 521# ------------------------------------------------------------------- 522ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) 523$(call generate_all_enforce_rro_packages) 524endif 525 526# ------------------------------------------------------------------- 527# Fix up CUSTOM_MODULES to refer to installed files rather than 528# just bare module names. Leave unknown modules alone in case 529# they're actually full paths to a particular file. 530known_custom_modules := $(filter $(ALL_MODULES),$(CUSTOM_MODULES)) 531unknown_custom_modules := $(filter-out $(ALL_MODULES),$(CUSTOM_MODULES)) 532CUSTOM_MODULES := \ 533 $(call module-installed-files,$(known_custom_modules)) \ 534 $(unknown_custom_modules) 535 536# ------------------------------------------------------------------- 537# Define dependencies for modules that require other modules. 538# This can only happen now, after we've read in all module makefiles. 539# 540# TODO: deal with the fact that a bare module name isn't 541# unambiguous enough. Maybe declare short targets like 542# APPS:Quake or HOST:SHARED_LIBRARIES:libutils. 543# BUG: the system image won't know to depend on modules that are 544# brought in as requirements of other modules. 545# 546# Resolve the required module name to 32-bit or 64-bit variant. 547# Get a list of corresponding 32-bit module names, if one exists. 548ifneq ($(TARGET_TRANSLATE_2ND_ARCH),true) 549define get-32-bit-modules 550$(sort $(foreach m,$(1),\ 551 $(if $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).CLASS),\ 552 $(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX)))) 553endef 554# Get a list of corresponding 32-bit module names, if one exists; 555# otherwise return the original module name 556define get-32-bit-modules-if-we-can 557$(sort $(foreach m,$(1),\ 558 $(if $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).CLASS),\ 559 $(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX), \ 560 $(m)))) 561endef 562else # TARGET_TRANSLATE_2ND_ARCH 563# For binary translation config, by default only install the first arch. 564define get-32-bit-modules 565endef 566 567define get-32-bit-modules-if-we-can 568$(strip $(1)) 569endef 570endif # TARGET_TRANSLATE_2ND_ARCH 571 572# TODO: we can probably check to see if these modules are actually host 573# modules 574define get-host-32-bit-modules 575$(sort $(foreach m,$(1),\ 576 $(if $(ALL_MODULES.$(m)$(HOST_2ND_ARCH_MODULE_SUFFIX).CLASS),\ 577 $(m)$(HOST_2ND_ARCH_MODULE_SUFFIX)))) 578endef 579# Get a list of corresponding 32-bit module names, if one exists; 580# otherwise return the original module name 581define get-host-32-bit-modules-if-we-can 582$(sort $(foreach m,$(1),\ 583 $(if $(ALL_MODULES.$(m)$(HOST_2ND_ARCH_MODULE_SUFFIX).CLASS),\ 584 $(m)$(HOST_2ND_ARCH_MODULE_SUFFIX),\ 585 $(m)))) 586endef 587 588# If a module is for a cross host os, the required modules must be for 589# that OS too. 590# If a module is built for 32-bit, the required modules must be 32-bit too; 591# Otherwise if the module is an executable or shared library, 592# the required modules must be 64-bit; 593# otherwise we require both 64-bit and 32-bit variant, if one exists. 594define target-select-bitness-of-required-modules 595$(foreach m,$(ALL_MODULES),\ 596 $(eval r := $(ALL_MODULES.$(m).REQUIRED_FROM_TARGET))\ 597 $(if $(r),\ 598 $(if $(ALL_MODULES.$(m).FOR_2ND_ARCH),\ 599 $(eval r_r := $(call get-32-bit-modules-if-we-can,$(r))),\ 600 $(if $(filter EXECUTABLES SHARED_LIBRARIES NATIVE_TESTS,$(ALL_MODULES.$(m).CLASS)),\ 601 $(eval r_r := $(r)),\ 602 $(eval r_r := $(r) $(call get-32-bit-modules,$(r)))\ 603 )\ 604 )\ 605 $(eval ALL_MODULES.$(m).REQUIRED_FROM_TARGET := $(strip $(r_r)))\ 606 )\ 607) 608endef 609$(call target-select-bitness-of-required-modules) 610 611define host-select-bitness-of-required-modules 612$(foreach m,$(ALL_MODULES),\ 613 $(eval r := $(ALL_MODULES.$(m).REQUIRED_FROM_HOST))\ 614 $(if $(r),\ 615 $(if $(ALL_MODULES.$(m).FOR_2ND_ARCH),\ 616 $(eval r_r := $(call get-host-32-bit-modules-if-we-can,$(r))),\ 617 $(if $(filter EXECUTABLES SHARED_LIBRARIES NATIVE_TESTS,$(ALL_MODULES.$(m).CLASS)),\ 618 $(eval r_r := $(r)),\ 619 $(eval r_r := $(r) $(call get-host-32-bit-modules,$(r)))\ 620 )\ 621 )\ 622 $(eval ALL_MODULES.$(m).REQUIRED_FROM_HOST := $(strip $(r_r)))\ 623 )\ 624) 625endef 626$(call host-select-bitness-of-required-modules) 627 628define host-cross-select-bitness-of-required-modules 629$(foreach m,$(ALL_MODULES),\ 630 $(eval r := $(ALL_MODULES.$(m).REQUIRED_FROM_HOST_CROSS))\ 631 $(if $(r),\ 632 $(if $(ALL_MODULES.$(m).FOR_HOST_CROSS),,$(error Only expected REQUIRED_FROM_HOST_CROSS on FOR_HOST_CROSS modules - $(m)))\ 633 $(eval r := $(addprefix host_cross_,$(r)))\ 634 $(if $(ALL_MODULES.$(m).FOR_2ND_ARCH),\ 635 $(eval r_r := $(call get-host-32-bit-modules-if-we-can,$(r))),\ 636 $(if $(filter EXECUTABLES SHARED_LIBRARIES NATIVE_TESTS,$(ALL_MODULES.$(m).CLASS)),\ 637 $(eval r_r := $(r)),\ 638 $(eval r_r := $(r) $(call get-host-32-bit-modules,$(r)))\ 639 )\ 640 )\ 641 $(eval ALL_MODULES.$(m).REQUIRED_FROM_HOST_CROSS := $(strip $(r_r)))\ 642 )\ 643) 644endef 645$(call host-cross-select-bitness-of-required-modules) 646r_r := 647 648define add-required-deps 649$(1): | $(2) 650endef 651 652# Use a normal dependency instead of an order-only dependency when installing 653# host dynamic binaries so that the timestamp of the final binary always 654# changes, even if the toc optimization has skipped relinking the binary 655# and its dependant shared libraries. 656define add-required-host-so-deps 657$(1): $(2) 658endef 659 660# Sets up dependencies such that whenever a host module is installed, 661# any other host modules listed in $(ALL_MODULES.$(m).REQUIRED_FROM_HOST) will also be installed 662define add-all-host-to-host-required-modules-deps 663$(foreach m,$(ALL_MODULES), \ 664 $(eval r := $(ALL_MODULES.$(m).REQUIRED_FROM_HOST)) \ 665 $(if $(r), \ 666 $(eval r := $(call module-installed-files,$(r))) \ 667 $(eval h_m := $(filter $(HOST_OUT)/%, $(ALL_MODULES.$(m).INSTALLED))) \ 668 $(eval h_r := $(filter $(HOST_OUT)/%, $(r))) \ 669 $(eval h_m := $(filter-out $(h_r), $(h_m))) \ 670 $(if $(h_m), $(eval $(call add-required-deps, $(h_m),$(h_r)))) \ 671 ) \ 672) 673endef 674$(call add-all-host-to-host-required-modules-deps) 675 676# Sets up dependencies such that whenever a host cross module is installed, 677# any other host cross modules listed in $(ALL_MODULES.$(m).REQUIRED_FROM_HOST_CROSS) will also be installed 678define add-all-host-cross-to-host-cross-required-modules-deps 679$(foreach m,$(ALL_MODULES), \ 680 $(eval r := $(ALL_MODULES.$(m).REQUIRED_FROM_HOST_CROSS)) \ 681 $(if $(r), \ 682 $(eval r := $(call module-installed-files,$(r))) \ 683 $(eval hc_m := $(filter $(HOST_CROSS_OUT)/%, $(ALL_MODULES.$(m).INSTALLED))) \ 684 $(eval hc_r := $(filter $(HOST_CROSS_OUT)/%, $(r))) \ 685 $(eval hc_m := $(filter-out $(hc_r), $(hc_m))) \ 686 $(if $(hc_m), $(eval $(call add-required-deps, $(hc_m),$(hc_r)))) \ 687 ) \ 688) 689endef 690$(call add-all-host-cross-to-host-cross-required-modules-deps) 691 692# Sets up dependencies such that whenever a target module is installed, 693# any other target modules listed in $(ALL_MODULES.$(m).REQUIRED_FROM_TARGET) will also be installed 694define add-all-target-to-target-required-modules-deps 695$(foreach m,$(ALL_MODULES), \ 696 $(eval r := $(ALL_MODULES.$(m).REQUIRED_FROM_TARGET)) \ 697 $(if $(r), \ 698 $(eval r := $(call module-installed-files,$(r))) \ 699 $(eval t_m := $(filter $(TARGET_OUT_ROOT)/%, $(ALL_MODULES.$(m).INSTALLED))) \ 700 $(eval t_r := $(filter $(TARGET_OUT_ROOT)/%, $(r))) \ 701 $(eval t_m := $(filter-out $(t_r), $(t_m))) \ 702 $(if $(t_m), $(eval $(call add-required-deps, $(t_m),$(t_r)))) \ 703 ) \ 704) 705endef 706$(call add-all-target-to-target-required-modules-deps) 707 708# Sets up dependencies such that whenever a host module is installed, 709# any target modules listed in $(ALL_MODULES.$(m).TARGET_REQUIRED_FROM_HOST) will also be installed 710define add-all-host-to-target-required-modules-deps 711$(foreach m,$(ALL_MODULES), \ 712 $(eval req_mods := $(ALL_MODULES.$(m).TARGET_REQUIRED_FROM_HOST))\ 713 $(if $(req_mods), \ 714 $(eval req_files := )\ 715 $(foreach req_mod,$(req_mods), \ 716 $(eval req_file := $(filter $(TARGET_OUT_ROOT)/%, $(call module-installed-files,$(req_mod)))) \ 717 $(if $(strip $(req_file)),\ 718 ,\ 719 $(error $(m).LOCAL_TARGET_REQUIRED_MODULES : illegal value $(req_mod) : not a device module. If you want to specify host modules to be required to be installed along with your host module, add those module names to LOCAL_REQUIRED_MODULES instead)\ 720 )\ 721 $(eval req_files := $(req_files)$(space)$(req_file))\ 722 )\ 723 $(eval req_files := $(strip $(req_files)))\ 724 $(eval mod_files := $(filter $(HOST_OUT)/%, $(call module-installed-files,$(m)))) \ 725 $(eval mod_files := $(filter-out $(req_files),$(mod_files)))\ 726 $(if $(mod_files),\ 727 $(eval $(call add-required-deps, $(mod_files),$(req_files))) \ 728 )\ 729 )\ 730) 731endef 732$(call add-all-host-to-target-required-modules-deps) 733 734# Sets up dependencies such that whenever a target module is installed, 735# any host modules listed in $(ALL_MODULES.$(m).HOST_REQUIRED_FROM_TARGET) will also be installed 736define add-all-target-to-host-required-modules-deps 737$(foreach m,$(ALL_MODULES), \ 738 $(eval req_mods := $(ALL_MODULES.$(m).HOST_REQUIRED_FROM_TARGET))\ 739 $(if $(req_mods), \ 740 $(eval req_files := )\ 741 $(foreach req_mod,$(req_mods), \ 742 $(eval req_file := $(filter $(HOST_OUT)/%, $(call module-installed-files,$(req_mod)))) \ 743 $(if $(strip $(req_file)),\ 744 ,\ 745 $(error $(m).LOCAL_HOST_REQUIRED_MODULES : illegal value $(req_mod) : not a host module. If you want to specify target modules to be required to be installed along with your target module, add those module names to LOCAL_REQUIRED_MODULES instead)\ 746 )\ 747 $(eval req_files := $(req_files)$(space)$(req_file))\ 748 )\ 749 $(eval req_files := $(strip $(req_files)))\ 750 $(eval mod_files := $(filter $(TARGET_OUT_ROOT)/%, $(call module-installed-files,$(m))))\ 751 $(eval mod_files := $(filter-out $(req_files),$(mod_files)))\ 752 $(if $(mod_files),\ 753 $(eval $(call add-required-deps, $(mod_files),$(req_files))) \ 754 )\ 755 )\ 756) 757endef 758$(call add-all-target-to-host-required-modules-deps) 759 760t_m := 761h_m := 762hc_m := 763t_r := 764h_r := 765hc_r := 766 767# Establish the dependencies on the shared libraries. 768# It also adds the shared library module names to ALL_MODULES.$(m).REQUIRED_FROM_(TARGET|HOST|HOST_CROSS), 769# so they can be expanded to product_MODULES later. 770# $(1): TARGET_ or HOST_ or HOST_CROSS_. 771# $(2): non-empty for 2nd arch. 772# $(3): non-empty for host cross compile. 773define resolve-shared-libs-depes 774$(foreach m,$($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))$(1)DEPENDENCIES_ON_SHARED_LIBRARIES),\ 775 $(eval p := $(subst :,$(space),$(m)))\ 776 $(eval mod := $(firstword $(p)))\ 777 $(eval deps := $(subst $(comma),$(space),$(lastword $(p))))\ 778 $(eval root := $(1)OUT$(if $(call streq,$(1),TARGET_),_ROOT))\ 779 $(if $(2),$(eval deps := $(addsuffix $($(1)2ND_ARCH_MODULE_SUFFIX),$(deps))))\ 780 $(if $(3),$(eval deps := $(addprefix host_cross_,$(deps))))\ 781 $(eval r := $(filter $($(root))/%,$(call module-installed-files,\ 782 $(deps))))\ 783 $(if $(filter $(1),HOST_),\ 784 $(eval ALL_MODULES.$(mod).HOST_SHARED_LIBRARY_FILES := $$(ALL_MODULES.$(mod).HOST_SHARED_LIBRARY_FILES) $(word 2,$(p)) $(r))\ 785 $(eval ALL_MODULES.$(mod).HOST_SHARED_LIBRARIES := $$(ALL_MODULES.$(mod).HOST_SHARED_LIBRARIES) $(deps))\ 786 $(eval $(call add-required-host-so-deps,$(word 2,$(p)),$(r))),\ 787 $(eval $(call add-required-deps,$(word 2,$(p)),$(r))))\ 788 $(eval ALL_MODULES.$(mod).REQUIRED_FROM_$(patsubst %_,%,$(1)) += $(deps))) 789endef 790 791# Recursively resolve host shared library dependency for a given module. 792# $(1): module name 793# Returns all dependencies of shared library. 794define get-all-shared-libs-deps 795$(if $(_all_deps_for_$(1)_set_),$(_all_deps_for_$(1)_),\ 796 $(eval _all_deps_for_$(1)_ :=) \ 797 $(foreach dep,$(ALL_MODULES.$(1).HOST_SHARED_LIBRARIES),\ 798 $(foreach m,$(call get-all-shared-libs-deps,$(dep)),\ 799 $(eval _all_deps_for_$(1)_ := $$(_all_deps_for_$(1)_) $(m))\ 800 $(eval _all_deps_for_$(1)_ := $(sort $(_all_deps_for_$(1)_))))\ 801 $(eval _all_deps_for_$(1)_ := $$(_all_deps_for_$(1)_) $(dep))\ 802 $(eval _all_deps_for_$(1)_ := $(sort $(_all_deps_for_$(1)_) $(dep)))\ 803 $(eval _all_deps_for_$(1)_set_ := true))\ 804$(_all_deps_for_$(1)_)) 805endef 806 807# Scan all modules in general-tests and device-tests suite and flatten the 808# shared library dependencies. 809define update-host-shared-libs-deps-for-suites 810$(foreach suite,general-tests device-tests,\ 811 $(foreach m,$(COMPATIBILITY.$(suite).MODULES),\ 812 $(eval my_deps := $(call get-all-shared-libs-deps,$(m)))\ 813 $(foreach dep,$(my_deps),\ 814 $(foreach f,$(ALL_MODULES.$(dep).HOST_SHARED_LIBRARY_FILES),\ 815 $(eval target := $(HOST_OUT_TESTCASES)/$(lastword $(subst /, ,$(dir $(f))))/$(notdir $(f)))\ 816 $(eval COMPATIBILITY.$(suite).HOST_SHARED_LIBRARY.FILES := \ 817 $$(COMPATIBILITY.$(suite).HOST_SHARED_LIBRARY.FILES) $(f):$(target))\ 818 $(eval COMPATIBILITY.$(suite).HOST_SHARED_LIBRARY.FILES := \ 819 $(sort $(COMPATIBILITY.$(suite).HOST_SHARED_LIBRARY.FILES))))))) 820endef 821 822$(call resolve-shared-libs-depes,TARGET_) 823ifdef TARGET_2ND_ARCH 824$(call resolve-shared-libs-depes,TARGET_,true) 825endif 826$(call resolve-shared-libs-depes,HOST_) 827ifdef HOST_2ND_ARCH 828$(call resolve-shared-libs-depes,HOST_,true) 829endif 830# Update host side shared library dependencies for tests in suite device-tests and general-tests. 831# This should be called after calling resolve-shared-libs-depes for HOST_2ND_ARCH. 832$(call update-host-shared-libs-deps-for-suites) 833ifdef HOST_CROSS_OS 834$(call resolve-shared-libs-depes,HOST_CROSS_,,true) 835endif 836 837# Pass the shared libraries dependencies to prebuilt ELF file check. 838define add-elf-file-check-shared-lib 839$(1): PRIVATE_SHARED_LIBRARY_FILES += $(2) 840$(1): $(2) 841endef 842 843define resolve-shared-libs-for-elf-file-check 844$(foreach m,$($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))$(1)DEPENDENCIES_ON_SHARED_LIBRARIES),\ 845 $(eval p := $(subst :,$(space),$(m)))\ 846 $(eval mod := $(firstword $(p)))\ 847 \ 848 $(eval deps := $(subst $(comma),$(space),$(lastword $(p))))\ 849 $(if $(2),$(eval deps := $(addsuffix $($(1)2ND_ARCH_MODULE_SUFFIX),$(deps))))\ 850 $(eval root := $(1)OUT$(if $(call streq,$(1),TARGET_),_ROOT))\ 851 $(eval deps := $(filter $($(root))/%$($(1)SHLIB_SUFFIX),$(call module-built-files,$(deps))))\ 852 \ 853 $(eval r := $(firstword $(filter \ 854 $($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))TARGET_OUT_INTERMEDIATES)/EXECUTABLES/%\ 855 $($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))TARGET_OUT_INTERMEDIATES)/NATIVE_TESTS/%\ 856 $($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))TARGET_OUT_INTERMEDIATES)/SHARED_LIBRARIES/%,\ 857 $(call module-built-files,$(mod)))))\ 858 \ 859 $(if $(r),\ 860 $(eval stamp := $(dir $(r))check_elf_files.timestamp)\ 861 $(eval $(call add-elf-file-check-shared-lib,$(stamp),$(deps)))\ 862 )) 863endef 864 865$(call resolve-shared-libs-for-elf-file-check,TARGET_) 866ifdef TARGET_2ND_ARCH 867$(call resolve-shared-libs-for-elf-file-check,TARGET_,true) 868endif 869 870m := 871r := 872p := 873stamp := 874deps := 875add-required-deps := 876 877################################################################################ 878# Link type checking 879# 880# ALL_LINK_TYPES contains a list of all link type prefixes (generally one per 881# module, but APKs can "link" to both java and native code). The link type 882# prefix consists of all the information needed by intermediates-dir-for: 883# 884# LINK_TYPE:TARGET:_:2ND:STATIC_LIBRARIES:libfoo 885# 886# 1: LINK_TYPE literal 887# 2: prefix 888# - TARGET 889# - HOST 890# - HOST_CROSS 891# - AUX-<variant-name> 892# 3: Whether to use the common intermediates directory or not 893# - _ 894# - COMMON 895# 4: Whether it's the second arch or not 896# - _ 897# - 2ND_ 898# 5: Module Class 899# - STATIC_LIBRARIES 900# - SHARED_LIBRARIES 901# - ... 902# 6: Module Name 903# 904# Then fields under that are separated by a period and the field name: 905# - TYPE: the link types for this module 906# - MAKEFILE: Where this module was defined 907# - BUILT: The built module location 908# - DEPS: the link type prefixes for the module's dependencies 909# - ALLOWED: the link types to allow in this module's dependencies 910# - WARN: the link types to warn about in this module's dependencies 911# 912# All of the dependency link types not listed in ALLOWED or WARN will become 913# errors. 914################################################################################ 915 916link_type_error := 917 918define link-type-prefix-base 919$(word 2,$(subst :,$(space),$(1))) 920endef 921define link-type-prefix 922$(if $(filter AUX-%,$(link-type-prefix-base)),$(patsubst AUX-%,AUX,$(link-type-prefix-base)),$(link-type-prefix-base)) 923endef 924define link-type-aux-variant 925$(if $(filter AUX-%,$(link-type-prefix-base)),$(patsubst AUX-%,%,$(link-type-prefix-base))) 926endef 927define link-type-common 928$(patsubst _,,$(word 3,$(subst :,$(space),$(1)))) 929endef 930define link-type-2ndarchprefix 931$(patsubst _,,$(word 4,$(subst :,$(space),$(1)))) 932endef 933define link-type-class 934$(word 5,$(subst :,$(space),$(1))) 935endef 936define link-type-name 937$(word 6,$(subst :,$(space),$(1))) 938endef 939define link-type-os 940$(strip $(eval _p := $(link-type-prefix))\ 941 $(if $(filter HOST HOST_CROSS,$(_p)),\ 942 $($(_p)_OS),\ 943 $(if $(filter AUX,$(_p)),AUX,android))) 944endef 945define link-type-arch 946$($(link-type-prefix)_$(link-type-2ndarchprefix)ARCH) 947endef 948define link-type-name-variant 949$(link-type-name) ($(link-type-class) $(link-type-os)-$(link-type-arch)) 950endef 951 952# $(1): the prefix of the module doing the linking 953# $(2): the prefix of the linked module 954define link-type-warning 955$(shell $(call echo-warning,$($(1).MAKEFILE),"$(call link-type-name,$(1)) ($($(1).TYPE)) should not link against $(call link-type-name,$(2)) ($(3))")) 956endef 957 958# $(1): the prefix of the module doing the linking 959# $(2): the prefix of the linked module 960define link-type-error 961$(shell $(call echo-error,$($(1).MAKEFILE),"$(call link-type-name,$(1)) ($($(1).TYPE)) can not link against $(call link-type-name,$(2)) ($(3))"))\ 962$(eval link_type_error := true) 963endef 964 965link-type-missing := 966ifneq ($(ALLOW_MISSING_DEPENDENCIES),true) 967 # Print an error message if the linked-to module is missing 968 # $(1): the prefix of the module doing the linking 969 # $(2): the prefix of the missing module 970 define link-type-missing 971 $(shell $(call echo-error,$($(1).MAKEFILE),"$(call link-type-name-variant,$(1)) missing $(call link-type-name-variant,$(2))"))\ 972 $(eval available_variants := $(filter %:$(call link-type-name,$(2)),$(ALL_LINK_TYPES)))\ 973 $(if $(available_variants),\ 974 $(info Available variants:)\ 975 $(foreach v,$(available_variants),$(info $(space)$(space)$(call link-type-name-variant,$(v)))))\ 976 $(info You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.)\ 977 $(eval link_type_error := true) 978 endef 979else 980 define link-type-missing 981 $(eval $$(1).MISSING := true) 982 endef 983endif 984 985# Verify that $(1) can link against $(2) 986# Both $(1) and $(2) are the link type prefix defined above 987define verify-link-type 988$(foreach t,$($(2).TYPE),\ 989 $(if $(filter-out $($(1).ALLOWED),$(t)),\ 990 $(if $(filter $(t),$($(1).WARN)),\ 991 $(call link-type-warning,$(1),$(2),$(t)),\ 992 $(call link-type-error,$(1),$(2),$(t))))) 993endef 994 995# TODO: Verify all branches/configs have reasonable warnings/errors, and remove 996# this override 997verify-link-type = $(eval $$(1).MISSING := true) 998 999$(foreach lt,$(ALL_LINK_TYPES),\ 1000 $(foreach d,$($(lt).DEPS),\ 1001 $(if $($(d).TYPE),\ 1002 $(call verify-link-type,$(lt),$(d)),\ 1003 $(call link-type-missing,$(lt),$(d))))) 1004 1005ifdef link_type_error 1006 $(error exiting from previous errors) 1007endif 1008 1009# The intermediate filename for link type rules 1010# 1011# APPS are special -- they have up to three different rules: 1012# 1. The COMMON rule for Java libraries 1013# 2. The jni_link_type rule for embedded native code 1014# 3. The 2ND_jni_link_type for the second architecture native code 1015define link-type-file 1016$(eval _ltf_aux_variant:=$(link-type-aux-variant))\ 1017$(if $(_ltf_aux_variant),$(call aux-variant-load-env,$(_ltf_aux_variant)))\ 1018$(call intermediates-dir-for,$(link-type-class),$(link-type-name),$(filter AUX HOST HOST_CROSS,$(link-type-prefix)),$(link-type-common),$(link-type-2ndarchprefix),$(filter HOST_CROSS,$(link-type-prefix)))/$(if $(filter APPS,$(link-type-class)),$(if $(link-type-common),,$(link-type-2ndarchprefix)jni_))link_type\ 1019$(if $(_ltf_aux_variant),$(call aux-variant-load-env,none))\ 1020$(eval _ltf_aux_variant:=) 1021endef 1022 1023# Write out the file-based link_type rules for the ALLOW_MISSING_DEPENDENCIES 1024# case. We always need to write the file for mm to work, but only need to 1025# check it if we weren't able to check it when reading the Android.mk files. 1026define link-type-file-rule 1027my_link_type_deps := $(foreach l,$($(1).DEPS),$(call link-type-file,$(l))) 1028my_link_type_file := $(call link-type-file,$(1)) 1029$($(1).BUILT): | $$(my_link_type_file) 1030$$(my_link_type_file): PRIVATE_DEPS := $$(my_link_type_deps) 1031ifeq ($($(1).MISSING),true) 1032$$(my_link_type_file): $(CHECK_LINK_TYPE) 1033endif 1034$$(my_link_type_file): $$(my_link_type_deps) 1035 @echo Check module type: $$@ 1036 $$(hide) mkdir -p $$(dir $$@) && rm -f $$@ 1037ifeq ($($(1).MISSING),true) 1038 $$(hide) $(CHECK_LINK_TYPE) --makefile $($(1).MAKEFILE) --module $(link-type-name) \ 1039 --type "$($(1).TYPE)" $(addprefix --allowed ,$($(1).ALLOWED)) \ 1040 $(addprefix --warn ,$($(1).WARN)) $$(PRIVATE_DEPS) 1041endif 1042 $$(hide) echo "$($(1).TYPE)" >$$@ 1043endef 1044 1045$(foreach lt,$(ALL_LINK_TYPES),\ 1046 $(eval $(call link-type-file-rule,$(lt)))) 1047 1048# ------------------------------------------------------------------- 1049# Figure out our module sets. 1050# 1051# Of the modules defined by the component makefiles, 1052# determine what we actually want to build. 1053 1054 1055# Expand a list of modules to the modules that they override (if any) 1056# $(1): The list of modules. 1057define module-overrides 1058$(foreach m,$(1),$(PACKAGES.$(m).OVERRIDES) $(EXECUTABLES.$(m).OVERRIDES) $(SHARED_LIBRARIES.$(m).OVERRIDES)) 1059endef 1060 1061########################################################### 1062## Expand a module name list with REQUIRED modules 1063########################################################### 1064# $(1): The variable name that holds the initial module name list. 1065# the variable will be modified to hold the expanded results. 1066# $(2): The initial module name list. 1067# $(3): The list of overridden modules. 1068# Returns empty string (maybe with some whitespaces). 1069define expand-required-modules 1070$(eval _erm_req := $(foreach m,$(2),$(ALL_MODULES.$(m).REQUIRED_FROM_TARGET))) \ 1071$(eval _erm_new_modules := $(sort $(filter-out $($(1)),$(_erm_req)))) \ 1072$(eval _erm_new_overrides := $(call module-overrides,$(_erm_new_modules))) \ 1073$(eval _erm_all_overrides := $(3) $(_erm_new_overrides)) \ 1074$(eval _erm_new_modules := $(filter-out $(_erm_all_overrides), $(_erm_new_modules))) \ 1075$(eval $(1) := $(filter-out $(_erm_new_overrides),$($(1)))) \ 1076$(eval $(1) += $(_erm_new_modules)) \ 1077$(if $(_erm_new_modules),\ 1078 $(call expand-required-modules,$(1),$(_erm_new_modules),$(_erm_all_overrides))) 1079endef 1080 1081# Same as expand-required-modules above, but does not handle module overrides, as 1082# we don't intend to support them on the host. 1083# $(1): The variable name that holds the initial module name list. 1084# the variable will be modified to hold the expanded results. 1085# $(2): The initial module name list. 1086# $(3): HOST or HOST_CROSS depending on whether we're expanding host or host cross modules 1087# Returns empty string (maybe with some whitespaces). 1088define expand-required-host-modules 1089$(eval _erm_req := $(foreach m,$(2),$(ALL_MODULES.$(m).REQUIRED_FROM_$(3)))) \ 1090$(eval _erm_new_modules := $(sort $(filter-out $($(1)),$(_erm_req)))) \ 1091$(eval $(1) += $(_erm_new_modules)) \ 1092$(if $(_erm_new_modules),\ 1093 $(call expand-required-host-modules,$(1),$(_erm_new_modules),$(3))) 1094endef 1095 1096# Transforms paths relative to PRODUCT_OUT to absolute paths. 1097# $(1): list of relative paths 1098# $(2): optional suffix to append to paths 1099define resolve-product-relative-paths 1100 $(subst $(_vendor_path_placeholder),$(TARGET_COPY_OUT_VENDOR),\ 1101 $(subst $(_product_path_placeholder),$(TARGET_COPY_OUT_PRODUCT),\ 1102 $(subst $(_product_services_path_placeholder),$(TARGET_COPY_OUT_PRODUCT_SERVICES),\ 1103 $(subst $(_odm_path_placeholder),$(TARGET_COPY_OUT_ODM),\ 1104 $(foreach p,$(1),$(call append-path,$(PRODUCT_OUT),$(p)$(2))))))) 1105endef 1106 1107# Returns modules included automatically as a result of certain BoardConfig 1108# variables being set. 1109define auto-included-modules 1110 $(if $(BOARD_VNDK_VERSION),vndk_package) \ 1111 $(if $(DEVICE_MANIFEST_FILE),device_manifest.xml) \ 1112 $(if $(ODM_MANIFEST_FILES),odm_manifest.xml) \ 1113 $(if $(ODM_MANIFEST_SKUS),$(foreach sku, $(ODM_MANIFEST_SKUS),odm_manifest_$(sku).xml)) \ 1114 1115endef 1116 1117# Lists most of the files a particular product installs, including: 1118# - PRODUCT_PACKAGES, and their LOCAL_REQUIRED_MODULES 1119# - PRODUCT_COPY_FILES 1120# The base list of modules to build for this product is specified 1121# by the appropriate product definition file, which was included 1122# by product_config.mk. 1123# Name resolution for PRODUCT_PACKAGES: 1124# foo:32 resolves to foo_32; 1125# foo:64 resolves to foo; 1126# foo resolves to both foo and foo_32 (if foo_32 is defined). 1127# 1128# Name resolution for LOCAL_REQUIRED_MODULES: 1129# If a module is built for 2nd arch, its required module resolves to 1130# 32-bit variant, if it exits. See the select-bitness-of-required-modules definition. 1131# $(1): product makefile 1132define product-installed-files 1133 $(eval _mk := $(strip $(1))) \ 1134 $(eval _pif_modules := \ 1135 $(PRODUCTS.$(_mk).PRODUCT_PACKAGES) \ 1136 $(if $(filter eng,$(tags_to_install)),$(PRODUCTS.$(_mk).PRODUCT_PACKAGES_ENG)) \ 1137 $(if $(filter debug,$(tags_to_install)),$(PRODUCTS.$(_mk).PRODUCT_PACKAGES_DEBUG)) \ 1138 $(if $(filter tests,$(tags_to_install)),$(PRODUCTS.$(_mk).PRODUCT_PACKAGES_TESTS)) \ 1139 $(if $(filter asan,$(tags_to_install)),$(PRODUCTS.$(_mk).PRODUCT_PACKAGES_DEBUG_ASAN)) \ 1140 $(call auto-included-modules) \ 1141 ) \ 1142 $(eval ### Filter out the overridden packages and executables before doing expansion) \ 1143 $(eval _pif_overrides := $(call module-overrides,$(_pif_modules))) \ 1144 $(eval _pif_modules := $(filter-out $(_pif_overrides), $(_pif_modules))) \ 1145 $(eval ### Resolve the :32 :64 module name) \ 1146 $(eval _pif_modules_32 := $(patsubst %:32,%,$(filter %:32, $(_pif_modules)))) \ 1147 $(eval _pif_modules_64 := $(patsubst %:64,%,$(filter %:64, $(_pif_modules)))) \ 1148 $(eval _pif_modules_rest := $(filter-out %:32 %:64,$(_pif_modules))) \ 1149 $(eval ### Note for 32-bit product, 32 and 64 will be added as their original module names.) \ 1150 $(eval _pif_modules := $(call get-32-bit-modules-if-we-can, $(_pif_modules_32))) \ 1151 $(eval _pif_modules += $(_pif_modules_64)) \ 1152 $(eval ### For the rest we add both) \ 1153 $(eval _pif_modules += $(call get-32-bit-modules, $(_pif_modules_rest))) \ 1154 $(eval _pif_modules += $(_pif_modules_rest)) \ 1155 $(call expand-required-modules,_pif_modules,$(_pif_modules),$(_pif_overrides)) \ 1156 $(filter-out $(HOST_OUT_ROOT)/%,$(call module-installed-files, $(_pif_modules))) \ 1157 $(call resolve-product-relative-paths,\ 1158 $(foreach cf,$(PRODUCTS.$(_mk).PRODUCT_COPY_FILES),$(call word-colon,2,$(cf)))) 1159endef 1160 1161# Similar to product-installed-files above, but handles PRODUCT_HOST_PACKAGES instead 1162# This does support the :32 / :64 syntax, but does not support module overrides. 1163define host-installed-files 1164 $(eval _hif_modules := $(PRODUCTS.$(strip $(1)).PRODUCT_HOST_PACKAGES)) \ 1165 $(eval ### Resolve the :32 :64 module name) \ 1166 $(eval _hif_modules_32 := $(patsubst %:32,%,$(filter %:32, $(_hif_modules)))) \ 1167 $(eval _hif_modules_64 := $(patsubst %:64,%,$(filter %:64, $(_hif_modules)))) \ 1168 $(eval _hif_modules_rest := $(filter-out %:32 %:64,$(_hif_modules))) \ 1169 $(eval _hif_modules := $(call get-host-32-bit-modules-if-we-can, $(_hif_modules_32))) \ 1170 $(eval _hif_modules += $(_hif_modules_64)) \ 1171 $(eval ### For the rest we add both) \ 1172 $(eval _hif_modules += $(call get-host-32-bit-modules, $(_hif_modules_rest))) \ 1173 $(eval _hif_modules += $(_hif_modules_rest)) \ 1174 $(eval ### Split host vs host cross modules) \ 1175 $(eval _hcif_modules := $(filter host_cross_%,$(_hif_modules))) \ 1176 $(eval _hif_modules := $(filter-out host_cross_%,$(_hif_modules))) \ 1177 $(call expand-required-host-modules,_hif_modules,$(_hif_modules),HOST) \ 1178 $(call expand-required-host-modules,_hcif_modules,$(_hcif_modules),HOST_CROSS) \ 1179 $(filter $(HOST_OUT)/%,$(call module-installed-files, $(_hif_modules))) \ 1180 $(filter $(HOST_CROSS_OUT)/%,$(call module-installed-files, $(_hcif_modules))) 1181endef 1182 1183# Fails the build if the given list is non-empty, and prints it entries (stripping PRODUCT_OUT). 1184# $(1): list of files to print 1185# $(2): heading to print on failure 1186define maybe-print-list-and-error 1187$(if $(strip $(1)), \ 1188 $(warning $(2)) \ 1189 $(info Offending entries:) \ 1190 $(foreach e,$(sort $(1)),$(info $(patsubst $(PRODUCT_OUT)/%,%,$(e)))) \ 1191 $(error Build failed) \ 1192) 1193endef 1194 1195# Check that libraries that should only be in APEXes don't end up in the system 1196# image. For the Runtime APEX this complements the checks in 1197# art/build/apex/art_apex_test.py. 1198# TODO(b/128708192): Implement this restriction in Soong instead. 1199 1200# Runtime APEX libraries 1201APEX_MODULE_LIBS := \ 1202 libadbconnection.so \ 1203 libadbconnectiond.so \ 1204 libandroidicu.so \ 1205 libandroidio.so \ 1206 libart-compiler.so \ 1207 libart-dexlayout.so \ 1208 libart-disassembler.so \ 1209 libart.so \ 1210 libartbase.so \ 1211 libartbased.so \ 1212 libartd-compiler.so \ 1213 libartd-dexlayout.so \ 1214 libartd.so \ 1215 libartpalette.so \ 1216 libc.so \ 1217 libdexfile.so \ 1218 libdexfile_external.so \ 1219 libdexfiled.so \ 1220 libdexfiled_external.so \ 1221 libdl.so \ 1222 libdt_fd_forward.so \ 1223 libdt_socket.so \ 1224 libicui18n.so \ 1225 libicuuc.so \ 1226 libjavacore.so \ 1227 libjdwp.so \ 1228 libm.so \ 1229 libnativebridge.so \ 1230 libnativehelper.so \ 1231 libnativeloader.so \ 1232 libnpt.so \ 1233 libopenjdk.so \ 1234 libopenjdkjvm.so \ 1235 libopenjdkjvmd.so \ 1236 libopenjdkjvmti.so \ 1237 libopenjdkjvmtid.so \ 1238 libpac.so \ 1239 libprofile.so \ 1240 libprofiled.so \ 1241 libsigchain.so \ 1242 1243# Conscrypt APEX libraries 1244APEX_MODULE_LIBS += \ 1245 libjavacrypto.so \ 1246 1247# An option to disable the check below, for local use since some build targets 1248# still may create these libraries in /system (b/129006418). 1249DISABLE_APEX_LIBS_ABSENCE_CHECK ?= 1250 1251# Bionic should not be in /system, except for the bootstrap instance. 1252APEX_LIBS_ABSENCE_CHECK_EXCLUDE := lib/bootstrap lib64/bootstrap 1253 1254# Exclude lib/arm and lib/arm64 which contain the native bridge proxy libs. They 1255# are compiled for the guest architecture and used with an entirely different 1256# linker config. The native libs are then linked to as usual via exported 1257# interfaces, so the proxy libs do not violate the interface boundaries on the 1258# native architecture. 1259# TODO(b/130630776): Introduce a make variable for the appropriate directory 1260# when native bridge is active. 1261APEX_LIBS_ABSENCE_CHECK_EXCLUDE += lib/arm lib/arm64 1262 1263# Exclude vndk-* subdirectories which contain prebuilts from older releases. 1264APEX_LIBS_ABSENCE_CHECK_EXCLUDE += lib/vndk-% lib64/vndk-% 1265 1266ifdef DISABLE_APEX_LIBS_ABSENCE_CHECK 1267 check-apex-libs-absence := 1268 check-apex-libs-absence-on-disk := 1269else 1270 # If the check below fails, some library has ended up in system/lib or 1271 # system/lib64 that is intended to only go into some APEX package. The likely 1272 # cause is that a library or binary in /system has grown a dependency that 1273 # directly or indirectly pulls in the prohibited library. 1274 # 1275 # To resolve this, look for the APEX package that the library belong to - 1276 # search for it in 'native_shared_lib' properties in 'apex' build modules (see 1277 # art/build/apex/Android.bp for an example). Then check if there is an 1278 # exported library in that APEX package that should be used instead, i.e. one 1279 # listed in its 'native_shared_lib' property for which the corresponding 1280 # 'cc_library' module has a 'stubs' clause (like libdexfile_external in 1281 # art/libdexfile/Android.bp). 1282 # 1283 # If you cannot find an APEX exported library that fits your needs, or you 1284 # think that the library you want to depend on should be allowed in /system, 1285 # then please contact the owners of the APEX package containing the library. 1286 # 1287 # If you get this error for a library that is exported in an APEX, then the 1288 # APEX might be misconfigured or something is wrong in the build system. 1289 # Please reach out to the APEX package owners and/or soong-team@, or 1290 # android-building@googlegroups.com externally. 1291 define check-apex-libs-absence 1292 $(call maybe-print-list-and-error, \ 1293 $(filter $(foreach lib,$(APEX_MODULE_LIBS),%/$(lib)), \ 1294 $(filter-out $(foreach dir,$(APEX_LIBS_ABSENCE_CHECK_EXCLUDE), \ 1295 $(TARGET_OUT)/$(if $(findstring %,$(dir)),$(dir),$(dir)/%)), \ 1296 $(filter $(TARGET_OUT)/lib/% $(TARGET_OUT)/lib64/%,$(1)))), \ 1297 APEX libraries found in system image (see comment for check-apex-libs-absence in \ 1298 build/make/core/main.mk for details)) 1299 endef 1300 1301 # TODO(b/129006418): The check above catches libraries through product 1302 # dependencies visible to make, but as long as they have install rules in 1303 # /system they may still be created there through other make targets. To catch 1304 # that we also do a check on disk just before the system image is built. 1305 define check-apex-libs-absence-on-disk 1306 $(hide) ( \ 1307 cd $(TARGET_OUT) && \ 1308 findres=$$(find lib* \ 1309 $(foreach dir,$(APEX_LIBS_ABSENCE_CHECK_EXCLUDE),-path "$(subst %,*,$(dir))" -prune -o) \ 1310 -type f \( -false $(foreach lib,$(APEX_MODULE_LIBS),-o -name $(lib)) \) \ 1311 -print) && \ 1312 if [ -n "$$findres" ]; then \ 1313 echo "APEX libraries found in system image (see comment for check-apex-libs-absence" 1>&2; \ 1314 echo "in build/make/core/main.mk for details):" 1>&2; \ 1315 echo "$$findres" | sort 1>&2; \ 1316 false; \ 1317 fi; \ 1318 ) 1319 endef 1320endif 1321 1322ifdef FULL_BUILD 1323 ifneq (true,$(ALLOW_MISSING_DEPENDENCIES)) 1324 # Check to ensure that all modules in PRODUCT_PACKAGES exist (opt in per product) 1325 ifeq (true,$(PRODUCT_ENFORCE_PACKAGES_EXIST)) 1326 _whitelist := $(PRODUCT_ENFORCE_PACKAGES_EXIST_WHITELIST) 1327 _modules := $(PRODUCT_PACKAGES) 1328 # Sanity check all modules in PRODUCT_PACKAGES exist. We check for the 1329 # existence if either <module> or the <module>_32 variant. 1330 _nonexistant_modules := $(filter-out $(ALL_MODULES),$(_modules)) 1331 _nonexistant_modules := $(foreach m,$(_nonexistant_modules),\ 1332 $(if $(call get-32-bit-modules,$(m)),,$(m))) 1333 $(call maybe-print-list-and-error,$(filter-out $(_whitelist),$(_nonexistant_modules)),\ 1334 $(INTERNAL_PRODUCT) includes non-existant modules in PRODUCT_PACKAGES) 1335 $(call maybe-print-list-and-error,$(filter-out $(_nonexistant_modules),$(_whitelist)),\ 1336 $(INTERNAL_PRODUCT) includes redundant whitelist entries for nonexistant PRODUCT_PACKAGES) 1337 endif 1338 1339 # Check to ensure that all modules in PRODUCT_HOST_PACKAGES exist 1340 # 1341 # Many host modules are Linux-only, so skip this check on Mac. If we ever have Mac-only modules, 1342 # maybe it would make sense to have PRODUCT_HOST_PACKAGES_LINUX/_DARWIN? 1343 ifneq ($(HOST_OS),darwin) 1344 _modules := $(PRODUCT_HOST_PACKAGES) 1345 _nonexistant_modules := $(foreach m,$(_modules),\ 1346 $(if $(ALL_MODULES.$(m).REQUIRED_FROM_HOST)$(filter $(HOST_OUT_ROOT)/%,$(ALL_MODULES.$(m).INSTALLED)),,$(m))) 1347 $(call maybe-print-list-and-error,$(_nonexistant_modules),\ 1348 $(INTERNAL_PRODUCT) includes non-existant modules in PRODUCT_HOST_PACKAGES) 1349 endif 1350 endif 1351 1352 # Some modules produce only host installed files when building with TARGET_BUILD_APPS 1353 ifeq ($(TARGET_BUILD_APPS),) 1354 _modules := $(foreach m,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES) \ 1355 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG) \ 1356 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG_ASAN) \ 1357 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_ENG) \ 1358 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS),\ 1359 $(if $(ALL_MODULES.$(m).INSTALLED),\ 1360 $(if $(filter-out $(HOST_OUT_ROOT)/%,$(ALL_MODULES.$(m).INSTALLED)),,\ 1361 $(m)))) 1362 $(call maybe-print-list-and-error,$(sort $(_modules)),\ 1363 Host modules should be in PRODUCT_HOST_PACKAGES$(comma) not PRODUCT_PACKAGES) 1364 endif 1365 1366 product_host_FILES := $(call host-installed-files,$(INTERNAL_PRODUCT)) 1367 product_target_FILES := $(call product-installed-files, $(INTERNAL_PRODUCT)) 1368 # WARNING: The product_MODULES variable is depended on by external files. 1369 product_MODULES := $(_pif_modules) 1370 1371 # Verify the artifact path requirements made by included products. 1372 is_asan := $(if $(filter address,$(SANITIZE_TARGET)),true) 1373 ifneq (true,$(or $(is_asan),$(DISABLE_ARTIFACT_PATH_REQUIREMENTS))) 1374 # Fakes don't get installed, host files are irrelevant, and NDK stubs aren't installed to device. 1375 static_whitelist_patterns := $(TARGET_OUT_FAKE)/% $(HOST_OUT)/% $(SOONG_OUT_DIR)/ndk/% 1376 # RROs become REQUIRED by the source module, but are always placed on the vendor partition. 1377 static_whitelist_patterns += %__auto_generated_rro_product.apk 1378 static_whitelist_patterns += %__auto_generated_rro_vendor.apk 1379 # Auto-included targets are not considered 1380 static_whitelist_patterns += $(call module-installed-files,$(call auto-included-modules)) 1381 # $(PRODUCT_OUT)/apex is where shared libraries in APEXes get installed. 1382 # The path can be considered as a fake path, as the shared libraries 1383 # are installed there just to have symbols files for them under 1384 # $(PRODUCT_OUT)/symbols/apex for debugging purpose. The /apex directory 1385 # is never compiled into a filesystem image. 1386 static_whitelist_patterns += $(PRODUCT_OUT)/apex/% 1387 ifeq (true,$(BOARD_USES_SYSTEM_OTHER_ODEX)) 1388 # Allow system_other odex space optimization. 1389 static_whitelist_patterns += \ 1390 $(TARGET_OUT_SYSTEM_OTHER)/%.odex \ 1391 $(TARGET_OUT_SYSTEM_OTHER)/%.vdex \ 1392 $(TARGET_OUT_SYSTEM_OTHER)/%.art 1393 endif 1394 1395CERTIFICATE_VIOLATION_MODULES_FILENAME := $(PRODUCT_OUT)/certificate_violation_modules.txt 1396$(CERTIFICATE_VIOLATION_MODULES_FILENAME): 1397 rm -f $@ 1398 $(foreach m,$(sort $(CERTIFICATE_VIOLATION_MODULES)), echo $(m) >> $@;) 1399$(call dist-for-goals,droidcore,$(CERTIFICATE_VIOLATION_MODULES_FILENAME)) 1400 1401 all_offending_files := 1402 $(foreach makefile,$(ARTIFACT_PATH_REQUIREMENT_PRODUCTS),\ 1403 $(eval requirements := $(PRODUCTS.$(makefile).ARTIFACT_PATH_REQUIREMENTS)) \ 1404 $(eval ### Verify that the product only produces files inside its path requirements.) \ 1405 $(eval whitelist := $(PRODUCTS.$(makefile).ARTIFACT_PATH_WHITELIST)) \ 1406 $(eval path_patterns := $(call resolve-product-relative-paths,$(requirements),%)) \ 1407 $(eval whitelist_patterns := $(call resolve-product-relative-paths,$(whitelist))) \ 1408 $(eval files := $(call product-installed-files, $(makefile))) \ 1409 $(eval offending_files := $(filter-out $(path_patterns) $(whitelist_patterns) $(static_whitelist_patterns),$(files))) \ 1410 $(call maybe-print-list-and-error,$(offending_files),$(makefile) produces files outside its artifact path requirement.) \ 1411 $(eval unused_whitelist := $(filter-out $(files),$(whitelist_patterns))) \ 1412 $(call maybe-print-list-and-error,$(unused_whitelist),$(makefile) includes redundant whitelist entries in its artifact path requirement.) \ 1413 $(eval ### Optionally verify that nothing else produces files inside this artifact path requirement.) \ 1414 $(eval extra_files := $(filter-out $(files) $(HOST_OUT)/%,$(product_target_FILES))) \ 1415 $(eval files_in_requirement := $(filter $(path_patterns),$(extra_files))) \ 1416 $(eval all_offending_files += $(files_in_requirement)) \ 1417 $(eval whitelist := $(PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST)) \ 1418 $(eval whitelist_patterns := $(call resolve-product-relative-paths,$(whitelist))) \ 1419 $(eval offending_files := $(filter-out $(whitelist_patterns),$(files_in_requirement))) \ 1420 $(eval enforcement := $(PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS)) \ 1421 $(if $(enforcement),\ 1422 $(call maybe-print-list-and-error,$(offending_files),\ 1423 $(INTERNAL_PRODUCT) produces files inside $(makefile)s artifact path requirement. \ 1424 $(PRODUCT_ARTIFACT_PATH_REQUIREMENT_HINT)) \ 1425 $(eval unused_whitelist := $(if $(filter true strict,$(enforcement)),\ 1426 $(foreach p,$(whitelist_patterns),$(if $(filter $(p),$(extra_files)),,$(p))))) \ 1427 $(call maybe-print-list-and-error,$(unused_whitelist),$(INTERNAL_PRODUCT) includes redundant artifact path requirement whitelist entries.) \ 1428 ) \ 1429 ) 1430$(PRODUCT_OUT)/offending_artifacts.txt: 1431 rm -f $@ 1432 $(foreach f,$(sort $(all_offending_files)),echo $(f) >> $@;) 1433 endif 1434 1435 $(call check-apex-libs-absence,$(product_target_FILES)) 1436else 1437 # We're not doing a full build, and are probably only including 1438 # a subset of the module makefiles. Don't try to build any modules 1439 # requested by the product, because we probably won't have rules 1440 # to build them. 1441 product_target_FILES := 1442 product_host_FILES := 1443endif 1444 1445# TODO: Remove the 3 places in the tree that use ALL_DEFAULT_INSTALLED_MODULES 1446# and get rid of it from this list. 1447modules_to_install := $(sort \ 1448 $(ALL_DEFAULT_INSTALLED_MODULES) \ 1449 $(product_target_FILES) \ 1450 $(product_host_FILES) \ 1451 $(call get-tagged-modules,$(tags_to_install)) \ 1452 $(CUSTOM_MODULES) \ 1453 ) 1454 1455# Don't include any GNU General Public License shared objects or static 1456# libraries in SDK images. GPL executables (not static/dynamic libraries) 1457# are okay if they don't link against any closed source libraries (directly 1458# or indirectly) 1459 1460# It's ok (and necessary) to build the host tools, but nothing that's 1461# going to be installed on the target (including static libraries). 1462 1463ifdef is_sdk_build 1464 target_gnu_MODULES := \ 1465 $(filter \ 1466 $(TARGET_OUT_INTERMEDIATES)/% \ 1467 $(TARGET_OUT)/% \ 1468 $(TARGET_OUT_DATA)/%, \ 1469 $(sort $(call get-tagged-modules,gnu))) 1470 target_gnu_MODULES := $(filter-out $(TARGET_OUT_EXECUTABLES)/%,$(target_gnu_MODULES)) 1471 target_gnu_MODULES := $(filter-out %/libopenjdkjvmti.so,$(target_gnu_MODULES)) 1472 target_gnu_MODULES := $(filter-out %/libopenjdkjvmtid.so,$(target_gnu_MODULES)) 1473 $(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d))) 1474 modules_to_install := \ 1475 $(filter-out $(target_gnu_MODULES),$(modules_to_install)) 1476 1477 # Ensure every module listed in PRODUCT_PACKAGES* gets something installed 1478 # TODO: Should we do this for all builds and not just the sdk? 1479 dangling_modules := 1480 $(foreach m, $(PRODUCT_PACKAGES), \ 1481 $(if $(strip $(ALL_MODULES.$(m).INSTALLED) $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).INSTALLED)),,\ 1482 $(eval dangling_modules += $(m)))) 1483 ifneq ($(dangling_modules),) 1484 $(warning: Modules '$(dangling_modules)' in PRODUCT_PACKAGES have nothing to install!) 1485 endif 1486 $(foreach m, $(PRODUCT_PACKAGES_DEBUG), \ 1487 $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ 1488 $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_DEBUG has nothing to install!))) 1489 $(foreach m, $(PRODUCT_PACKAGES_ENG), \ 1490 $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ 1491 $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_ENG has nothing to install!))) 1492 $(foreach m, $(PRODUCT_PACKAGES_TESTS), \ 1493 $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ 1494 $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_TESTS has nothing to install!))) 1495endif 1496 1497# build/make/core/Makefile contains extra stuff that we don't want to pollute this 1498# top-level makefile with. It expects that ALL_DEFAULT_INSTALLED_MODULES 1499# contains everything that's built during the current make, but it also further 1500# extends ALL_DEFAULT_INSTALLED_MODULES. 1501ALL_DEFAULT_INSTALLED_MODULES := $(modules_to_install) 1502include $(BUILD_SYSTEM)/Makefile 1503modules_to_install := $(sort $(ALL_DEFAULT_INSTALLED_MODULES)) 1504ALL_DEFAULT_INSTALLED_MODULES := 1505 1506 1507# These are additional goals that we build, in order to make sure that there 1508# is as little code as possible in the tree that doesn't build. 1509modules_to_check := $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).CHECKED)) 1510 1511# If you would like to build all goals, and not skip any intermediate 1512# steps, you can pass the "all" modifier goal on the commandline. 1513ifneq ($(filter all,$(MAKECMDGOALS)),) 1514modules_to_check += $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).BUILT)) 1515endif 1516 1517# Build docs as part of checkbuild to catch more breakages. 1518module_to_check += $(ALL_DOCS) 1519 1520# for easier debugging 1521modules_to_check := $(sort $(modules_to_check)) 1522#$(error modules_to_check $(modules_to_check)) 1523 1524# ------------------------------------------------------------------- 1525# This is used to to get the ordering right, you can also use these, 1526# but they're considered undocumented, so don't complain if their 1527# behavior changes. 1528# An internal target that depends on all copied headers 1529# (see copy_headers.make). Other targets that need the 1530# headers to be copied first can depend on this target. 1531.PHONY: all_copied_headers 1532all_copied_headers: ; 1533 1534$(ALL_C_CPP_ETC_OBJECTS): | all_copied_headers 1535 1536# All the droid stuff, in directories 1537.PHONY: files 1538files: $(modules_to_install) \ 1539 $(INSTALLED_ANDROID_INFO_TXT_TARGET) 1540 1541# ------------------------------------------------------------------- 1542 1543.PHONY: checkbuild 1544checkbuild: $(modules_to_check) droid_targets 1545 1546ifeq (true,$(ANDROID_BUILD_EVERYTHING_BY_DEFAULT)) 1547droid: checkbuild 1548endif 1549 1550.PHONY: ramdisk 1551ramdisk: $(INSTALLED_RAMDISK_TARGET) 1552 1553.PHONY: ramdisk_debug 1554ramdisk_debug: $(INSTALLED_DEBUG_RAMDISK_TARGET) 1555 1556.PHONY: systemtarball 1557systemtarball: $(INSTALLED_SYSTEMTARBALL_TARGET) 1558 1559.PHONY: boottarball 1560boottarball: $(INSTALLED_BOOTTARBALL_TARGET) 1561 1562.PHONY: userdataimage 1563userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET) 1564 1565ifneq (,$(filter userdataimage, $(MAKECMDGOALS))) 1566$(call dist-for-goals, userdataimage, $(BUILT_USERDATAIMAGE_TARGET)) 1567endif 1568 1569.PHONY: userdatatarball 1570userdatatarball: $(INSTALLED_USERDATATARBALL_TARGET) 1571 1572.PHONY: cacheimage 1573cacheimage: $(INSTALLED_CACHEIMAGE_TARGET) 1574 1575.PHONY: bptimage 1576bptimage: $(INSTALLED_BPTIMAGE_TARGET) 1577 1578.PHONY: vendorimage 1579vendorimage: $(INSTALLED_VENDORIMAGE_TARGET) 1580 1581.PHONY: productimage 1582productimage: $(INSTALLED_PRODUCTIMAGE_TARGET) 1583 1584.PHONY: productservicesimage 1585productservicesimage: $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) 1586 1587.PHONY: odmimage 1588odmimage: $(INSTALLED_ODMIMAGE_TARGET) 1589 1590.PHONY: systemotherimage 1591systemotherimage: $(INSTALLED_SYSTEMOTHERIMAGE_TARGET) 1592 1593.PHONY: superimage_empty 1594superimage_empty: $(INSTALLED_SUPERIMAGE_EMPTY_TARGET) 1595 1596.PHONY: bootimage 1597bootimage: $(INSTALLED_BOOTIMAGE_TARGET) 1598 1599.PHONY: bootimage_debug 1600bootimage_debug: $(INSTALLED_DEBUG_BOOTIMAGE_TARGET) 1601 1602.PHONY: vbmetaimage 1603vbmetaimage: $(INSTALLED_VBMETAIMAGE_TARGET) 1604 1605.PHONY: auxiliary 1606auxiliary: $(INSTALLED_AUX_TARGETS) 1607 1608# Build files and then package it into the rom formats 1609.PHONY: droidcore 1610droidcore: $(filter $(HOST_OUT_ROOT)/%,$(modules_to_install)) \ 1611 $(INSTALLED_SYSTEMIMAGE_TARGET) \ 1612 $(INSTALLED_RAMDISK_TARGET) \ 1613 $(INSTALLED_BOOTIMAGE_TARGET) \ 1614 $(INSTALLED_DEBUG_RAMDISK_TARGET) \ 1615 $(INSTALLED_DEBUG_BOOTIMAGE_TARGET) \ 1616 $(INSTALLED_RECOVERYIMAGE_TARGET) \ 1617 $(INSTALLED_VBMETAIMAGE_TARGET) \ 1618 $(INSTALLED_USERDATAIMAGE_TARGET) \ 1619 $(INSTALLED_CACHEIMAGE_TARGET) \ 1620 $(INSTALLED_BPTIMAGE_TARGET) \ 1621 $(INSTALLED_VENDORIMAGE_TARGET) \ 1622 $(INSTALLED_ODMIMAGE_TARGET) \ 1623 $(INSTALLED_SUPERIMAGE_EMPTY_TARGET) \ 1624 $(INSTALLED_PRODUCTIMAGE_TARGET) \ 1625 $(INSTALLED_SYSTEMOTHERIMAGE_TARGET) \ 1626 $(INSTALLED_FILES_FILE) \ 1627 $(INSTALLED_FILES_JSON) \ 1628 $(INSTALLED_FILES_FILE_VENDOR) \ 1629 $(INSTALLED_FILES_JSON_VENDOR) \ 1630 $(INSTALLED_FILES_FILE_ODM) \ 1631 $(INSTALLED_FILES_JSON_ODM) \ 1632 $(INSTALLED_FILES_FILE_PRODUCT) \ 1633 $(INSTALLED_FILES_JSON_PRODUCT) \ 1634 $(INSTALLED_FILES_FILE_PRODUCT_SERVICES) \ 1635 $(INSTALLED_FILES_JSON_PRODUCT_SERVICES) \ 1636 $(INSTALLED_FILES_FILE_SYSTEMOTHER) \ 1637 $(INSTALLED_FILES_JSON_SYSTEMOTHER) \ 1638 $(INSTALLED_FILES_FILE_RAMDISK) \ 1639 $(INSTALLED_FILES_JSON_RAMDISK) \ 1640 $(INSTALLED_FILES_FILE_DEBUG_RAMDISK) \ 1641 $(INSTALLED_FILES_JSON_DEBUG_RAMDISK) \ 1642 $(INSTALLED_FILES_FILE_ROOT) \ 1643 $(INSTALLED_FILES_JSON_ROOT) \ 1644 $(INSTALLED_FILES_FILE_RECOVERY) \ 1645 $(INSTALLED_FILES_JSON_RECOVERY) \ 1646 $(INSTALLED_ANDROID_INFO_TXT_TARGET) \ 1647 auxiliary \ 1648 soong_docs 1649 1650# dist_files only for putting your library into the dist directory with a full build. 1651.PHONY: dist_files 1652 1653.PHONY: apps_only 1654ifneq ($(TARGET_BUILD_APPS),) 1655 # If this build is just for apps, only build apps and not the full system by default. 1656 1657 unbundled_build_modules := 1658 ifneq ($(filter all,$(TARGET_BUILD_APPS)),) 1659 # If they used the magic goal "all" then build all apps in the source tree. 1660 unbundled_build_modules := $(foreach m,$(sort $(ALL_MODULES)),$(if $(filter APPS,$(ALL_MODULES.$(m).CLASS)),$(m))) 1661 else 1662 unbundled_build_modules := $(TARGET_BUILD_APPS) 1663 endif 1664 1665 # Dist the installed files if they exist. 1666 apps_only_installed_files := $(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) 1667 $(call dist-for-goals,apps_only, $(apps_only_installed_files)) 1668 1669 # Dist the bundle files if they exist. 1670 apps_only_bundle_files := $(foreach m,$(unbundled_build_modules),\ 1671 $(if $(ALL_MODULES.$(m).BUNDLE),$(ALL_MODULES.$(m).BUNDLE):$(m)-base.zip)) 1672 $(call dist-for-goals,apps_only, $(apps_only_bundle_files)) 1673 1674 # For uninstallable modules such as static Java library, we have to dist the built file, 1675 # as <module_name>.<suffix> 1676 apps_only_dist_built_files := $(foreach m,$(unbundled_build_modules),$(if $(ALL_MODULES.$(m).INSTALLED),,\ 1677 $(if $(ALL_MODULES.$(m).BUILT),$(ALL_MODULES.$(m).BUILT):$(m)$(suffix $(ALL_MODULES.$(m).BUILT)))\ 1678 $(if $(ALL_MODULES.$(m).AAR),$(ALL_MODULES.$(m).AAR):$(m).aar)\ 1679 )) 1680 $(call dist-for-goals,apps_only, $(apps_only_dist_built_files)) 1681 1682 ifeq ($(EMMA_INSTRUMENT),true) 1683 $(JACOCO_REPORT_CLASSES_ALL) : $(apps_only_installed_files) 1684 $(call dist-for-goals,apps_only, $(JACOCO_REPORT_CLASSES_ALL)) 1685 endif 1686 1687 $(PROGUARD_DICT_ZIP) : $(apps_only_installed_files) 1688 $(call dist-for-goals,apps_only, $(PROGUARD_DICT_ZIP)) 1689 1690 $(SYMBOLS_ZIP) : $(apps_only_installed_files) 1691 $(call dist-for-goals,apps_only, $(SYMBOLS_ZIP)) 1692 1693 $(COVERAGE_ZIP) : $(apps_only_installed_files) 1694 $(call dist-for-goals,apps_only, $(COVERAGE_ZIP)) 1695 1696apps_only: $(unbundled_build_modules) 1697 1698droid_targets: apps_only 1699 1700# Combine the NOTICE files for a apps_only build 1701$(eval $(call combine-notice-files, html, \ 1702 $(target_notice_file_txt), \ 1703 $(target_notice_file_html_or_xml), \ 1704 "Notices for files for apps:", \ 1705 $(TARGET_OUT_NOTICE_FILES), \ 1706 $(apps_only_installed_files))) 1707 1708 1709else # TARGET_BUILD_APPS 1710 $(call dist-for-goals, droidcore, \ 1711 $(INTERNAL_UPDATE_PACKAGE_TARGET) \ 1712 $(INTERNAL_OTA_PACKAGE_TARGET) \ 1713 $(INTERNAL_OTA_METADATA) \ 1714 $(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET) \ 1715 $(BUILT_OTATOOLS_PACKAGE) \ 1716 $(SYMBOLS_ZIP) \ 1717 $(COVERAGE_ZIP) \ 1718 $(APPCOMPAT_ZIP) \ 1719 $(INSTALLED_FILES_FILE) \ 1720 $(INSTALLED_FILES_JSON) \ 1721 $(INSTALLED_FILES_FILE_VENDOR) \ 1722 $(INSTALLED_FILES_JSON_VENDOR) \ 1723 $(INSTALLED_FILES_FILE_ODM) \ 1724 $(INSTALLED_FILES_JSON_ODM) \ 1725 $(INSTALLED_FILES_FILE_PRODUCT) \ 1726 $(INSTALLED_FILES_JSON_PRODUCT) \ 1727 $(INSTALLED_FILES_FILE_PRODUCT_SERVICES) \ 1728 $(INSTALLED_FILES_JSON_PRODUCT_SERVICES) \ 1729 $(INSTALLED_FILES_FILE_SYSTEMOTHER) \ 1730 $(INSTALLED_FILES_JSON_SYSTEMOTHER) \ 1731 $(INSTALLED_FILES_FILE_RECOVERY) \ 1732 $(INSTALLED_FILES_JSON_RECOVERY) \ 1733 $(INSTALLED_BUILD_PROP_TARGET) \ 1734 $(BUILT_TARGET_FILES_PACKAGE) \ 1735 $(INSTALLED_ANDROID_INFO_TXT_TARGET) \ 1736 $(INSTALLED_RAMDISK_TARGET) \ 1737 ) 1738 1739 # Put a copy of the radio/bootloader files in the dist dir. 1740 $(foreach f,$(INSTALLED_RADIOIMAGE_TARGET), \ 1741 $(call dist-for-goals, droidcore, $(f))) 1742 1743 ifneq ($(ANDROID_BUILD_EMBEDDED),true) 1744 ifneq ($(TARGET_BUILD_PDK),true) 1745 $(call dist-for-goals, droidcore, \ 1746 $(APPS_ZIP) \ 1747 $(INTERNAL_EMULATOR_PACKAGE_TARGET) \ 1748 $(PACKAGE_STATS_FILE) \ 1749 ) 1750 endif 1751 endif 1752 1753 $(call dist-for-goals, droidcore, \ 1754 $(INSTALLED_FILES_FILE_ROOT) \ 1755 $(INSTALLED_FILES_JSON_ROOT) \ 1756 ) 1757 1758 ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) 1759 $(call dist-for-goals, droidcore, \ 1760 $(INSTALLED_FILES_FILE_RAMDISK) \ 1761 $(INSTALLED_FILES_JSON_RAMDISK) \ 1762 $(INSTALLED_FILES_FILE_DEBUG_RAMDISK) \ 1763 $(INSTALLED_FILES_JSON_DEBUG_RAMDISK) \ 1764 $(INSTALLED_DEBUG_RAMDISK_TARGET) \ 1765 $(INSTALLED_DEBUG_BOOTIMAGE_TARGET) \ 1766 ) 1767 endif 1768 1769 ifeq ($(EMMA_INSTRUMENT),true) 1770 $(JACOCO_REPORT_CLASSES_ALL) : $(INSTALLED_SYSTEMIMAGE_TARGET) 1771 $(call dist-for-goals, dist_files, $(JACOCO_REPORT_CLASSES_ALL)) 1772 endif 1773 1774 # Put XML formatted API files in the dist dir. 1775 $(TARGET_OUT_COMMON_INTERMEDIATES)/api.xml: $(call java-lib-header-files,android_stubs_current) $(APICHECK) 1776 $(TARGET_OUT_COMMON_INTERMEDIATES)/system-api.xml: $(call java-lib-header-files,android_system_stubs_current) $(APICHECK) 1777 $(TARGET_OUT_COMMON_INTERMEDIATES)/test-api.xml: $(call java-lib-header-files,android_test_stubs_current) $(APICHECK) 1778 1779 api_xmls := $(addprefix $(TARGET_OUT_COMMON_INTERMEDIATES)/,api.xml system-api.xml test-api.xml) 1780 $(api_xmls): 1781 $(hide) echo "Converting API file to XML: $@" 1782 $(hide) mkdir -p $(dir $@) 1783 $(hide) $(APICHECK_COMMAND) --input-api-jar $< --api-xml $@ 1784 1785 $(call dist-for-goals, dist_files, $(api_xmls)) 1786 api_xmls := 1787 1788# Building a full system-- the default is to build droidcore 1789droid_targets: droidcore dist_files 1790 1791endif # TARGET_BUILD_APPS 1792 1793.PHONY: docs 1794docs: $(ALL_DOCS) 1795 1796.PHONY: sdk win_sdk winsdk-tools sdk_addon 1797ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET) 1798sdk: $(ALL_SDK_TARGETS) 1799$(call dist-for-goals,sdk win_sdk, \ 1800 $(ALL_SDK_TARGETS) \ 1801 $(SYMBOLS_ZIP) \ 1802 $(COVERAGE_ZIP) \ 1803 $(APPCOMPAT_ZIP) \ 1804 $(INSTALLED_BUILD_PROP_TARGET) \ 1805) 1806 1807# umbrella targets to assit engineers in verifying builds 1808.PHONY: java native target host java-host java-target native-host native-target \ 1809 java-host-tests java-target-tests native-host-tests native-target-tests \ 1810 java-tests native-tests host-tests target-tests tests java-dex \ 1811 native-host-cross 1812# some synonyms 1813.PHONY: host-java target-java host-native target-native \ 1814 target-java-tests target-native-tests 1815host-java : java-host 1816target-java : java-target 1817host-native : native-host 1818target-native : native-target 1819target-java-tests : java-target-tests 1820target-native-tests : native-target-tests 1821tests : host-tests target-tests 1822 1823# Phony target to run all java compilations that use javac 1824.PHONY: javac-check 1825 1826ifneq (,$(filter samplecode, $(MAKECMDGOALS))) 1827.PHONY: samplecode 1828sample_MODULES := $(sort $(call get-tagged-modules,samples)) 1829sample_APKS_DEST_PATH := $(TARGET_COMMON_OUT_ROOT)/samples 1830sample_APKS_COLLECTION := \ 1831 $(foreach module,$(sample_MODULES),$(sample_APKS_DEST_PATH)/$(notdir $(module))) 1832$(foreach module,$(sample_MODULES),$(eval $(call \ 1833 copy-one-file,$(module),$(sample_APKS_DEST_PATH)/$(notdir $(module))))) 1834sample_ADDITIONAL_INSTALLED := \ 1835 $(filter-out $(modules_to_install) $(modules_to_check),$(sample_MODULES)) 1836samplecode: $(sample_APKS_COLLECTION) 1837 @echo "Collect sample code apks: $^" 1838 # remove apks that are not intended to be installed. 1839 rm -f $(sample_ADDITIONAL_INSTALLED) 1840endif # samplecode in $(MAKECMDGOALS) 1841 1842.PHONY: findbugs 1843findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET) 1844 1845LSDUMP_PATHS_FILE := $(PRODUCT_OUT)/lsdump_paths.txt 1846 1847.PHONY: findlsdumps 1848findlsdumps: $(LSDUMP_PATHS_FILE) $(LSDUMP_PATHS) 1849 1850$(LSDUMP_PATHS_FILE): PRIVATE_LSDUMP_PATHS := $(LSDUMP_PATHS) 1851$(LSDUMP_PATHS_FILE): 1852 @echo "Generate $@" 1853 @rm -rf $@ && echo "$(PRIVATE_LSDUMP_PATHS)" | sed -e 's/ /\n/g' > $@ 1854 1855.PHONY: check-elf-files 1856check-elf-files: 1857 1858#xxx scrape this from ALL_MODULE_NAME_TAGS 1859.PHONY: modules 1860modules: 1861 @echo "Available sub-modules:" 1862 @echo "$(call module-names-for-tag-list,$(ALL_MODULE_TAGS))" | \ 1863 tr -s ' ' '\n' | sort -u 1864 1865.PHONY: dump-files 1866dump-files: 1867 $(info product_target_FILES for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):) 1868 $(foreach p,$(sort $(product_target_FILES)),$(info : $(p))) 1869 @echo Successfully dumped product file list 1870 1871.PHONY: nothing 1872nothing: 1873 @echo Successfully read the makefiles. 1874 1875.PHONY: tidy_only 1876tidy_only: 1877 @echo Successfully make tidy_only. 1878 1879ndk: $(SOONG_OUT_DIR)/ndk.timestamp 1880.PHONY: ndk 1881 1882$(call dist-write-file,$(KATI_PACKAGE_MK_DIR)/dist.mk) 1883 1884$(info [$(call inc_and_print,subdir_makefiles_inc)/$(subdir_makefiles_total)] writing build rules ...) 1885 1886endif # KATI 1887