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