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