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