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