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