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