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