main.mk revision ff2c9deb7966f79572d502a7048a3e6f0f9939b8
1 2# Use bash, not whatever shell somebody has installed as /bin/sh 3# This is repeated in config.mk, since envsetup.sh runs that file 4# directly. 5SHELL := /bin/bash 6 7# this turns off the suffix rules built into make 8.SUFFIXES: 9 10# If a rule fails, delete $@. 11.DELETE_ON_ERROR: 12 13# Figure out where we are. 14#TOP := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) 15#TOP := $(patsubst %/,%,$(TOP)) 16 17# TOPDIR is the normal variable you should use, because 18# if we are executing relative to the current directory 19# it can be "", whereas TOP must be "." which causes 20# pattern matching probles when make strips off the 21# trailing "./" from paths in various places. 22#ifeq ($(TOP),.) 23#TOPDIR := 24#else 25#TOPDIR := $(TOP)/ 26#endif 27 28# check for broken versions of make 29ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") \>= 3.81)) 30$(warning ********************************************************************************) 31$(warning * You are using version $(MAKE_VERSION) of make.) 32$(warning * You must upgrade to version 3.81 or greater.) 33$(warning * see file://$(shell pwd)/docs/development-environment/machine-setup.html) 34$(warning ********************************************************************************) 35$(error stopping) 36endif 37 38TOP := . 39TOPDIR := 40 41BUILD_SYSTEM := $(TOPDIR)build/core 42 43# This is the default target. It must be the first declared target. 44DEFAULT_GOAL := droid 45$(DEFAULT_GOAL): 46 47# Set up various standard variables based on configuration 48# and host information. 49include $(BUILD_SYSTEM)/config.mk 50 51# This allows us to force a clean build - included after the config.make 52# environment setup is done, but before we generate any dependencies. This 53# file does the rm -rf inline so the deps which are all done below will 54# be generated correctly 55include $(BUILD_SYSTEM)/cleanbuild.mk 56 57ifneq ($(HOST_OS),windows) 58ifneq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc) 59# check for a case sensitive file system 60ifneq (a,$(shell mkdir -p $(OUT_DIR) ; \ 61 echo a > $(OUT_DIR)/casecheck.txt; \ 62 echo B > $(OUT_DIR)/CaseCheck.txt; \ 63 cat $(OUT_DIR)/casecheck.txt)) 64$(warning ************************************************************) 65$(warning You are building on a case-insensitive filesystem.) 66$(warning Please move your source tree to a case-sensitive filesystem.) 67$(warning ************************************************************) 68$(error Case-insensitive filesystems not supported) 69endif 70endif 71endif 72 73# Make sure that there are no spaces in the absolute path; the 74# build system can't deal with them. 75ifneq ($(words $(shell pwd)),1) 76$(warning ************************************************************) 77$(warning You are building in a directory whose absolute path contains) 78$(warning a space character:) 79$(warning $(space)) 80$(warning "$(shell pwd)") 81$(warning $(space)) 82$(warning Please move your source tree to a path that does not contain) 83$(warning any spaces.) 84$(warning ************************************************************) 85$(error Directory names containing spaces not supported) 86endif 87 88# Set up version information. 89include $(BUILD_SYSTEM)/version_defaults.mk 90 91# These are the modifier targets that don't do anything themselves, but 92# change the behavior of the build. 93# (must be defined before including definitions.make) 94INTERNAL_MODIFIER_TARGETS := showcommands 95 96# Bring in standard build system definitions. 97include $(BUILD_SYSTEM)/definitions.mk 98 99ifneq ($(filter eng user userdebug tests,$(MAKECMDGOALS)),) 100$(info ***************************************************************) 101$(info ***************************************************************) 102$(info Don't pass '$(filter eng user userdebug tests,$(MAKECMDGOALS))' on \ 103 the make command line.) 104# XXX The single quote on this line fixes gvim's syntax highlighting. 105# Without which, the rest of this file is impossible to read. 106$(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or) 107$(info choosecombo.) 108$(info ***************************************************************) 109$(info ***************************************************************) 110$(error stopping) 111endif 112 113ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),) 114$(info ***************************************************************) 115$(info ***************************************************************) 116$(info Invalid variant: $(TARGET_BUILD_VARIANT) 117$(info Valid values are: $(INTERNAL_VALID_VARIANTS) 118$(info ***************************************************************) 119$(info ***************************************************************) 120$(error stopping) 121endif 122 123### 124### In this section we set up the things that are different 125### between the build variants 126### 127 128## user/userdebug ## 129 130user_variant := $(filter userdebug user,$(TARGET_BUILD_VARIANT)) 131enable_target_debugging := true 132ifneq (,$(user_variant)) 133 # Target is secure in user builds. 134 ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1 135 136 tags_to_install := user 137 ifeq ($(user_variant),userdebug) 138 # Pick up some extra useful tools 139 tags_to_install += debug 140 else 141 # Disable debugging in plain user builds. 142 enable_target_debugging := 143 endif 144 145 # TODO: Always set WITH_DEXPREOPT (for user builds) once it works on OSX. 146 # Also, remove the corresponding block in config/product_config.make. 147 ifeq ($(HOST_OS)-$(WITH_DEXPREOPT_buildbot),linux-true) 148 WITH_DEXPREOPT := true 149 endif 150 151 # Disallow mock locations by default for user builds 152 ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=0 153 154else # !user_variant 155 # Turn on checkjni for non-user builds. 156 ADDITIONAL_BUILD_PROPERTIES += ro.kernel.android.checkjni=1 157 # Set device insecure for non-user builds. 158 ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0 159 # Allow mock locations by default for non user builds 160 ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=1 161endif # !user_variant 162 163ifeq (true,$(strip $(enable_target_debugging))) 164 # Target is more debuggable and adbd is on by default 165 ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1 persist.service.adb.enable=1 166 # Include the debugging/testing OTA keys in this build. 167 INCLUDE_TEST_OTA_KEYS := true 168else # !enable_target_debugging 169 # Target is less debuggable and adbd is off by default 170 ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0 persist.service.adb.enable=0 171endif # !enable_target_debugging 172 173## eng ## 174 175ifeq ($(TARGET_BUILD_VARIANT),eng) 176tags_to_install := user debug eng 177 # Don't require the setup wizard on eng builds 178 ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\ 179 $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))) 180endif 181 182## tests ## 183 184ifeq ($(TARGET_BUILD_VARIANT),tests) 185tags_to_install := user debug eng tests 186endif 187 188## sdk ## 189 190ifneq ($(filter sdk,$(MAKECMDGOALS)),) 191ifneq ($(words $(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))),1) 192$(error The 'sdk' target may not be specified with any other targets) 193endif 194# TODO: this should be eng I think. Since the sdk is built from the eng 195# variant. 196tags_to_install := user 197ADDITIONAL_BUILD_PROPERTIES += xmpp.auto-presence=true 198ADDITIONAL_BUILD_PROPERTIES += ro.config.nocheckin=yes 199else # !sdk 200# Enable sync for non-sdk builds only (sdk builds lack SubscribedFeedsProvider). 201ADDITIONAL_BUILD_PROPERTIES += ro.config.sync=yes 202endif 203 204# Install an apns-conf.xml file if one's not already being installed. 205ifeq (,$(filter %:system/etc/apns-conf.xml, $(PRODUCT_COPY_FILES))) 206 PRODUCT_COPY_FILES += \ 207 development/data/etc/apns-conf_sdk.xml:system/etc/apns-conf.xml 208 ifeq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),) 209 $(warning implicitly installing apns-conf_sdk.xml) 210 endif 211endif 212# Install a vold.conf file is one's not already being installed. 213ifeq (,$(filter %:system/etc/vold.conf, $(PRODUCT_COPY_FILES))) 214 PRODUCT_COPY_FILES += \ 215 development/data/etc/vold.conf:system/etc/vold.conf 216 ifeq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),) 217 $(warning implicitly installing vold.conf) 218 endif 219endif 220# If we're on an eng or tests build, but not on the sdk, and we have 221# a better one, use that instead. 222ifneq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),) 223 ifeq ($(filter sdk,$(MAKECMDGOALS)),) 224 apns_to_use := $(wildcard vendor/google/etc/apns-conf.xml) 225 ifneq ($(strip $(apns_to_use)),) 226 PRODUCT_COPY_FILES := \ 227 $(filter-out %:system/etc/apns-conf.xml,$(PRODUCT_COPY_FILES)) \ 228 $(strip $(apns_to_use)):system/etc/apns-conf.xml 229 endif 230 endif 231endif 232 233ADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android 234 235# enable vm tracing in files for now to help track 236# the cause of ANRs in the content process 237ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.stack-trace-file=/data/anr/traces.txt 238 239 240# ------------------------------------------------------------ 241# Define a function that, given a list of module tags, returns 242# non-empty if that module should be installed in /system. 243 244# For most goals, anything not tagged with the "tests" tag should 245# be installed in /system. 246define should-install-to-system 247$(if $(filter tests,$(1)),,true) 248endef 249 250ifneq (,$(filter sdk,$(MAKECMDGOALS))) 251# For the sdk goal, anything with the "samples" tag should be 252# installed in /data even if that module also has "eng"/"debug"/"user". 253define should-install-to-system 254$(if $(filter samples tests,$(1)),,true) 255endef 256endif 257 258 259# If all they typed was make showcommands, we'll actually build 260# the default target. 261ifeq ($(MAKECMDGOALS),showcommands) 262.PHONY: showcommands 263showcommands: $(DEFAULT_GOAL) 264endif 265 266# These targets are going to delete stuff, don't bother including 267# the whole directory tree if that's all we're going to do 268ifeq ($(MAKECMDGOALS),clean) 269dont_bother := true 270endif 271ifeq ($(MAKECMDGOALS),clobber) 272dont_bother := true 273endif 274ifeq ($(MAKECMDGOALS),dataclean) 275dont_bother := true 276endif 277ifeq ($(MAKECMDGOALS),installclean) 278dont_bother := true 279endif 280 281# Bring in all modules that need to be built. 282ifneq ($(dont_bother),true) 283 284subdir_makefiles := 285 286ifeq ($(HOST_OS),windows) 287SDK_ONLY := true 288endif 289ifeq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc) 290SDK_ONLY := true 291endif 292 293ifeq ($(SDK_ONLY),true) 294 295subdirs := \ 296 prebuilt \ 297 build/libs/host \ 298 dalvik/dexdump \ 299 dalvik/libdex \ 300 dalvik/tools/dmtracedump \ 301 development/emulator/mksdcard \ 302 development/tools/activitycreator \ 303 development/tools/line_endings \ 304 development/host \ 305 external/expat \ 306 external/libpng \ 307 external/qemu \ 308 external/sqlite/dist \ 309 external/zlib \ 310 frameworks/base/libs/utils \ 311 frameworks/base/tools/aapt \ 312 frameworks/base/tools/aidl \ 313 system/core/adb \ 314 system/core/fastboot \ 315 system/core/libcutils \ 316 system/core/liblog \ 317 system/core/libzipfile 318 319# The following can only be built if "javac" is available. 320# This check is used when building parts of the SDK under Cygwin. 321ifneq (,$(shell which javac 2>/dev/null)) 322$(warning sdk-only: javac available.) 323subdirs += \ 324 build/tools/signapk \ 325 build/tools/zipalign \ 326 dalvik/dx \ 327 dalvik/libcore \ 328 development/apps \ 329 development/tools/androidprefs \ 330 development/tools/apkbuilder \ 331 development/tools/jarutils \ 332 development/tools/layoutlib_utils \ 333 development/tools/ninepatch \ 334 development/tools/sdkstats \ 335 development/tools/sdkmanager \ 336 frameworks/base \ 337 frameworks/base/tools/layoutlib \ 338 external/googleclient \ 339 packages 340else 341$(warning sdk-only: javac not available.) 342endif 343 344# Exclude tools/acp when cross-compiling windows under linux 345ifeq ($(findstring Linux,$(UNAME)),) 346subdirs += build/tools/acp 347endif 348 349else # !SDK_ONLY 350ifeq ($(BUILD_TINY_ANDROID), true) 351 352# TINY_ANDROID is a super-minimal build configuration, handy for board 353# bringup and very low level debugging 354 355INTERNAL_DEFAULT_DOCS_TARGETS := 356 357subdirs := \ 358 bionic \ 359 system/core \ 360 build/libs \ 361 build/target \ 362 build/tools/acp \ 363 build/tools/apriori \ 364 build/tools/kcm \ 365 build/tools/soslim \ 366 external/elfcopy \ 367 external/elfutils \ 368 external/yaffs2 \ 369 external/zlib 370else # !BUILD_TINY_ANDROID 371 372# 373# Typical build; include any Android.mk files we can find. 374# 375INTERNAL_DEFAULT_DOCS_TARGETS := offline-sdk-docs 376subdirs := $(TOP) 377 378FULL_BUILD := true 379 380endif # !BUILD_TINY_ANDROID 381 382endif # !SDK_ONLY 383 384# Can't use first-makefiles-under here because 385# --mindepth=2 makes the prunes not work. 386subdir_makefiles += \ 387 $(shell build/tools/findleaves.sh --prune="./out" $(subdirs) Android.mk) 388 389# Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE) 390# or under vendor/*/$(TARGET_DEVICE). Search in both places, but 391# make sure only one exists. 392# Real boards should always be associated with an OEM vendor. 393board_config_mk := \ 394 $(strip $(wildcard \ 395 $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \ 396 vendor/*/$(TARGET_DEVICE)/BoardConfig.mk \ 397 )) 398ifeq ($(board_config_mk),) 399 $(error No config file found for TARGET_DEVICE $(TARGET_DEVICE)) 400endif 401ifneq ($(words $(board_config_mk)),1) 402 $(error Multiple board config files for TARGET_DEVICE $(TARGET_DEVICE): $(board_config_mk)) 403endif 404include $(board_config_mk) 405TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk))) 406board_config_mk := 407 408# Clean up/verify variables defined by the board config file. 409TARGET_BOOTLOADER_BOARD_NAME := $(strip $(TARGET_BOOTLOADER_BOARD_NAME)) 410 411# 412# Include all of the makefiles in the system 413# 414 415ifneq ($(ONE_SHOT_MAKEFILE),) 416# We've probably been invoked by the "mm" shell function 417# with a subdirectory's makefile. 418include $(ONE_SHOT_MAKEFILE) 419# Change CUSTOM_MODULES to include only modules that were 420# defined by this makefile; this will install all of those 421# modules as a side-effect. Do this after including ONE_SHOT_MAKEFILE 422# so that the modules will be installed in the same place they 423# would have been with a normal make. 424CUSTOM_MODULES := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS),)) 425FULL_BUILD := 426INTERNAL_DEFAULT_DOCS_TARGETS := 427# Stub out the notice targets, which probably aren't defined 428# when using ONE_SHOT_MAKEFILE. 429NOTICE-HOST-%: ; 430NOTICE-TARGET-%: ; 431else 432include $(subdir_makefiles) 433endif 434# ------------------------------------------------------------------- 435# All module makefiles have been included at this point. 436# ------------------------------------------------------------------- 437 438# ------------------------------------------------------------------- 439# Include any makefiles that must happen after the module makefiles 440# have been included. 441# TODO: have these files register themselves via a global var rather 442# than hard-coding the list here. 443ifdef FULL_BUILD 444 # Only include this during a full build, otherwise we can't be 445 # guaranteed that any policies were included. 446 -include frameworks/policies/base/PolicyConfig.mk 447endif 448 449# ------------------------------------------------------------------- 450# Fix up CUSTOM_MODULES to refer to installed files rather than 451# just bare module names. Leave unknown modules alone in case 452# they're actually full paths to a particular file. 453known_custom_modules := $(filter $(ALL_MODULES),$(CUSTOM_MODULES)) 454unknown_custom_modules := $(filter-out $(ALL_MODULES),$(CUSTOM_MODULES)) 455CUSTOM_MODULES := \ 456 $(call module-installed-files,$(known_custom_modules)) \ 457 $(unknown_custom_modules) 458 459# ------------------------------------------------------------------- 460# Define dependencies for modules that require other modules. 461# This can only happen now, after we've read in all module makefiles. 462# 463# TODO: deal with the fact that a bare module name isn't 464# unambiguous enough. Maybe declare short targets like 465# APPS:Quake or HOST:SHARED_LIBRARIES:libutils. 466# BUG: the system image won't know to depend on modules that are 467# brought in as requirements of other modules. 468define add-required-deps 469$(1): $(2) 470endef 471$(foreach m,$(ALL_MODULES), \ 472 $(eval r := $(ALL_MODULES.$(m).REQUIRED)) \ 473 $(if $(r), \ 474 $(eval r := $(call module-installed-files,$(r))) \ 475 $(eval $(call add-required-deps,$(ALL_MODULES.$(m).INSTALLED),$(r))) \ 476 ) \ 477 ) 478m := 479r := 480add-required-deps := 481 482# ------------------------------------------------------------------- 483# Figure out our module sets. 484 485# Of the modules defined by the component makefiles, 486# determine what we actually want to build. 487# If a module has the "restricted" tag on it, it 488# poisons the rest of the tags and shouldn't appear 489# on any list. 490Default_MODULES := $(sort $(ALL_DEFAULT_INSTALLED_MODULES) \ 491 $(ALL_BUILT_MODULES) \ 492 $(CUSTOM_MODULES)) 493# TODO: Remove the 3 places in the tree that use 494# ALL_DEFAULT_INSTALLED_MODULES and get rid of it from this list. 495 496ifdef FULL_BUILD 497 # The base list of modules to build for this product is specified 498 # by the appropriate product definition file, which was included 499 # by product_config.make. 500 user_PACKAGES := $(call module-installed-files, \ 501 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES)) 502 ifeq (0,1) 503 $(info user packages for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):) 504 $(foreach p,$(user_PACKAGES),$(info : $(p))) 505 $(error done) 506 endif 507else 508 # We're not doing a full build, and are probably only including 509 # a subset of the module makefiles. Don't try to build any modules 510 # requested by the product, because we probably won't have rules 511 # to build them. 512 user_PACKAGES := 513endif 514# Use tags to get the non-APPS user modules. Use the product 515# definition files to get the APPS user modules. 516user_MODULES := $(sort $(call get-tagged-modules,user,_class@APPS restricted)) 517user_MODULES := $(user_MODULES) $(user_PACKAGES) 518 519eng_MODULES := $(sort $(call get-tagged-modules,eng,restricted)) 520debug_MODULES := $(sort $(call get-tagged-modules,debug,restricted)) 521tests_MODULES := $(sort $(call get-tagged-modules,tests,restricted)) 522 523ifeq ($(strip $(tags_to_install)),) 524$(error ASSERTION FAILED: tags_to_install should not be empty) 525endif 526modules_to_install := $(sort $(Default_MODULES) \ 527 $(foreach tag,$(tags_to_install),$($(tag)_MODULES))) 528 529# Some packages may override others using LOCAL_OVERRIDES_PACKAGES. 530# Filter out (do not install) any overridden packages. 531overridden_packages := $(call get-package-overrides,$(modules_to_install)) 532ifdef overridden_packages 533# old_modules_to_install := $(modules_to_install) 534 modules_to_install := \ 535 $(filter-out $(foreach p,$(overridden_packages),$(p) %/$(p).apk), \ 536 $(modules_to_install)) 537endif 538#$(error filtered out 539# $(filter-out $(modules_to_install),$(old_modules_to_install))) 540 541# Don't include any GNU targets in the SDK. It's ok (and necessary) 542# to build the host tools, but nothing that's going to be installed 543# on the target (including static libraries). 544ifneq ($(filter sdk,$(MAKECMDGOALS)),) 545 target_gnu_MODULES := \ 546 $(filter \ 547 $(TARGET_OUT_INTERMEDIATES)/% \ 548 $(TARGET_OUT)/% \ 549 $(TARGET_OUT_DATA)/%, \ 550 $(sort $(call get-tagged-modules,gnu))) 551 $(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d))) 552 modules_to_install := \ 553 $(filter-out $(target_gnu_MODULES),$(modules_to_install)) 554endif 555 556 557# config/Makefile contains extra stuff that we don't want to pollute this 558# top-level makefile with. It expects that ALL_DEFAULT_INSTALLED_MODULES 559# contains everything that's built during the current make, but it also further 560# extends ALL_DEFAULT_INSTALLED_MODULES. 561ALL_DEFAULT_INSTALLED_MODULES := $(modules_to_install) 562include $(BUILD_SYSTEM)/Makefile 563modules_to_install := $(sort $(ALL_DEFAULT_INSTALLED_MODULES)) 564ALL_DEFAULT_INSTALLED_MODULES := 565 566endif # dont_bother 567 568# ------------------------------------------------------------------- 569# This is used to to get the ordering right, you can also use these, 570# but they're considered undocumented, so don't complain if their 571# behavior changes. 572.PHONY: prebuilt 573prebuilt: $(ALL_PREBUILT) 574 575# An internal target that depends on all copied headers 576# (see copy_headers.make). Other targets that need the 577# headers to be copied first can depend on this target. 578.PHONY: all_copied_headers 579all_copied_headers: ; 580 581$(ALL_C_CPP_ETC_OBJECTS): | all_copied_headers 582 583# All the droid stuff, in directories 584.PHONY: files 585files: prebuilt $(modules_to_install) $(INSTALLED_ANDROID_INFO_TXT_TARGET) 586 587# ------------------------------------------------------------------- 588 589.PHONY: ramdisk 590ramdisk: $(INSTALLED_RAMDISK_TARGET) 591 592.PHONY: systemtarball 593systemtarball: $(INSTALLED_SYSTEMTARBALL_TARGET) 594 595.PHONY: userdataimage 596userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET) 597 598.PHONY: userdatatarball 599userdatatarball: $(INSTALLED_USERDATATARBALL_TARGET) 600 601.PHONY: bootimage 602bootimage: $(INSTALLED_BOOTIMAGE_TARGET) 603 604ifeq ($(BUILD_TINY_ANDROID), true) 605INSTALLED_RECOVERYIMAGE_TARGET := 606endif 607 608# Build files and then package it into the rom formats 609.PHONY: droidcore 610droidcore: files \ 611 systemimage \ 612 $(INSTALLED_BOOTIMAGE_TARGET) \ 613 $(INSTALLED_RECOVERYIMAGE_TARGET) \ 614 $(INSTALLED_USERDATAIMAGE_TARGET) \ 615 $(INTERNAL_DEFAULT_DOCS_TARGETS) \ 616 $(INSTALLED_FILES_FILE) 617 618# The actual files built by the droidcore target changes depending 619# on the build variant. 620.PHONY: droid tests 621droid tests: droidcore 622 623$(call dist-for-goals, droid, \ 624 $(INTERNAL_UPDATE_PACKAGE_TARGET) \ 625 $(INTERNAL_OTA_PACKAGE_TARGET) \ 626 $(SYMBOLS_ZIP) \ 627 $(APPS_ZIP) \ 628 $(INTERNAL_EMULATOR_PACKAGE_TARGET) \ 629 $(PACKAGE_STATS_FILE) \ 630 $(INSTALLED_FILES_FILE) \ 631 $(INSTALLED_BUILD_PROP_TARGET) \ 632 $(BUILT_TARGET_FILES_PACKAGE) \ 633 ) 634 635# Tests are installed in userdata.img. If we're building the tests 636# variant, copy it for "make tests dist". Also copy a zip of the 637# contents of userdata.img, so that people can easily extract a 638# single .apk. 639ifeq ($(TARGET_BUILD_VARIANT),tests) 640$(call dist-for-goals, droid, \ 641 $(INSTALLED_USERDATAIMAGE_TARGET) \ 642 $(BUILT_TESTS_ZIP_PACKAGE) \ 643 ) 644endif 645 646.PHONY: docs 647docs: $(ALL_DOCS) 648 649.PHONY: sdk 650ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET) 651sdk: $(ALL_SDK_TARGETS) 652$(call dist-for-goals,sdk,$(ALL_SDK_TARGETS)) 653 654.PHONY: findbugs 655findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET) 656 657.PHONY: clean 658dirs_to_clean := \ 659 $(PRODUCT_OUT) \ 660 $(TARGET_COMMON_OUT_ROOT) \ 661 $(HOST_OUT) \ 662 $(HOST_COMMON_OUT_ROOT) 663clean: 664 @for dir in $(dirs_to_clean) ; do \ 665 echo "Cleaning $$dir..."; \ 666 rm -rf $$dir; \ 667 done 668 @echo "Clean."; \ 669 670.PHONY: clobber 671clobber: 672 @rm -rf $(OUT_DIR) 673 @echo "Entire build directory removed." 674 675# The rules for dataclean and installclean are defined in cleanbuild.mk. 676 677#xxx scrape this from ALL_MODULE_NAME_TAGS 678.PHONY: modules 679modules: 680 @echo "Available sub-modules:" 681 @echo "$(call module-names-for-tag-list,$(ALL_MODULE_TAGS))" | \ 682 sed -e 's/ */\n/g' | sort -u | $(COLUMN) 683 684.PHONY: showcommands 685showcommands: 686 @echo >/dev/null 687 688