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