main.mk revision 56c6a9d1ffc75b47228a97fb87fef4e0110e83bc
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 12# Absolute path of the present working direcotry. 13# This overrides the shell variable $PWD, which does not necessarily points to 14# the top of the source tree, for example when "make -C" is used in m/mm/mmm. 15PWD := $(shell pwd) 16 17TOP := . 18TOPDIR := 19 20BUILD_SYSTEM := $(TOPDIR)build/core 21 22# This is the default target. It must be the first declared target. 23.PHONY: droid 24DEFAULT_GOAL := droid 25$(DEFAULT_GOAL): droid_targets 26 27.PHONY: droid_targets 28droid_targets: 29 30# Targets that provide quick help on the build system. 31include $(BUILD_SYSTEM)/help.mk 32 33# Set up various standard variables based on configuration 34# and host information. 35include $(BUILD_SYSTEM)/config.mk 36 37ifndef KATI 38ifdef USE_NINJA 39$(warning USE_NINJA is ignored. Ninja is always used.) 40endif 41 42# Mark this is a ninja build. 43$(shell mkdir -p $(OUT_DIR) && touch $(OUT_DIR)/ninja_build) 44include build/core/ninja.mk 45else # KATI 46 47ifneq ($(filter $(dont_bother_goals), $(MAKECMDGOALS)),) 48dont_bother := true 49endif 50 51include $(SOONG_MAKEVARS_MK) 52 53include $(BUILD_SYSTEM)/clang/config.mk 54 55# Write the build number to a file so it can be read back in 56# without changing the command line every time. Avoids rebuilds 57# when using ninja. 58$(shell mkdir -p $(OUT_DIR) && \ 59 echo -n $(BUILD_NUMBER) > $(OUT_DIR)/build_number.txt && \ 60 echo -n $(BUILD_DATETIME) > $(OUT_DIR)/build_date.txt) 61BUILD_NUMBER_FROM_FILE := $$(cat $(OUT_DIR)/build_number.txt) 62BUILD_DATETIME_FROM_FILE := $$(cat $(OUT_DIR)/build_date.txt) 63ifeq ($(HOST_OS),darwin) 64DATE_FROM_FILE := date -r $(BUILD_DATETIME_FROM_FILE) 65else 66DATE_FROM_FILE := date -d @$(BUILD_DATETIME_FROM_FILE) 67endif 68 69# CTS-specific config. 70-include cts/build/config.mk 71# VTS-specific config. 72-include test/vts/tools/vts-tradefed/build/config.mk 73 74# This allows us to force a clean build - included after the config.mk 75# environment setup is done, but before we generate any dependencies. This 76# file does the rm -rf inline so the deps which are all done below will 77# be generated correctly 78include $(BUILD_SYSTEM)/cleanbuild.mk 79 80# Include the google-specific config 81-include vendor/google/build/config.mk 82 83VERSION_CHECK_SEQUENCE_NUMBER := 6 84JAVA_NOT_REQUIRED_CHECKED := 85-include $(OUT_DIR)/versions_checked.mk 86ifneq ($(VERSION_CHECK_SEQUENCE_NUMBER)$(JAVA_NOT_REQUIRED),$(VERSIONS_CHECKED)$(JAVA_NOT_REQUIRED_CHECKED)) 87 88$(info Checking build tools versions...) 89 90# check for a case sensitive file system 91ifneq (a,$(shell mkdir -p $(OUT_DIR) ; \ 92 echo a > $(OUT_DIR)/casecheck.txt; \ 93 echo B > $(OUT_DIR)/CaseCheck.txt; \ 94 cat $(OUT_DIR)/casecheck.txt)) 95$(warning ************************************************************) 96$(warning You are building on a case-insensitive filesystem.) 97$(warning Please move your source tree to a case-sensitive filesystem.) 98$(warning ************************************************************) 99$(error Case-insensitive filesystems not supported) 100endif 101 102# Make sure that there are no spaces in the absolute path; the 103# build system can't deal with them. 104ifneq ($(words $(shell pwd)),1) 105$(warning ************************************************************) 106$(warning You are building in a directory whose absolute path contains) 107$(warning a space character:) 108$(warning $(space)) 109$(warning "$(shell pwd)") 110$(warning $(space)) 111$(warning Please move your source tree to a path that does not contain) 112$(warning any spaces.) 113$(warning ************************************************************) 114$(error Directory names containing spaces not supported) 115endif 116 117ifneq ($(JAVA_NOT_REQUIRED),true) 118java_version_str := $(shell unset _JAVA_OPTIONS && java -version 2>&1) 119javac_version_str := $(shell unset _JAVA_OPTIONS && javac -version 2>&1) 120 121# Check for the correct version of java, should be 1.8 by 122# default and only 1.7 if LEGACY_USE_JAVA7 is set. 123ifeq ($(LEGACY_USE_JAVA7),) # if LEGACY_USE_JAVA7 == '' 124required_version := "1.8.x" 125required_javac_version := "1.8" 126java_version := $(shell echo '$(java_version_str)' | grep '[ "]1\.8[\. "$$]') 127javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.8[\. "$$]') 128else 129required_version := "1.7.x" 130required_javac_version := "1.7" 131java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.7[\. "$$]') 132javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.7[\. "$$]') 133endif # if LEGACY_USE_JAVA7 == '' 134 135ifeq ($(strip $(java_version)),) 136$(info ************************************************************) 137$(info You are attempting to build with the incorrect version) 138$(info of java.) 139$(info $(space)) 140$(info Your version is: $(java_version_str).) 141$(info The required version is: $(required_version)) 142$(info $(space)) 143$(info Please follow the machine setup instructions at) 144$(info $(space)$(space)$(space)$(space)https://source.android.com/source/initializing.html) 145$(info ************************************************************) 146$(error stop) 147endif 148 149# Check for the current JDK. 150# 151# For Java 1.7/1.8, we require OpenJDK on linux and Oracle JDK on Mac OS. 152requires_openjdk := false 153ifeq ($(BUILD_OS),linux) 154requires_openjdk := true 155endif 156 157 158# Check for the current jdk 159ifeq ($(requires_openjdk), true) 160# The user asked for openjdk, so check that the host 161# java version is really openjdk and not some other JDK. 162ifeq ($(shell echo '$(java_version_str)' | grep -i openjdk),) 163$(info ************************************************************) 164$(info You asked for an OpenJDK based build but your version is) 165$(info $(java_version_str).) 166$(info ************************************************************) 167$(error stop) 168endif # java version is not OpenJdk 169else # if requires_openjdk 170ifneq ($(shell echo '$(java_version_str)' | grep -i openjdk),) 171$(info ************************************************************) 172$(info You are attempting to build with an unsupported JDK.) 173$(info $(space)) 174$(info You use OpenJDK but only Sun/Oracle JDK is supported.) 175$(info Please follow the machine setup instructions at) 176$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html) 177$(info ************************************************************) 178$(error stop) 179endif # java version is not Sun Oracle JDK 180endif # if requires_openjdk 181 182KNOWN_INCOMPATIBLE_JAVAC_VERSIONS := google 183incompat_javac := $(foreach v,$(KNOWN_INCOMPATIBLE_JAVAC_VERSIONS),$(findstring $(v),$(javac_version_str))) 184ifneq ($(incompat_javac),) 185javac_version := 186endif 187 188# Check for the correct version of javac 189ifeq ($(strip $(javac_version)),) 190$(info ************************************************************) 191$(info You are attempting to build with the incorrect version) 192$(info of javac.) 193$(info $(space)) 194$(info Your version is: $(javac_version_str).) 195ifneq ($(incompat_javac),) 196$(info This '$(incompat_javac)' version is not supported for Android platform builds.) 197$(info Use a publicly available JDK and make sure you have run envsetup.sh / lunch.) 198else 199$(info The required version is: $(required_javac_version)) 200endif 201$(info $(space)) 202$(info Please follow the machine setup instructions at) 203$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html) 204$(info ************************************************************) 205$(error stop) 206endif 207 208endif # if JAVA_NOT_REQUIRED 209 210ifndef BUILD_EMULATOR 211 # Emulator binaries are now provided under prebuilts/android-emulator/ 212 BUILD_EMULATOR := false 213endif 214 215$(shell echo 'VERSIONS_CHECKED := $(VERSION_CHECK_SEQUENCE_NUMBER)' \ 216 > $(OUT_DIR)/versions_checked.mk) 217$(shell echo 'BUILD_EMULATOR ?= $(BUILD_EMULATOR)' \ 218 >> $(OUT_DIR)/versions_checked.mk) 219$(shell echo 'JAVA_NOT_REQUIRED_CHECKED := $(JAVA_NOT_REQUIRED)' \ 220 >> $(OUT_DIR)/versions_checked.mk) 221endif 222 223# These are the modifier targets that don't do anything themselves, but 224# change the behavior of the build. 225# (must be defined before including definitions.make) 226INTERNAL_MODIFIER_TARGETS := showcommands all 227 228# EMMA_INSTRUMENT_STATIC merges the static emma library to each emma-enabled module. 229ifeq (true,$(EMMA_INSTRUMENT_STATIC)) 230EMMA_INSTRUMENT := true 231endif 232 233# Bring in standard build system definitions. 234include $(BUILD_SYSTEM)/definitions.mk 235 236# Bring in dex_preopt.mk 237include $(BUILD_SYSTEM)/dex_preopt.mk 238 239ifneq ($(filter user userdebug eng,$(MAKECMDGOALS)),) 240$(info ***************************************************************) 241$(info ***************************************************************) 242$(info Do not pass '$(filter user userdebug eng,$(MAKECMDGOALS))' on \ 243 the make command line.) 244$(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or) 245$(info choosecombo.) 246$(info ***************************************************************) 247$(info ***************************************************************) 248$(error stopping) 249endif 250 251ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),) 252$(info ***************************************************************) 253$(info ***************************************************************) 254$(info Invalid variant: $(TARGET_BUILD_VARIANT)) 255$(info Valid values are: $(INTERNAL_VALID_VARIANTS)) 256$(info ***************************************************************) 257$(info ***************************************************************) 258$(error stopping) 259endif 260 261# ----------------------------------------------------------------- 262# Variable to check java support level inside PDK build. 263# Not necessary if the components is not in PDK. 264# not defined : not supported 265# "sdk" : sdk API only 266# "platform" : platform API supproted 267TARGET_BUILD_JAVA_SUPPORT_LEVEL := platform 268 269# ----------------------------------------------------------------- 270# The pdk (Platform Development Kit) build 271include build/core/pdk_config.mk 272 273# 274# ----------------------------------------------------------------- 275# Jack version configuration 276-include $(TOPDIR)prebuilts/sdk/tools/jack_versions.mk 277-include $(TOPDIR)prebuilts/sdk/tools/jack_for_module.mk 278 279# 280# ----------------------------------------------------------------- 281# Install and start Jack server 282-include $(TOPDIR)prebuilts/sdk/tools/jack_server_setup.mk 283 284# 285# ----------------------------------------------------------------- 286# Jacoco package name for Jack 287-include $(TOPDIR)external/jacoco/config.mk 288 289# 290# ----------------------------------------------------------------- 291# Enable dynamic linker developer warnings for all builds except 292# final release. 293ifneq ($(PLATFORM_VERSION_CODENAME),REL) 294 ADDITIONAL_BUILD_PROPERTIES += ro.bionic.ld.warning=1 295endif 296 297# ----------------------------------------------------------------- 298### 299### In this section we set up the things that are different 300### between the build variants 301### 302 303is_sdk_build := 304 305ifneq ($(filter sdk win_sdk sdk_addon,$(MAKECMDGOALS)),) 306is_sdk_build := true 307endif 308 309# Add build properties for ART. These define system properties used by installd 310# to pass flags to dex2oat. 311ADDITIONAL_BUILD_PROPERTIES += persist.sys.dalvik.vm.lib.2=libart.so 312ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).variant=$(DEX2OAT_TARGET_CPU_VARIANT) 313ifneq ($(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),) 314 ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).features=$(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) 315endif 316 317ifdef TARGET_2ND_ARCH 318 ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_2ND_ARCH).variant=$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT) 319 ifneq ($($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),) 320 ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_2ND_ARCH).features=$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) 321 endif 322endif 323 324## user/userdebug ## 325 326user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT)) 327enable_target_debugging := true 328tags_to_install := 329ifneq (,$(user_variant)) 330 # Target is secure in user builds. 331 ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1 332 ADDITIONAL_DEFAULT_PROPERTIES += security.perf_harden=1 333 334 ifeq ($(user_variant),user) 335 ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1 336 endif 337 338 ifeq ($(user_variant),userdebug) 339 # Pick up some extra useful tools 340 tags_to_install += debug 341 else 342 # Disable debugging in plain user builds. 343 enable_target_debugging := 344 endif 345 346 # Disallow mock locations by default for user builds 347 ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=0 348 349else # !user_variant 350 # Turn on checkjni for non-user builds. 351 ADDITIONAL_BUILD_PROPERTIES += ro.kernel.android.checkjni=1 352 # Set device insecure for non-user builds. 353 ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0 354 # Allow mock locations by default for non user builds 355 ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=1 356endif # !user_variant 357 358ifeq (true,$(strip $(enable_target_debugging))) 359 # Target is more debuggable and adbd is on by default 360 ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1 361 # Enable Dalvik lock contention logging. 362 ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500 363 # Include the debugging/testing OTA keys in this build. 364 INCLUDE_TEST_OTA_KEYS := true 365else # !enable_target_debugging 366 # Target is less debuggable and adbd is off by default 367 ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0 368endif # !enable_target_debugging 369 370## eng ## 371 372ifeq ($(TARGET_BUILD_VARIANT),eng) 373tags_to_install := debug eng 374ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))),) 375 # Don't require the setup wizard on eng builds 376 ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\ 377 $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))) \ 378 ro.setupwizard.mode=OPTIONAL 379endif 380ifndef is_sdk_build 381 # To speedup startup of non-preopted builds, don't verify or compile the boot image. 382 ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.image-dex2oat-filter=verify-at-runtime 383endif 384endif 385 386## sdk ## 387 388ifdef is_sdk_build 389 390# Detect if we want to build a repository for the SDK 391sdk_repo_goal := $(strip $(filter sdk_repo,$(MAKECMDGOALS))) 392MAKECMDGOALS := $(strip $(filter-out sdk_repo,$(MAKECMDGOALS))) 393 394ifneq ($(words $(sort $(filter-out $(INTERNAL_MODIFIER_TARGETS) checkbuild emulator_tests target-files-package,$(MAKECMDGOALS)))),1) 395$(error The 'sdk' target may not be specified with any other targets) 396endif 397 398# AUX dependencies are already added by now; remove triggers from the MAKECMDGOALS 399MAKECMDGOALS := $(strip $(filter-out AUX-%,$(MAKECMDGOALS))) 400 401# TODO: this should be eng I think. Since the sdk is built from the eng 402# variant. 403tags_to_install := debug eng 404ADDITIONAL_BUILD_PROPERTIES += xmpp.auto-presence=true 405ADDITIONAL_BUILD_PROPERTIES += ro.config.nocheckin=yes 406else # !sdk 407endif 408 409BUILD_WITHOUT_PV := true 410 411ADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android 412 413# enable vm tracing in files for now to help track 414# the cause of ANRs in the content process 415ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.stack-trace-file=/data/anr/traces.txt 416 417# ------------------------------------------------------------ 418# Define a function that, given a list of module tags, returns 419# non-empty if that module should be installed in /system. 420 421# For most goals, anything not tagged with the "tests" tag should 422# be installed in /system. 423define should-install-to-system 424$(if $(filter tests,$(1)),,true) 425endef 426 427ifdef is_sdk_build 428# For the sdk goal, anything with the "samples" tag should be 429# installed in /data even if that module also has "eng"/"debug"/"user". 430define should-install-to-system 431$(if $(filter samples tests,$(1)),,true) 432endef 433endif 434 435 436# If they only used the modifier goals (showcommands, etc), we'll actually 437# build the default target. 438ifeq ($(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS)),) 439.PHONY: $(INTERNAL_MODIFIER_TARGETS) 440$(INTERNAL_MODIFIER_TARGETS): $(DEFAULT_GOAL) 441endif 442 443# 444# Typical build; include any Android.mk files we can find. 445# 446 447FULL_BUILD := true 448 449# Before we go and include all of the module makefiles, mark the PRODUCT_* 450# values readonly so that they won't be modified. 451$(call readonly-product-vars) 452 453ifneq ($(ONE_SHOT_MAKEFILE),) 454# We've probably been invoked by the "mm" shell function 455# with a subdirectory's makefile. 456include $(SOONG_ANDROID_MK) $(wildcard $(ONE_SHOT_MAKEFILE)) 457# Change CUSTOM_MODULES to include only modules that were 458# defined by this makefile; this will install all of those 459# modules as a side-effect. Do this after including ONE_SHOT_MAKEFILE 460# so that the modules will be installed in the same place they 461# would have been with a normal make. 462CUSTOM_MODULES := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS))) 463FULL_BUILD := 464# Stub out the notice targets, which probably aren't defined 465# when using ONE_SHOT_MAKEFILE. 466NOTICE-HOST-%: ; 467NOTICE-TARGET-%: ; 468 469# A helper goal printing out install paths 470define register_module_install_path 471.PHONY: GET-MODULE-INSTALL-PATH-$(1) 472GET-MODULE-INSTALL-PATH-$(1): 473 echo 'INSTALL-PATH: $(1) $(ALL_MODULES.$(1).INSTALLED)' 474endef 475 476SORTED_ALL_MODULES := $(sort $(ALL_MODULES)) 477UNIQUE_ALL_MODULES := 478$(foreach m,$(SORTED_ALL_MODULES),\ 479 $(if $(call streq,$(m),$(lastword $(UNIQUE_ALL_MODULES))),,\ 480 $(eval UNIQUE_ALL_MODULES += $(m)))) 481SORTED_ALL_MODULES := 482 483$(foreach mod,$(UNIQUE_ALL_MODULES),$(if $(ALL_MODULES.$(mod).INSTALLED),\ 484 $(eval $(call register_module_install_path,$(mod)))\ 485 $(foreach path,$(ALL_MODULES.$(mod).PATH),\ 486 $(eval my_path_prefix := GET-INSTALL-PATH-IN)\ 487 $(foreach component,$(subst /,$(space),$(path)),\ 488 $(eval my_path_prefix := $$(my_path_prefix)-$$(component))\ 489 $(eval .PHONY: $$(my_path_prefix))\ 490 $(eval $$(my_path_prefix): GET-MODULE-INSTALL-PATH-$(mod)))))) 491UNIQUE_ALL_MODULES := 492 493else # ONE_SHOT_MAKEFILE 494 495ifneq ($(dont_bother),true) 496# 497# Include all of the makefiles in the system 498# 499 500subdir_makefiles := $(SOONG_ANDROID_MK) $(call first-makefiles-under,$(TOP)) 501 502$(foreach mk,$(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk))) 503 504ifdef PDK_FUSION_PLATFORM_ZIP 505# Bring in the PDK platform.zip modules. 506include $(BUILD_SYSTEM)/pdk_fusion_modules.mk 507endif # PDK_FUSION_PLATFORM_ZIP 508 509endif # dont_bother 510 511endif # ONE_SHOT_MAKEFILE 512 513# Now with all Android.mks loaded we can do post cleaning steps. 514include $(BUILD_SYSTEM)/post_clean.mk 515 516# ------------------------------------------------------------------- 517# All module makefiles have been included at this point. 518# ------------------------------------------------------------------- 519 520 521# ------------------------------------------------------------------- 522# Fix up CUSTOM_MODULES to refer to installed files rather than 523# just bare module names. Leave unknown modules alone in case 524# they're actually full paths to a particular file. 525known_custom_modules := $(filter $(ALL_MODULES),$(CUSTOM_MODULES)) 526unknown_custom_modules := $(filter-out $(ALL_MODULES),$(CUSTOM_MODULES)) 527CUSTOM_MODULES := \ 528 $(call module-installed-files,$(known_custom_modules)) \ 529 $(unknown_custom_modules) 530 531# ------------------------------------------------------------------- 532# Define dependencies for modules that require other modules. 533# This can only happen now, after we've read in all module makefiles. 534# 535# TODO: deal with the fact that a bare module name isn't 536# unambiguous enough. Maybe declare short targets like 537# APPS:Quake or HOST:SHARED_LIBRARIES:libutils. 538# BUG: the system image won't know to depend on modules that are 539# brought in as requirements of other modules. 540# 541# Resolve the required module name to 32-bit or 64-bit variant. 542# Get a list of corresponding 32-bit module names, if one exists. 543ifneq ($(TARGET_TRANSLATE_2ND_ARCH),true) 544define get-32-bit-modules 545$(sort $(foreach m,$(1),\ 546 $(if $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).CLASS),\ 547 $(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX))\ 548 $(if $(ALL_MODULES.$(m)$(HOST_2ND_ARCH_MODULE_SUFFIX).CLASS),\ 549 $(m)$(HOST_2ND_ARCH_MODULE_SUFFIX))\ 550 )) 551endef 552# Get a list of corresponding 32-bit module names, if one exists; 553# otherwise return the original module name 554define get-32-bit-modules-if-we-can 555$(sort $(foreach m,$(1),\ 556 $(if $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).CLASS)$(ALL_MODULES.$(m)$(HOST_2ND_ARCH_MODULE_SUFFIX).CLASS),\ 557 $(if $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).CLASS),$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX)) \ 558 $(if $(ALL_MODULES.$(m)$(HOST_2ND_ARCH_MODULE_SUFFIX).CLASS),$(m)$(HOST_2ND_ARCH_MODULE_SUFFIX)),\ 559 $(m)))) 560endef 561else # TARGET_TRANSLATE_2ND_ARCH 562# For binary translation config, by default only install the first arch. 563define get-32-bit-modules 564endef 565 566define get-32-bit-modules-if-we-can 567$(strip $(1)) 568endef 569endif # TARGET_TRANSLATE_2ND_ARCH 570 571# If a module is for a cross host os, the required modules must be for 572# that OS too. 573# If a module is built for 32-bit, the required modules must be 32-bit too; 574# Otherwise if the module is an exectuable or shared library, 575# the required modules must be 64-bit; 576# otherwise we require both 64-bit and 32-bit variant, if one exists. 577$(foreach m,$(ALL_MODULES),\ 578 $(eval r := $(ALL_MODULES.$(m).REQUIRED))\ 579 $(if $(r),\ 580 $(if $(ALL_MODULES.$(m).FOR_HOST_CROSS),\ 581 $(eval r := $(addprefix host_cross_,$(r))))\ 582 $(if $(ALL_MODULES.$(m).FOR_2ND_ARCH),\ 583 $(eval r_r := $(call get-32-bit-modules-if-we-can,$(r))),\ 584 $(if $(filter EXECUTABLES SHARED_LIBRARIES NATIVE_TESTS,$(ALL_MODULES.$(m).CLASS)),\ 585 $(eval r_r := $(r)),\ 586 $(eval r_r := $(r) $(call get-32-bit-modules,$(r)))\ 587 )\ 588 )\ 589 $(eval ALL_MODULES.$(m).REQUIRED := $(strip $(r_r)))\ 590 )\ 591) 592r_r := 593 594define add-required-deps 595$(1): | $(2) 596endef 597 598# Use a normal dependency instead of an order-only dependency when installing 599# host dynamic binaries so that the timestamp of the final binary always 600# changes, even if the toc optimization has skipped relinking the binary 601# and its dependant shared libraries. 602define add-required-host-so-deps 603$(1): $(2) 604endef 605 606$(foreach m,$(ALL_MODULES), \ 607 $(eval r := $(ALL_MODULES.$(m).REQUIRED)) \ 608 $(if $(r), \ 609 $(eval r := $(call module-installed-files,$(r))) \ 610 $(eval t_m := $(filter $(TARGET_OUT_ROOT)/%, $(ALL_MODULES.$(m).INSTALLED))) \ 611 $(eval h_m := $(filter $(HOST_OUT)/%, $(ALL_MODULES.$(m).INSTALLED))) \ 612 $(eval hc_m := $(filter $(HOST_CROSS_OUT)/%, $(ALL_MODULES.$(m).INSTALLED))) \ 613 $(eval t_r := $(filter $(TARGET_OUT_ROOT)/%, $(r))) \ 614 $(eval h_r := $(filter $(HOST_OUT)/%, $(r))) \ 615 $(eval hc_r := $(filter $(HOST_CROSS_OUT)/%, $(r))) \ 616 $(eval t_m := $(filter-out $(t_r), $(t_m))) \ 617 $(eval h_m := $(filter-out $(h_r), $(h_m))) \ 618 $(eval hc_m := $(filter-out $(hc_r), $(hc_m))) \ 619 $(if $(t_m), $(eval $(call add-required-deps, $(t_m),$(t_r)))) \ 620 $(if $(h_m), $(eval $(call add-required-deps, $(h_m),$(h_r)))) \ 621 $(if $(hc_m), $(eval $(call add-required-deps, $(hc_m),$(hc_r)))) \ 622 ) \ 623 ) 624 625t_m := 626h_m := 627hc_m := 628t_r := 629h_r := 630hc_r := 631 632# Establish the dependecies on the shared libraries. 633# It also adds the shared library module names to ALL_MODULES.$(m).REQUIRED, 634# so they can be expanded to product_MODULES later. 635# $(1): TARGET_ or HOST_ or HOST_CROSS_. 636# $(2): non-empty for 2nd arch. 637# $(3): non-empty for host cross compile. 638define resolve-shared-libs-depes 639$(foreach m,$($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))$(1)DEPENDENCIES_ON_SHARED_LIBRARIES),\ 640 $(eval p := $(subst :,$(space),$(m)))\ 641 $(eval mod := $(firstword $(p)))\ 642 $(eval deps := $(subst $(comma),$(space),$(lastword $(p))))\ 643 $(eval root := $(1)OUT$(if $(call streq,$(1),TARGET_),_ROOT))\ 644 $(if $(2),$(eval deps := $(addsuffix $($(1)2ND_ARCH_MODULE_SUFFIX),$(deps))))\ 645 $(if $(3),$(eval deps := $(addprefix host_cross_,$(deps))))\ 646 $(eval r := $(filter $($(root))/%,$(call module-installed-files,\ 647 $(deps))))\ 648 $(if $(filter $(1),HOST_),\ 649 $(eval $(call add-required-host-so-deps,$(word 2,$(p)),$(r))),\ 650 $(eval $(call add-required-deps,$(word 2,$(p)),$(r))))\ 651 $(eval ALL_MODULES.$(mod).REQUIRED += $(deps))) 652endef 653 654$(call resolve-shared-libs-depes,TARGET_) 655ifdef TARGET_2ND_ARCH 656$(call resolve-shared-libs-depes,TARGET_,true) 657endif 658$(call resolve-shared-libs-depes,HOST_) 659ifdef HOST_2ND_ARCH 660$(call resolve-shared-libs-depes,HOST_,true) 661endif 662ifdef HOST_CROSS_OS 663$(call resolve-shared-libs-depes,HOST_CROSS_,,true) 664endif 665 666m := 667r := 668p := 669deps := 670add-required-deps := 671 672# ------------------------------------------------------------------- 673# Figure out our module sets. 674# 675# Of the modules defined by the component makefiles, 676# determine what we actually want to build. 677 678########################################################### 679## Expand a module name list with REQUIRED modules 680########################################################### 681# $(1): The variable name that holds the initial module name list. 682# the variable will be modified to hold the expanded results. 683# $(2): The initial module name list. 684# Returns empty string (maybe with some whitespaces). 685define expand-required-modules 686$(eval _erm_new_modules := $(sort $(filter-out $($(1)),\ 687 $(foreach m,$(2),$(ALL_MODULES.$(m).REQUIRED)))))\ 688$(if $(_erm_new_modules),$(eval $(1) += $(_erm_new_modules))\ 689 $(call expand-required-modules,$(1),$(_erm_new_modules))) 690endef 691 692ifdef FULL_BUILD 693 # The base list of modules to build for this product is specified 694 # by the appropriate product definition file, which was included 695 # by product_config.mk. 696 product_MODULES := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES) 697 # Filter out the overridden packages before doing expansion 698 product_MODULES := $(filter-out $(foreach p, $(product_MODULES), \ 699 $(PACKAGES.$(p).OVERRIDES)), $(product_MODULES)) 700 701 # Resolve the :32 :64 module name 702 modules_32 := $(patsubst %:32,%,$(filter %:32, $(product_MODULES))) 703 modules_64 := $(patsubst %:64,%,$(filter %:64, $(product_MODULES))) 704 modules_rest := $(filter-out %:32 %:64,$(product_MODULES)) 705 # Note for 32-bit product, $(modules_32) and $(modules_64) will be 706 # added as their original module names. 707 product_MODULES := $(call get-32-bit-modules-if-we-can, $(modules_32)) 708 product_MODULES += $(modules_64) 709 # For the rest we add both 710 product_MODULES += $(call get-32-bit-modules, $(modules_rest)) 711 product_MODULES += $(modules_rest) 712 713 $(call expand-required-modules,product_MODULES,$(product_MODULES)) 714 715 product_FILES := $(call module-installed-files, $(product_MODULES)) 716 ifeq (0,1) 717 $(info product_FILES for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):) 718 $(foreach p,$(product_FILES),$(info : $(p))) 719 $(error done) 720 endif 721else 722 # We're not doing a full build, and are probably only including 723 # a subset of the module makefiles. Don't try to build any modules 724 # requested by the product, because we probably won't have rules 725 # to build them. 726 product_FILES := 727endif 728 729eng_MODULES := $(sort \ 730 $(call get-tagged-modules,eng) \ 731 $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_ENG)) \ 732 ) 733debug_MODULES := $(sort \ 734 $(call get-tagged-modules,debug) \ 735 $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG)) \ 736 ) 737tests_MODULES := $(sort \ 738 $(call get-tagged-modules,tests) \ 739 $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS)) \ 740 ) 741 742# TODO: Remove the 3 places in the tree that use ALL_DEFAULT_INSTALLED_MODULES 743# and get rid of it from this list. 744modules_to_install := $(sort \ 745 $(ALL_DEFAULT_INSTALLED_MODULES) \ 746 $(product_FILES) \ 747 $(foreach tag,$(tags_to_install),$($(tag)_MODULES)) \ 748 $(CUSTOM_MODULES) \ 749 ) 750 751# Some packages may override others using LOCAL_OVERRIDES_PACKAGES. 752# Filter out (do not install) any overridden packages. 753overridden_packages := $(call get-package-overrides,$(modules_to_install)) 754ifdef overridden_packages 755# old_modules_to_install := $(modules_to_install) 756 modules_to_install := \ 757 $(filter-out $(foreach p,$(overridden_packages),$(p) %/$(p).apk %/$(p).odex), \ 758 $(modules_to_install)) 759endif 760#$(error filtered out 761# $(filter-out $(modules_to_install),$(old_modules_to_install))) 762 763# Don't include any GNU General Public License shared objects or static 764# libraries in SDK images. GPL executables (not static/dynamic libraries) 765# are okay if they don't link against any closed source libraries (directly 766# or indirectly) 767 768# It's ok (and necessary) to build the host tools, but nothing that's 769# going to be installed on the target (including static libraries). 770 771ifdef is_sdk_build 772 target_gnu_MODULES := \ 773 $(filter \ 774 $(TARGET_OUT_INTERMEDIATES)/% \ 775 $(TARGET_OUT)/% \ 776 $(TARGET_OUT_DATA)/%, \ 777 $(sort $(call get-tagged-modules,gnu))) 778 target_gnu_MODULES := $(filter-out $(TARGET_OUT_EXECUTABLES)/%,$(target_gnu_MODULES)) 779 $(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d))) 780 modules_to_install := \ 781 $(filter-out $(target_gnu_MODULES),$(modules_to_install)) 782 783 # Ensure every module listed in PRODUCT_PACKAGES* gets something installed 784 # TODO: Should we do this for all builds and not just the sdk? 785 dangling_modules := 786 $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \ 787 $(if $(strip $(ALL_MODULES.$(m).INSTALLED) $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).INSTALLED)),,\ 788 $(eval dangling_modules += $(m)))) 789 ifneq ($(dangling_modules),) 790 $(warning: Modules '$(dangling_modules)' in PRODUCT_PACKAGES have nothing to install!) 791 endif 792 $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG), \ 793 $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ 794 $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_DEBUG has nothing to install!))) 795 $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_ENG), \ 796 $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ 797 $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_ENG has nothing to install!))) 798 $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS), \ 799 $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ 800 $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_TESTS has nothing to install!))) 801endif 802 803# build/core/Makefile contains extra stuff that we don't want to pollute this 804# top-level makefile with. It expects that ALL_DEFAULT_INSTALLED_MODULES 805# contains everything that's built during the current make, but it also further 806# extends ALL_DEFAULT_INSTALLED_MODULES. 807ALL_DEFAULT_INSTALLED_MODULES := $(modules_to_install) 808include $(BUILD_SYSTEM)/Makefile 809modules_to_install := $(sort $(ALL_DEFAULT_INSTALLED_MODULES)) 810ALL_DEFAULT_INSTALLED_MODULES := 811 812 813# These are additional goals that we build, in order to make sure that there 814# is as little code as possible in the tree that doesn't build. 815modules_to_check := $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).CHECKED)) 816 817# If you would like to build all goals, and not skip any intermediate 818# steps, you can pass the "all" modifier goal on the commandline. 819ifneq ($(filter all,$(MAKECMDGOALS)),) 820modules_to_check += $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).BUILT)) 821endif 822 823# for easier debugging 824modules_to_check := $(sort $(modules_to_check)) 825#$(error modules_to_check $(modules_to_check)) 826 827# ------------------------------------------------------------------- 828# This is used to to get the ordering right, you can also use these, 829# but they're considered undocumented, so don't complain if their 830# behavior changes. 831# An internal target that depends on all copied headers 832# (see copy_headers.make). Other targets that need the 833# headers to be copied first can depend on this target. 834.PHONY: all_copied_headers 835all_copied_headers: ; 836 837$(ALL_C_CPP_ETC_OBJECTS): | all_copied_headers 838 839# All the droid stuff, in directories 840.PHONY: files 841files: $(modules_to_install) \ 842 $(INSTALLED_ANDROID_INFO_TXT_TARGET) 843 844# ------------------------------------------------------------------- 845 846.PHONY: checkbuild 847checkbuild: $(modules_to_check) droid_targets 848 849ifeq (true,$(ANDROID_BUILD_EVERYTHING_BY_DEFAULT)) 850droid: checkbuild 851endif 852 853.PHONY: ramdisk 854ramdisk: $(INSTALLED_RAMDISK_TARGET) 855 856.PHONY: systemtarball 857systemtarball: $(INSTALLED_SYSTEMTARBALL_TARGET) 858 859.PHONY: boottarball 860boottarball: $(INSTALLED_BOOTTARBALL_TARGET) 861 862.PHONY: userdataimage 863userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET) 864 865ifneq (,$(filter userdataimage, $(MAKECMDGOALS))) 866$(call dist-for-goals, userdataimage, $(BUILT_USERDATAIMAGE_TARGET)) 867endif 868 869.PHONY: userdatatarball 870userdatatarball: $(INSTALLED_USERDATATARBALL_TARGET) 871 872.PHONY: cacheimage 873cacheimage: $(INSTALLED_CACHEIMAGE_TARGET) 874 875.PHONY: bptimage 876bptimage: $(INSTALLED_BPTIMAGE_TARGET) 877 878.PHONY: vendorimage 879vendorimage: $(INSTALLED_VENDORIMAGE_TARGET) 880 881.PHONY: systemotherimage 882systemotherimage: $(INSTALLED_SYSTEMOTHERIMAGE_TARGET) 883 884.PHONY: bootimage 885bootimage: $(INSTALLED_BOOTIMAGE_TARGET) 886 887.PHONY: vbmetaimage 888vbmetaimage: $(INSTALLED_VBMETAIMAGE_TARGET) 889 890.PHONY: auxiliary 891auxiliary: $(INSTALLED_AUX_TARGETS) 892 893# Build files and then package it into the rom formats 894.PHONY: droidcore 895droidcore: files \ 896 systemimage \ 897 $(INSTALLED_BOOTIMAGE_TARGET) \ 898 $(INSTALLED_RECOVERYIMAGE_TARGET) \ 899 $(INSTALLED_VBMETAIMAGE_TARGET) \ 900 $(INSTALLED_USERDATAIMAGE_TARGET) \ 901 $(INSTALLED_CACHEIMAGE_TARGET) \ 902 $(INSTALLED_BPTIMAGE_TARGET) \ 903 $(INSTALLED_VENDORIMAGE_TARGET) \ 904 $(INSTALLED_SYSTEMOTHERIMAGE_TARGET) \ 905 $(INSTALLED_FILES_FILE) \ 906 $(INSTALLED_FILES_FILE_VENDOR) \ 907 $(INSTALLED_FILES_FILE_SYSTEMOTHER) 908 909# dist_files only for putting your library into the dist directory with a full build. 910.PHONY: dist_files 911 912ifneq ($(TARGET_BUILD_APPS),) 913 # If this build is just for apps, only build apps and not the full system by default. 914 915 unbundled_build_modules := 916 ifneq ($(filter all,$(TARGET_BUILD_APPS)),) 917 # If they used the magic goal "all" then build all apps in the source tree. 918 unbundled_build_modules := $(foreach m,$(sort $(ALL_MODULES)),$(if $(filter APPS,$(ALL_MODULES.$(m).CLASS)),$(m))) 919 else 920 unbundled_build_modules := $(TARGET_BUILD_APPS) 921 endif 922 923 # Dist the installed files if they exist. 924 apps_only_installed_files := $(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) 925 $(call dist-for-goals,apps_only, $(apps_only_installed_files)) 926 # For uninstallable modules such as static Java library, we have to dist the built file, 927 # as <module_name>.<suffix> 928 apps_only_dist_built_files := $(foreach m,$(unbundled_build_modules),$(if $(ALL_MODULES.$(m).INSTALLED),,\ 929 $(if $(ALL_MODULES.$(m).BUILT),$(ALL_MODULES.$(m).BUILT):$(m)$(suffix $(ALL_MODULES.$(m).BUILT)))\ 930 $(if $(ALL_MODULES.$(m).AAR),$(ALL_MODULES.$(m).AAR):$(m).aar)\ 931 )) 932 $(call dist-for-goals,apps_only, $(apps_only_dist_built_files)) 933 934 ifeq ($(EMMA_INSTRUMENT),true) 935 $(EMMA_META_ZIP) : $(apps_only_installed_files) 936 937 $(call dist-for-goals,apps_only, $(EMMA_META_ZIP)) 938 endif 939 940 $(PROGUARD_DICT_ZIP) : $(apps_only_installed_files) 941 $(call dist-for-goals,apps_only, $(PROGUARD_DICT_ZIP)) 942 943 $(SYMBOLS_ZIP) : $(apps_only_installed_files) 944 $(call dist-for-goals,apps_only, $(SYMBOLS_ZIP)) 945 946 $(COVERAGE_ZIP) : $(apps_only_installed_files) 947 $(call dist-for-goals,apps_only, $(COVERAGE_ZIP)) 948 949.PHONY: apps_only 950apps_only: $(unbundled_build_modules) 951 952droid_targets: apps_only 953 954# Combine the NOTICE files for a apps_only build 955$(eval $(call combine-notice-files, \ 956 $(target_notice_file_txt), \ 957 $(target_notice_file_html), \ 958 "Notices for files for apps:", \ 959 $(TARGET_OUT_NOTICE_FILES), \ 960 $(apps_only_installed_files))) 961 962 963else # TARGET_BUILD_APPS 964 $(call dist-for-goals, droidcore, \ 965 $(INTERNAL_UPDATE_PACKAGE_TARGET) \ 966 $(INTERNAL_OTA_PACKAGE_TARGET) \ 967 $(BUILT_OTATOOLS_PACKAGE) \ 968 $(SYMBOLS_ZIP) \ 969 $(COVERAGE_ZIP) \ 970 $(INSTALLED_FILES_FILE) \ 971 $(INSTALLED_FILES_FILE_VENDOR) \ 972 $(INSTALLED_FILES_FILE_SYSTEMOTHER) \ 973 $(INSTALLED_BUILD_PROP_TARGET) \ 974 $(BUILT_TARGET_FILES_PACKAGE) \ 975 $(INSTALLED_ANDROID_INFO_TXT_TARGET) \ 976 $(INSTALLED_RAMDISK_TARGET) \ 977 ) 978 979 # Put a copy of the radio/bootloader files in the dist dir. 980 $(foreach f,$(INSTALLED_RADIOIMAGE_TARGET), \ 981 $(call dist-for-goals, droidcore, $(f))) 982 983 ifneq ($(ANDROID_BUILD_EMBEDDED),true) 984 ifneq ($(TARGET_BUILD_PDK),true) 985 $(call dist-for-goals, droidcore, \ 986 $(APPS_ZIP) \ 987 $(INTERNAL_EMULATOR_PACKAGE_TARGET) \ 988 $(PACKAGE_STATS_FILE) \ 989 ) 990 endif 991 endif 992 993 ifeq ($(EMMA_INSTRUMENT),true) 994 $(EMMA_META_ZIP) : $(INSTALLED_SYSTEMIMAGE) 995 996 $(call dist-for-goals, dist_files, $(EMMA_META_ZIP)) 997 endif 998 999# Building a full system-- the default is to build droidcore 1000droid_targets: droidcore dist_files 1001 1002endif # TARGET_BUILD_APPS 1003 1004.PHONY: docs 1005docs: $(ALL_DOCS) 1006 1007.PHONY: sdk 1008ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET) 1009sdk: $(ALL_SDK_TARGETS) 1010$(call dist-for-goals,sdk win_sdk, \ 1011 $(ALL_SDK_TARGETS) \ 1012 $(SYMBOLS_ZIP) \ 1013 $(COVERAGE_ZIP) \ 1014 $(INSTALLED_BUILD_PROP_TARGET) \ 1015) 1016 1017# umbrella targets to assit engineers in verifying builds 1018.PHONY: java native target host java-host java-target native-host native-target \ 1019 java-host-tests java-target-tests native-host-tests native-target-tests \ 1020 java-tests native-tests host-tests target-tests tests 1021# some synonyms 1022.PHONY: host-java target-java host-native target-native \ 1023 target-java-tests target-native-tests 1024host-java : java-host 1025target-java : java-target 1026host-native : native-host 1027target-native : native-target 1028target-java-tests : java-target-tests 1029target-native-tests : native-target-tests 1030tests : host-tests target-tests 1031 1032# Phony target to run all java compilations that use javac instead of jack. 1033.PHONY: javac-check 1034 1035# To catch more build breakage, check build tests modules in eng and userdebug builds. 1036ifneq ($(ANDROID_NO_TEST_CHECK),true) 1037ifneq ($(TARGET_BUILD_PDK),true) 1038ifneq ($(filter eng userdebug,$(TARGET_BUILD_VARIANT)),) 1039droidcore : target-tests host-tests 1040endif 1041endif 1042endif 1043 1044ifneq (,$(filter samplecode, $(MAKECMDGOALS))) 1045.PHONY: samplecode 1046sample_MODULES := $(sort $(call get-tagged-modules,samples)) 1047sample_APKS_DEST_PATH := $(TARGET_COMMON_OUT_ROOT)/samples 1048sample_APKS_COLLECTION := \ 1049 $(foreach module,$(sample_MODULES),$(sample_APKS_DEST_PATH)/$(notdir $(module))) 1050$(foreach module,$(sample_MODULES),$(eval $(call \ 1051 copy-one-file,$(module),$(sample_APKS_DEST_PATH)/$(notdir $(module))))) 1052sample_ADDITIONAL_INSTALLED := \ 1053 $(filter-out $(modules_to_install) $(modules_to_check),$(sample_MODULES)) 1054samplecode: $(sample_APKS_COLLECTION) 1055 @echo "Collect sample code apks: $^" 1056 # remove apks that are not intended to be installed. 1057 rm -f $(sample_ADDITIONAL_INSTALLED) 1058endif # samplecode in $(MAKECMDGOALS) 1059 1060.PHONY: findbugs 1061findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET) 1062 1063.PHONY: clean 1064clean: 1065 @rm -rf $(OUT_DIR)/* 1066 @echo "Entire build directory removed." 1067 1068.PHONY: clobber 1069clobber: clean 1070 1071# The rules for dataclean and installclean are defined in cleanbuild.mk. 1072 1073#xxx scrape this from ALL_MODULE_NAME_TAGS 1074.PHONY: modules 1075modules: 1076 @echo "Available sub-modules:" 1077 @echo "$(call module-names-for-tag-list,$(ALL_MODULE_TAGS))" | \ 1078 tr -s ' ' '\n' | sort -u | $(COLUMN) 1079 1080.PHONY: showcommands 1081showcommands: 1082 @echo >/dev/null 1083 1084.PHONY: nothing 1085nothing: 1086 @echo Successfully read the makefiles. 1087 1088.PHONY: tidy_only 1089tidy_only: 1090 @echo Successfully make tidy_only. 1091 1092ndk: $(SOONG_OUT_DIR)/ndk.timestamp 1093.PHONY: ndk 1094 1095.PHONY: all_link_types 1096all_link_types: 1097 1098endif # KATI 1099