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