main.mk revision d54520a667e3bd5c9f2abe98573a5de83bcf4872
16714dbc236bf5dccba6778aa83223ee8555a6157Ying Wang# Only use ANDROID_BUILD_SHELL to wrap around bash. 26714dbc236bf5dccba6778aa83223ee8555a6157Ying Wang# DO NOT use other shells such as zsh. 32ce495a0a7986fcd458954f1cae8cd1b030091d0Ying Wangifdef ANDROID_BUILD_SHELL 42ce495a0a7986fcd458954f1cae8cd1b030091d0Ying WangSHELL := $(ANDROID_BUILD_SHELL) 52ce495a0a7986fcd458954f1cae8cd1b030091d0Ying Wangelse 688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Use bash, not whatever shell somebody has installed as /bin/sh 788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# This is repeated in config.mk, since envsetup.sh runs that file 888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# directly. 988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectSHELL := /bin/bash 102ce495a0a7986fcd458954f1cae8cd1b030091d0Ying Wangendif 1188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 1288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# this turns off the suffix rules built into make 1388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.SUFFIXES: 1488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 1552d697d432e0684fb13884c94f7768c5ec8ef8ecDavid 'Digit' Turner# this turns off the RCS / SCCS implicit rules of GNU Make 1652d697d432e0684fb13884c94f7768c5ec8ef8ecDavid 'Digit' Turner% : RCS/%,v 1752d697d432e0684fb13884c94f7768c5ec8ef8ecDavid 'Digit' Turner% : RCS/% 1852d697d432e0684fb13884c94f7768c5ec8ef8ecDavid 'Digit' Turner% : %,v 1952d697d432e0684fb13884c94f7768c5ec8ef8ecDavid 'Digit' Turner% : s.% 2052d697d432e0684fb13884c94f7768c5ec8ef8ecDavid 'Digit' Turner% : SCCS/s.% 2152d697d432e0684fb13884c94f7768c5ec8ef8ecDavid 'Digit' Turner 2288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# If a rule fails, delete $@. 2388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.DELETE_ON_ERROR: 2488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 2588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Figure out where we are. 2688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project#TOP := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) 2788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project#TOP := $(patsubst %/,%,$(TOP)) 2888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 2988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# TOPDIR is the normal variable you should use, because 3088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# if we are executing relative to the current directory 3188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# it can be "", whereas TOP must be "." which causes 3288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# pattern matching probles when make strips off the 3388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# trailing "./" from paths in various places. 3488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project#ifeq ($(TOP),.) 3588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project#TOPDIR := 3688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project#else 3788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project#TOPDIR := $(TOP)/ 3888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project#endif 3988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 4076bf62d75e7d4680dac1522534c56f4b511e5cd1Raphael# Check for broken versions of make. 4176bf62d75e7d4680dac1522534c56f4b511e5cd1Raphael# (Allow any version under Cygwin since we don't actually build the platform there.) 4276bf62d75e7d4680dac1522534c56f4b511e5cd1Raphaelifeq (,$(findstring CYGWIN,$(shell uname -sm))) 432b537262fe884c11d7d27d208896a0849e72bd73synergydevifneq (1,$(strip $(shell expr $(MAKE_VERSION) \>= 3.81))) 4488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning ********************************************************************************) 4588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning * You are using version $(MAKE_VERSION) of make.) 462b537262fe884c11d7d27d208896a0849e72bd73synergydev$(warning * Android can only be built by versions 3.81 and higher.) 475d4bcb490e4261ab56d188cc5ac490af9cc4c826Jean-Baptiste Queru$(warning * see https://source.android.com/source/download.html) 4888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning ********************************************************************************) 4988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(error stopping) 5088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 5176bf62d75e7d4680dac1522534c56f4b511e5cd1Raphaelendif 5288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 539ccacd7a6f27dbb38c8365b85fb07197d1fdbb29Ying Wang# Absolute path of the present working direcotry. 549ccacd7a6f27dbb38c8365b85fb07197d1fdbb29Ying Wang# This overrides the shell variable $PWD, which does not necessarily points to 559ccacd7a6f27dbb38c8365b85fb07197d1fdbb29Ying Wang# the top of the source tree, for example when "make -C" is used in m/mm/mmm. 569ccacd7a6f27dbb38c8365b85fb07197d1fdbb29Ying WangPWD := $(shell pwd) 579ccacd7a6f27dbb38c8365b85fb07197d1fdbb29Ying Wang 5888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectTOP := . 5988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectTOPDIR := 6088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 6188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectBUILD_SYSTEM := $(TOPDIR)build/core 6288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 6388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# This is the default target. It must be the first declared target. 64da12daf15f2e6aef7e94f340d23bc435ddc025f4Joe Onorato.PHONY: droid 6588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectDEFAULT_GOAL := droid 6688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(DEFAULT_GOAL): 6788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 6877dc0a58e27fe7c3fcdb67bbee71010c59dd4344Joe Onorato# Used to force goals to build. Only use for conditionally defined goals. 6977dc0a58e27fe7c3fcdb67bbee71010c59dd4344Joe Onorato.PHONY: FORCE 7077dc0a58e27fe7c3fcdb67bbee71010c59dd4344Joe OnoratoFORCE: 7177dc0a58e27fe7c3fcdb67bbee71010c59dd4344Joe Onorato 72ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang# These goals don't need to collect and include Android.mks/CleanSpec.mks 73ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang# in the source tree. 74ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wangdont_bother_goals := clean clobber dataclean installclean \ 75ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang help out \ 76ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang snod systemimage-nodeps \ 77ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang stnod systemtarball-nodeps \ 78ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang userdataimage-nodeps userdatatarball-nodeps \ 79ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang cacheimage-nodeps \ 80ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang vendorimage-nodeps \ 81ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang ramdisk-nodeps \ 82ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang bootimage-nodeps 83ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang 84ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wangifneq ($(filter $(dont_bother_goals), $(MAKECMDGOALS)),) 85ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wangdont_bother := true 86ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wangendif 87ad7fd29b312bf588b2be3f799715f34ff8a6d46bYing Wang 889566122c9d6b0c4844563f3af9185adf082c6155Daniel Sandler# Targets that provide quick help on the build system. 899566122c9d6b0c4844563f3af9185adf082c6155Daniel Sandlerinclude $(BUILD_SYSTEM)/help.mk 909566122c9d6b0c4844563f3af9185adf082c6155Daniel Sandler 9188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Set up various standard variables based on configuration 9288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# and host information. 9388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectinclude $(BUILD_SYSTEM)/config.mk 9488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 9550e52fa11e802b4b4a8bf83072323ee48a75436dYing Wang# This allows us to force a clean build - included after the config.mk 9688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# environment setup is done, but before we generate any dependencies. This 9788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# file does the rm -rf inline so the deps which are all done below will 9888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# be generated correctly 9988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectinclude $(BUILD_SYSTEM)/cleanbuild.mk 10088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 10163d94fa3056066ba7be6754356975af6a1c82981Ying Wang# Include the google-specific config 10263d94fa3056066ba7be6754356975af6a1c82981Ying Wang-include vendor/google/build/config.mk 10363d94fa3056066ba7be6754356975af6a1c82981Ying Wang 104422fadcf79dee6846c341b856180314c04cce3edNarayan KamathVERSION_CHECK_SEQUENCE_NUMBER := 5 1051de66889ec97300eb92166e849c4f9251e0290c6Joe Onorato-include $(OUT_DIR)/versions_checked.mk 1061de66889ec97300eb92166e849c4f9251e0290c6Joe Onoratoifneq ($(VERSION_CHECK_SEQUENCE_NUMBER),$(VERSIONS_CHECKED)) 1071de66889ec97300eb92166e849c4f9251e0290c6Joe Onorato 1081de66889ec97300eb92166e849c4f9251e0290c6Joe Onorato$(info Checking build tools versions...) 1091de66889ec97300eb92166e849c4f9251e0290c6Joe Onorato 11088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectifneq ($(HOST_OS),windows) 11188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# check for a case sensitive file system 11288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectifneq (a,$(shell mkdir -p $(OUT_DIR) ; \ 11388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project echo a > $(OUT_DIR)/casecheck.txt; \ 11488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project echo B > $(OUT_DIR)/CaseCheck.txt; \ 11588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project cat $(OUT_DIR)/casecheck.txt)) 11688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning ************************************************************) 11788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning You are building on a case-insensitive filesystem.) 11888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning Please move your source tree to a case-sensitive filesystem.) 11988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning ************************************************************) 12088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(error Case-insensitive filesystems not supported) 12188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 12288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 12388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 12488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Make sure that there are no spaces in the absolute path; the 12588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# build system can't deal with them. 12688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectifneq ($(words $(shell pwd)),1) 12788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning ************************************************************) 12888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning You are building in a directory whose absolute path contains) 12988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning a space character:) 13088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning $(space)) 13188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning "$(shell pwd)") 13288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning $(space)) 13388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning Please move your source tree to a path that does not contain) 13488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning any spaces.) 13588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(warning ************************************************************) 13688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(error Directory names containing spaces not supported) 13788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 13888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 139422fadcf79dee6846c341b856180314c04cce3edNarayan Kamathjava_version_str := $(shell unset _JAVA_OPTIONS && java -version 2>&1) 140422fadcf79dee6846c341b856180314c04cce3edNarayan Kamathjavac_version_str := $(shell unset _JAVA_OPTIONS && javac -version 2>&1) 141422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath 142960f22c11dc282ef872080f8c1ad50bdff4a99adNeil Fuller# Check for the correct version of java, should be 1.7 by 143960f22c11dc282ef872080f8c1ad50bdff4a99adNeil Fuller# default, and 1.8 if EXPERIMENTAL_USE_JAVA8 is set 144960f22c11dc282ef872080f8c1ad50bdff4a99adNeil Fullerifneq ($(EXPERIMENTAL_USE_JAVA8),) 145960f22c11dc282ef872080f8c1ad50bdff4a99adNeil Fullerrequired_version := "1.8.x" 146960f22c11dc282ef872080f8c1ad50bdff4a99adNeil Fullerrequired_javac_version := "1.8" 147960f22c11dc282ef872080f8c1ad50bdff4a99adNeil Fullerjava_version := $(shell echo '$(java_version_str)' | grep 'openjdk .*[ "]1\.8[\. "$$]') 148960f22c11dc282ef872080f8c1ad50bdff4a99adNeil Fullerjavac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.8[\. "$$]') 149960f22c11dc282ef872080f8c1ad50bdff4a99adNeil Fullerelse # default 150422fadcf79dee6846c341b856180314c04cce3edNarayan Kamathrequired_version := "1.7.x" 151422fadcf79dee6846c341b856180314c04cce3edNarayan Kamathrequired_javac_version := "1.7" 152422fadcf79dee6846c341b856180314c04cce3edNarayan Kamathjava_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.7[\. "$$]') 153422fadcf79dee6846c341b856180314c04cce3edNarayan Kamathjavac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.7[\. "$$]') 154960f22c11dc282ef872080f8c1ad50bdff4a99adNeil Fullerendif # if EXPERIMENTAL_USE_JAVA8 155422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath 156422fadcf79dee6846c341b856180314c04cce3edNarayan Kamathifeq ($(strip $(java_version)),) 157422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath$(info ************************************************************) 158422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath$(info You are attempting to build with the incorrect version) 159422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath$(info of java.) 160422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath$(info $(space)) 161422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath$(info Your version is: $(java_version_str).) 162422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath$(info The required version is: $(required_version)) 163422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath$(info $(space)) 164422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath$(info Please follow the machine setup instructions at) 165422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath$(info $(space)$(space)$(space)$(space)https://source.android.com/source/initializing.html) 166422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath$(info ************************************************************) 167422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath$(error stop) 168422fadcf79dee6846c341b856180314c04cce3edNarayan Kamathendif 169422fadcf79dee6846c341b856180314c04cce3edNarayan Kamath 170e2d27887bef08b9c3297e765d32397c1a8f7df87Narayan Kamath# Check for the current JDK. 171e2d27887bef08b9c3297e765d32397c1a8f7df87Narayan Kamath# 172e2d27887bef08b9c3297e765d32397c1a8f7df87Narayan Kamath# For Java 1.7, we require OpenJDK on linux and Oracle JDK on Mac OS. 173e2d27887bef08b9c3297e765d32397c1a8f7df87Narayan Kamathrequires_openjdk := false 174e2d27887bef08b9c3297e765d32397c1a8f7df87Narayan Kamathifeq ($(HOST_OS), linux) 175e2d27887bef08b9c3297e765d32397c1a8f7df87Narayan Kamathrequires_openjdk := true 176e2d27887bef08b9c3297e765d32397c1a8f7df87Narayan Kamathendif 177e2d27887bef08b9c3297e765d32397c1a8f7df87Narayan Kamath 1787b66d366bf5c469130f71d0870424fcd265e0301Ying Wang 179d1dbe7f5a23bacdff086b4992e1d31a96da706c3Ying Wang# Check for the current jdk 180e2d27887bef08b9c3297e765d32397c1a8f7df87Narayan Kamathifeq ($(requires_openjdk), true) 181d1dbe7f5a23bacdff086b4992e1d31a96da706c3Ying Wang# The user asked for java7 openjdk, so check that the host 182d1dbe7f5a23bacdff086b4992e1d31a96da706c3Ying Wang# java version is really openjdk 1837b66d366bf5c469130f71d0870424fcd265e0301Ying Wangifeq ($(shell echo '$(java_version_str)' | grep -i openjdk),) 184d1dbe7f5a23bacdff086b4992e1d31a96da706c3Ying Wang$(info ************************************************************) 185d1dbe7f5a23bacdff086b4992e1d31a96da706c3Ying Wang$(info You asked for an OpenJDK 7 build but your version is) 1867b66d366bf5c469130f71d0870424fcd265e0301Ying Wang$(info $(java_version_str).) 187d1dbe7f5a23bacdff086b4992e1d31a96da706c3Ying Wang$(info ************************************************************) 188d1dbe7f5a23bacdff086b4992e1d31a96da706c3Ying Wang$(error stop) 189d1dbe7f5a23bacdff086b4992e1d31a96da706c3Ying Wangendif # java version is not OpenJdk 190e2d27887bef08b9c3297e765d32397c1a8f7df87Narayan Kamathelse # if requires_openjdk 1917b66d366bf5c469130f71d0870424fcd265e0301Ying Wangifneq ($(shell echo '$(java_version_str)' | grep -i openjdk),) 192304f5194fdfd999a5e8bceef1ff260958b041d52Tim Roes$(info ************************************************************) 193304f5194fdfd999a5e8bceef1ff260958b041d52Tim Roes$(info You are attempting to build with an unsupported JDK.) 194304f5194fdfd999a5e8bceef1ff260958b041d52Tim Roes$(info $(space)) 195304f5194fdfd999a5e8bceef1ff260958b041d52Tim Roes$(info You use OpenJDK but only Sun/Oracle JDK is supported.) 196304f5194fdfd999a5e8bceef1ff260958b041d52Tim Roes$(info Please follow the machine setup instructions at) 197304f5194fdfd999a5e8bceef1ff260958b041d52Tim Roes$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html) 198304f5194fdfd999a5e8bceef1ff260958b041d52Tim Roes$(info ************************************************************) 199304f5194fdfd999a5e8bceef1ff260958b041d52Tim Roes$(error stop) 200d1dbe7f5a23bacdff086b4992e1d31a96da706c3Ying Wangendif # java version is not Sun Oracle JDK 201e2d27887bef08b9c3297e765d32397c1a8f7df87Narayan Kamathendif # if requires_openjdk 202d1dbe7f5a23bacdff086b4992e1d31a96da706c3Ying Wang 2039d9f367895655411c42123177ae1c32f104b3c01Joe Onorato# Check for the correct version of javac 2049d9f367895655411c42123177ae1c32f104b3c01Joe Onoratoifeq ($(strip $(javac_version)),) 2059d9f367895655411c42123177ae1c32f104b3c01Joe Onorato$(info ************************************************************) 2069d9f367895655411c42123177ae1c32f104b3c01Joe Onorato$(info You are attempting to build with the incorrect version) 2079d9f367895655411c42123177ae1c32f104b3c01Joe Onorato$(info of javac.) 2089d9f367895655411c42123177ae1c32f104b3c01Joe Onorato$(info $(space)) 2097b66d366bf5c469130f71d0870424fcd265e0301Ying Wang$(info Your version is: $(javac_version_str).) 210d1dbe7f5a23bacdff086b4992e1d31a96da706c3Ying Wang$(info The required version is: $(required_javac_version)) 2119d9f367895655411c42123177ae1c32f104b3c01Joe Onorato$(info $(space)) 2129d9f367895655411c42123177ae1c32f104b3c01Joe Onorato$(info Please follow the machine setup instructions at) 2135d4bcb490e4261ab56d188cc5ac490af9cc4c826Jean-Baptiste Queru$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html) 2149d9f367895655411c42123177ae1c32f104b3c01Joe Onorato$(info ************************************************************) 2154a1c70e53be40fd1b2c14eb7c0acc93f6df865bcJeff Hamilton$(error stop) 2169d9f367895655411c42123177ae1c32f104b3c01Joe Onoratoendif 2179d9f367895655411c42123177ae1c32f104b3c01Joe Onorato 2187b66d366bf5c469130f71d0870424fcd265e0301Ying Wang 219b036e955fcd9e5fd15ec37b208e112147641dd7aYing Wangifndef BUILD_EMULATOR 220f6e2694dd24d54a93d3c9adb633e0776cedb1049David 'Digit' Turner # Emulator binaries are now provided under prebuilts/android-emulator/ 22174e883d1415f68dc52a7e679cd1ea1f486b8d8bbJoe Onorato BUILD_EMULATOR := false 222b036e955fcd9e5fd15ec37b208e112147641dd7aYing Wangendif 223478ba5e3f00bb1321cd022d744020231f2449287Ying Wang 2241de66889ec97300eb92166e849c4f9251e0290c6Joe Onorato$(shell echo 'VERSIONS_CHECKED := $(VERSION_CHECK_SEQUENCE_NUMBER)' \ 2251de66889ec97300eb92166e849c4f9251e0290c6Joe Onorato > $(OUT_DIR)/versions_checked.mk) 226b036e955fcd9e5fd15ec37b208e112147641dd7aYing Wang$(shell echo 'BUILD_EMULATOR ?= $(BUILD_EMULATOR)' \ 227e35a445f2f7b32e39d88e0ba58b120aae6807bafJoe Onorato >> $(OUT_DIR)/versions_checked.mk) 2281de66889ec97300eb92166e849c4f9251e0290c6Joe Onoratoendif 2291de66889ec97300eb92166e849c4f9251e0290c6Joe Onorato 23088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# These are the modifier targets that don't do anything themselves, but 23188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# change the behavior of the build. 23288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# (must be defined before including definitions.make) 23331268316213d25b73288bee58cef686ba45640c9Ying WangINTERNAL_MODIFIER_TARGETS := showcommands all incrementaljavac 234015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wang 235015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wang.PHONY: incrementaljavac 236015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wangincrementaljavac: ; 237015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wang 238015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wang# WARNING: 239015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wang# ENABLE_INCREMENTALJAVAC should NOT be enabled by default, because change of 240015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wang# a Java source file won't trigger rebuild of its dependent Java files. 241015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wang# You can only enable it by adding "incrementaljavac" to your make command line. 242015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wang# You are responsible for the correctness of the incremental build. 243015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wang# This may decrease incremental build time dramatically for large Java libraries, 244015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wang# such as core.jar, framework.jar, etc. 245015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing WangENABLE_INCREMENTALJAVAC := 246015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wangifneq (,$(filter incrementaljavac, $(MAKECMDGOALS))) 247015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing WangENABLE_INCREMENTALJAVAC := true 248015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing WangMAKECMDGOALS := $(filter-out incrementaljavac, $(MAKECMDGOALS)) 249015edd2c1b4a4300ccccee4036ec2ca7e9ad798aYing Wangendif 25088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 251af4800c8a6a9266ceb7269bd2c6b0bb2f0965beaYing Wang# EMMA_INSTRUMENT_STATIC merges the static emma library to each emma-enabled module. 252af4800c8a6a9266ceb7269bd2c6b0bb2f0965beaYing Wangifeq (true,$(EMMA_INSTRUMENT_STATIC)) 253af4800c8a6a9266ceb7269bd2c6b0bb2f0965beaYing WangEMMA_INSTRUMENT := true 254af4800c8a6a9266ceb7269bd2c6b0bb2f0965beaYing Wangendif 255af4800c8a6a9266ceb7269bd2c6b0bb2f0965beaYing Wang 25688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Bring in standard build system definitions. 25788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectinclude $(BUILD_SYSTEM)/definitions.mk 25888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 259e7874c430895b9a4e631c89f1e7729da9264d167Ying Wang# Bring in dex_preopt.mk 260e7874c430895b9a4e631c89f1e7729da9264d167Ying Wanginclude $(BUILD_SYSTEM)/dex_preopt.mk 261e7874c430895b9a4e631c89f1e7729da9264d167Ying Wang 2626a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onoratoifneq ($(filter user userdebug eng,$(MAKECMDGOALS)),) 26388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(info ***************************************************************) 26488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(info ***************************************************************) 265d0244b395a583804137cd1fe2bff4f86d66b396bYing Wang$(info Do not pass '$(filter user userdebug eng,$(MAKECMDGOALS))' on \ 266d0244b395a583804137cd1fe2bff4f86d66b396bYing Wang the make command line.) 26788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or) 26888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(info choosecombo.) 26988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(info ***************************************************************) 27088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(info ***************************************************************) 27188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(error stopping) 27288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 27388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 2742f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Projectifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),) 2752f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project$(info ***************************************************************) 2762f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project$(info ***************************************************************) 2772f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project$(info Invalid variant: $(TARGET_BUILD_VARIANT) 2782f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project$(info Valid values are: $(INTERNAL_VALID_VARIANTS) 2792f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project$(info ***************************************************************) 2802f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project$(info ***************************************************************) 2812f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project$(error stopping) 2822f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Projectendif 28388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 2847fc7aad152ae595de371a5b969744ff3b971d81cKeun young Park# ----------------------------------------------------------------- 285efe02ce9e00b9aebde7e9b32e81780d8de8f0dbdKeun young Park# Variable to check java support level inside PDK build. 286efe02ce9e00b9aebde7e9b32e81780d8de8f0dbdKeun young Park# Not necessary if the components is not in PDK. 287efe02ce9e00b9aebde7e9b32e81780d8de8f0dbdKeun young Park# not defined : not supported 288efe02ce9e00b9aebde7e9b32e81780d8de8f0dbdKeun young Park# "sdk" : sdk API only 289efe02ce9e00b9aebde7e9b32e81780d8de8f0dbdKeun young Park# "platform" : platform API supproted 290efe02ce9e00b9aebde7e9b32e81780d8de8f0dbdKeun young ParkTARGET_BUILD_JAVA_SUPPORT_LEVEL := platform 291efe02ce9e00b9aebde7e9b32e81780d8de8f0dbdKeun young Park 292efe02ce9e00b9aebde7e9b32e81780d8de8f0dbdKeun young Park# ----------------------------------------------------------------- 2937fc7aad152ae595de371a5b969744ff3b971d81cKeun young Park# The pdk (Platform Development Kit) build 29482b836fda6894ebfccccfbddc2ce3ee2718d862eYing Wanginclude build/core/pdk_config.mk 29582b836fda6894ebfccccfbddc2ce3ee2718d862eYing Wang 2967fc7aad152ae595de371a5b969744ff3b971d81cKeun young Park# ----------------------------------------------------------------- 29788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project### 29888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project### In this section we set up the things that are different 29988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project### between the build variants 30088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project### 30188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 302eb19b3e0d1189cc7833f185a067c9f80b5487707Joe Onoratois_sdk_build := 303c4d4731b4dd306b74b9e2245b4983b6b3c5b866eRaphael 304c4d4731b4dd306b74b9e2245b4983b6b3c5b866eRaphaelifneq ($(filter sdk win_sdk sdk_addon,$(MAKECMDGOALS)),) 305eb19b3e0d1189cc7833f185a067c9f80b5487707Joe Onoratois_sdk_build := true 306eb19b3e0d1189cc7833f185a067c9f80b5487707Joe Onoratoendif 307eb19b3e0d1189cc7833f185a067c9f80b5487707Joe Onorato 308a18a28305d5bf2176f8aff197cf18cde81539379Ian Rogers# Add build properties for ART. These define system properties used by installd 309a18a28305d5bf2176f8aff197cf18cde81539379Ian Rogers# to pass flags to dex2oat. 310d54520a667e3bd5c9f2abe98573a5de83bcf4872Ying WangADDITIONAL_BUILD_PROPERTIES += persist.sys.dalvik.vm.lib.2=libart 311a18a28305d5bf2176f8aff197cf18cde81539379Ian RogersADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).variant=$(DEX2OAT_TARGET_CPU_VARIANT) 312a18a28305d5bf2176f8aff197cf18cde81539379Ian Rogersifneq ($(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),) 313a18a28305d5bf2176f8aff197cf18cde81539379Ian Rogers ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).features=$(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) 314a18a28305d5bf2176f8aff197cf18cde81539379Ian Rogersendif 315a18a28305d5bf2176f8aff197cf18cde81539379Ian Rogers 31628be9d8884861f70fbd39b3768a6d4b34009deedCalin Juravleifdef TARGET_2ND_ARCH 317a18a28305d5bf2176f8aff197cf18cde81539379Ian Rogers ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_2ND_ARCH).variant=$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT) 318a18a28305d5bf2176f8aff197cf18cde81539379Ian Rogers ifneq ($($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),) 319a18a28305d5bf2176f8aff197cf18cde81539379Ian Rogers ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_2ND_ARCH).features=$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) 320a18a28305d5bf2176f8aff197cf18cde81539379Ian Rogers endif 32128be9d8884861f70fbd39b3768a6d4b34009deedCalin Juravleendif 32228be9d8884861f70fbd39b3768a6d4b34009deedCalin Juravle 32388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project## user/userdebug ## 32488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 3256a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onoratouser_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT)) 32688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectenable_target_debugging := true 3276a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onoratotags_to_install := 32888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectifneq (,$(user_variant)) 32988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # Target is secure in user builds. 33088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1 33188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 33288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project ifeq ($(user_variant),userdebug) 33388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # Pick up some extra useful tools 3342f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project tags_to_install += debug 33588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project else 33688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # Disable debugging in plain user builds. 33788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project enable_target_debugging := 33888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project endif 339f13bdd94dc4d4f261d7a4850d7f4cd34b88e2cabDan Bornstein 340d54520a667e3bd5c9f2abe98573a5de83bcf4872Ying Wang # Turn on Dalvik preoptimization for user builds, but only if not 341f7ad63ae65f75e5aa0d0a8234feddacdace95df0Dan Bornstein # explicitly disabled and the build is running on Linux (since host 342f7ad63ae65f75e5aa0d0a8234feddacdace95df0Dan Bornstein # Dalvik isn't built for non-Linux hosts). 343c6848b398d776ca2303d5a6c225c6339a89e67f7Ying Wang ifeq (,$(WITH_DEXPREOPT)) 344d54520a667e3bd5c9f2abe98573a5de83bcf4872Ying Wang ifeq ($(user_variant),user) 345d54520a667e3bd5c9f2abe98573a5de83bcf4872Ying Wang ifeq ($(HOST_OS),linux) 346d54520a667e3bd5c9f2abe98573a5de83bcf4872Ying Wang # TODO: turn on WITH_DEXPREOPT for libart user builds. 347d54520a667e3bd5c9f2abe98573a5de83bcf4872Ying Wang # WITH_DEXPREOPT := true 348f7ad63ae65f75e5aa0d0a8234feddacdace95df0Dan Bornstein endif 349f7ad63ae65f75e5aa0d0a8234feddacdace95df0Dan Bornstein endif 3500235237805991b48831dc8add072a50c478b2fcbYing Wang endif 351f13bdd94dc4d4f261d7a4850d7f4cd34b88e2cabDan Bornstein 35288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # Disallow mock locations by default for user builds 35388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=0 354f13bdd94dc4d4f261d7a4850d7f4cd34b88e2cabDan Bornstein 35588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectelse # !user_variant 35688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # Turn on checkjni for non-user builds. 35788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project ADDITIONAL_BUILD_PROPERTIES += ro.kernel.android.checkjni=1 35888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # Set device insecure for non-user builds. 35988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0 36088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # Allow mock locations by default for non user builds 36188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=1 36288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif # !user_variant 36388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 36488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectifeq (true,$(strip $(enable_target_debugging))) 36588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # Target is more debuggable and adbd is on by default 36640b5a67ecd70eee8583b6b12775d18255868d89fMike Lockwood ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1 36785d56eba9911ec7550a53ef247455c79a58102a7Brian Carlstrom # Enable Dalvik lock contention logging. 36885d56eba9911ec7550a53ef247455c79a58102a7Brian Carlstrom ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500 36988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # Include the debugging/testing OTA keys in this build. 37088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project INCLUDE_TEST_OTA_KEYS := true 37188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectelse # !enable_target_debugging 37288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # Target is less debuggable and adbd is off by default 37340b5a67ecd70eee8583b6b12775d18255868d89fMike Lockwood ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0 37488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif # !enable_target_debugging 37588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 3762f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project## eng ## 3772f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project 3782f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Projectifeq ($(TARGET_BUILD_VARIANT),eng) 3796a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onoratotags_to_install := debug eng 380b056d71f79b717fb36d375e48c19509900f977d3Bruce Beareifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))),) 381fdd3a1020cc63c9f2440f3cff814318d11d6c773The Android Open Source Project # Don't require the setup wizard on eng builds 382fdd3a1020cc63c9f2440f3cff814318d11d6c773The Android Open Source Project ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\ 3830889661cd890e49a4827da0dc5d583274347d178Joe Onorato $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))) \ 3840889661cd890e49a4827da0dc5d583274347d178Joe Onorato ro.setupwizard.mode=OPTIONAL 3852f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Projectendif 3862abc44c2fe30760aac0051a3a2f43ad0baeae05eAndreas Gampeifndef is_sdk_build 3872abc44c2fe30760aac0051a3a2f43ad0baeae05eAndreas Gampe # Don't even verify the image on eng builds to speed startup 3882abc44c2fe30760aac0051a3a2f43ad0baeae05eAndreas Gampe ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.image-dex2oat-filter=verify-none 3892abc44c2fe30760aac0051a3a2f43ad0baeae05eAndreas Gampe # Don't compile apps on eng builds to speed startup 3902abc44c2fe30760aac0051a3a2f43ad0baeae05eAndreas Gampe ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.dex2oat-filter=interpret-only 3912abc44c2fe30760aac0051a3a2f43ad0baeae05eAndreas Gampeendif 392b056d71f79b717fb36d375e48c19509900f977d3Bruce Beareendif 3932f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project 39488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project## sdk ## 39588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 396eb19b3e0d1189cc7833f185a067c9f80b5487707Joe Onoratoifdef is_sdk_build 397c4d4731b4dd306b74b9e2245b4983b6b3c5b866eRaphael 398c4d4731b4dd306b74b9e2245b4983b6b3c5b866eRaphael# Detect if we want to build a repository for the SDK 399c4d4731b4dd306b74b9e2245b4983b6b3c5b866eRaphaelsdk_repo_goal := $(strip $(filter sdk_repo,$(MAKECMDGOALS))) 400c4d4731b4dd306b74b9e2245b4983b6b3c5b866eRaphaelMAKECMDGOALS := $(strip $(filter-out sdk_repo,$(MAKECMDGOALS))) 401c4d4731b4dd306b74b9e2245b4983b6b3c5b866eRaphael 40251f0d3f58a5c04ee328778bc97e42dc10cfa41adYing Wangifneq ($(words $(filter-out $(INTERNAL_MODIFIER_TARGETS) checkbuild emulator_tests target-files-package,$(MAKECMDGOALS))),1) 40388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(error The 'sdk' target may not be specified with any other targets) 40488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 4053d224a0fc9ed34ac4c3c79c479d5c6dc5c31b87cRaphael 4062f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project# TODO: this should be eng I think. Since the sdk is built from the eng 4072f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project# variant. 4086a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onoratotags_to_install := debug eng 40988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectADDITIONAL_BUILD_PROPERTIES += xmpp.auto-presence=true 41088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectADDITIONAL_BUILD_PROPERTIES += ro.config.nocheckin=yes 41188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectelse # !sdk 41288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 41388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 414200f25984ccc8a9e5fc13bfbcde22c17bc80d410Andreas HuberBUILD_WITHOUT_PV := true 415200f25984ccc8a9e5fc13bfbcde22c17bc80d410Andreas Huber 41688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android 41788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 41888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# enable vm tracing in files for now to help track 41988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# the cause of ANRs in the content process 42088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectADDITIONAL_BUILD_PROPERTIES += dalvik.vm.stack-trace-file=/data/anr/traces.txt 42188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 42288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# ------------------------------------------------------------ 42388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Define a function that, given a list of module tags, returns 42488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# non-empty if that module should be installed in /system. 42588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 4262f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project# For most goals, anything not tagged with the "tests" tag should 42788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# be installed in /system. 42888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectdefine should-install-to-system 4292f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project$(if $(filter tests,$(1)),,true) 43088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendef 43188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 432eb19b3e0d1189cc7833f185a067c9f80b5487707Joe Onoratoifdef is_sdk_build 43388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# For the sdk goal, anything with the "samples" tag should be 43488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# installed in /data even if that module also has "eng"/"debug"/"user". 43588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectdefine should-install-to-system 4362f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project$(if $(filter samples tests,$(1)),,true) 43788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendef 43888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 43988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 44088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 44131268316213d25b73288bee58cef686ba45640c9Ying Wang# If they only used the modifier goals (showcommands, etc), we'll actually 442e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato# build the default target. 443e334d255dc8f85d610f4d0339227a0b985494811Joe Onoratoifeq ($(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS)),) 444e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato.PHONY: $(INTERNAL_MODIFIER_TARGETS) 445e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato$(INTERNAL_MODIFIER_TARGETS): $(DEFAULT_GOAL) 44688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 44788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 44888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Bring in all modules that need to be built. 4497058f499e9a74151f6ea137697cd5b2101182782Raphael Mollifeq ($(HOST_OS),windows) 45088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectSDK_ONLY := true 45188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 45288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 45388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectifeq ($(SDK_ONLY),true) 4548a2b7707dd1bc95a69eed3c64415d1b68f2cb669Raphael Mollinclude $(TOPDIR)sdk/build/windows_sdk_whitelist.mk 4558a2b7707dd1bc95a69eed3c64415d1b68f2cb669Raphael Mollinclude $(TOPDIR)development/build/windows_sdk_whitelist.mk 45688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 45788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Exclude tools/acp when cross-compiling windows under linux 45888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectifeq ($(findstring Linux,$(UNAME)),) 45988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectsubdirs += build/tools/acp 46088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 46188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 46288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectelse # !SDK_ONLY 46388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# 46488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Typical build; include any Android.mk files we can find. 46588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# 46688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectsubdirs := $(TOP) 46788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 46888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectFULL_BUILD := true 46988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 47088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif # !SDK_ONLY 47188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 4728dc8faaaeadf83353b8144cc0db58972f19f5c7eJoe Onorato# Before we go and include all of the module makefiles, stash away 4737522f04a4b0327cf493dfe6c501634b2b1e1367aYing Wang# the PRODUCT_* values so that later we can verify they are not modified. 4747522f04a4b0327cf493dfe6c501634b2b1e1367aYing Wangstash_product_vars:=true 4758dc8faaaeadf83353b8144cc0db58972f19f5c7eJoe Onoratoifeq ($(stash_product_vars),true) 4767522f04a4b0327cf493dfe6c501634b2b1e1367aYing Wang $(call stash-product-vars, __STASHED) 4778dc8faaaeadf83353b8144cc0db58972f19f5c7eJoe Onoratoendif 4788dc8faaaeadf83353b8144cc0db58972f19f5c7eJoe Onorato 47988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectifneq ($(ONE_SHOT_MAKEFILE),) 48088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# We've probably been invoked by the "mm" shell function 48188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# with a subdirectory's makefile. 48288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectinclude $(ONE_SHOT_MAKEFILE) 48388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Change CUSTOM_MODULES to include only modules that were 48488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# defined by this makefile; this will install all of those 48588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# modules as a side-effect. Do this after including ONE_SHOT_MAKEFILE 48688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# so that the modules will be installed in the same place they 48788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# would have been with a normal make. 4886907cfe7de2007b0320f4606d9ea62da2062d3caJean-Baptiste QueruCUSTOM_MODULES := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS))) 48988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectFULL_BUILD := 49088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Stub out the notice targets, which probably aren't defined 49188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# when using ONE_SHOT_MAKEFILE. 49288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectNOTICE-HOST-%: ; 49388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectNOTICE-TARGET-%: ; 494ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onorato 495a7deb0857c4fc0799cd1ebb82ff79dcbe2745ec0Ying Wang# A helper goal printing out install paths 496a7deb0857c4fc0799cd1ebb82ff79dcbe2745ec0Ying Wang.PHONY: GET-INSTALL-PATH 497a7deb0857c4fc0799cd1ebb82ff79dcbe2745ec0Ying WangGET-INSTALL-PATH: 498a7deb0857c4fc0799cd1ebb82ff79dcbe2745ec0Ying Wang @$(foreach m, $(ALL_MODULES), $(if $(ALL_MODULES.$(m).INSTALLED), \ 499a7deb0857c4fc0799cd1ebb82ff79dcbe2745ec0Ying Wang echo 'INSTALL-PATH: $(m) $(ALL_MODULES.$(m).INSTALLED)';)) 500a7deb0857c4fc0799cd1ebb82ff79dcbe2745ec0Ying Wang 501ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onoratoelse # ONE_SHOT_MAKEFILE 502ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onorato 50320ef354e8c3a1fc10515a469fcc615935e6fb7cbYing Wangifneq ($(dont_bother),true) 504ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onorato# 505ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onorato# Include all of the makefiles in the system 506ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onorato# 507ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onorato 508ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onorato# Can't use first-makefiles-under here because 509ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onorato# --mindepth=2 makes the prunes not work. 510ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onoratosubdir_makefiles := \ 5111390cac3cea58f1c5c738bf875b4de5ba4d68fa4JP Abgrall $(shell build/tools/findleaves.py --prune=$(OUT_DIR) --prune=.repo --prune=.git $(subdirs) Android.mk) 512ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onorato 513172f5f57460001b78e100cefa584d8e91738e48aYing Wang$(foreach mk, $(subdir_makefiles), $(info including $(mk) ...)$(eval include $(mk))) 51471004f81351511b4873cdb09d52b7624158a4840Ying Wang 51520ef354e8c3a1fc10515a469fcc615935e6fb7cbYing Wangendif # dont_bother 51620ef354e8c3a1fc10515a469fcc615935e6fb7cbYing Wang 517ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onoratoendif # ONE_SHOT_MAKEFILE 518ead9646f1f7ab91fd5738471acc706faeb99dc72Joe Onorato 51971004f81351511b4873cdb09d52b7624158a4840Ying Wang# Now with all Android.mks loaded we can do post cleaning steps. 52071004f81351511b4873cdb09d52b7624158a4840Ying Wanginclude $(BUILD_SYSTEM)/post_clean.mk 52171004f81351511b4873cdb09d52b7624158a4840Ying Wang 5228dc8faaaeadf83353b8144cc0db58972f19f5c7eJoe Onoratoifeq ($(stash_product_vars),true) 5237522f04a4b0327cf493dfe6c501634b2b1e1367aYing Wang $(call assert-product-vars, __STASHED) 5248dc8faaaeadf83353b8144cc0db58972f19f5c7eJoe Onoratoendif 5258dc8faaaeadf83353b8144cc0db58972f19f5c7eJoe Onorato 5260944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queruinclude $(BUILD_SYSTEM)/legacy_prebuilts.mk 5270944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queruifneq ($(filter-out $(GRANDFATHERED_ALL_PREBUILT),$(strip $(notdir $(ALL_PREBUILT)))),) 5280944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru $(warning *** Some files have been added to ALL_PREBUILT.) 5290944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru $(warning *) 530824d7b2f02f99f1661912203d530909fc242a741Kenny Root $(warning * ALL_PREBUILT is a deprecated mechanism that) 5310944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru $(warning * should not be used for new files.) 5320944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru $(warning * As an alternative, use PRODUCT_COPY_FILES in) 5330944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru $(warning * the appropriate product definition.) 5340944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru $(warning * build/target/product/core.mk is the product) 5350944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru $(warning * definition used in all products.) 5360944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru $(warning *) 5370944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru $(foreach bad_prebuilt,$(filter-out $(GRANDFATHERED_ALL_PREBUILT),$(strip $(notdir $(ALL_PREBUILT)))),$(warning * unexpected $(bad_prebuilt) in ALL_PREBUILT)) 5380944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru $(warning *) 5390944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru $(error ALL_PREBUILT contains unexpected files) 5400944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queruendif 5410944771fb0de7510046e252b59f4afa7d24b212fJean-Baptiste Queru 54288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# ------------------------------------------------------------------- 54388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# All module makefiles have been included at this point. 54488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# ------------------------------------------------------------------- 54588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 54688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 54788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# ------------------------------------------------------------------- 54888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Fix up CUSTOM_MODULES to refer to installed files rather than 54988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# just bare module names. Leave unknown modules alone in case 55088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# they're actually full paths to a particular file. 55188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectknown_custom_modules := $(filter $(ALL_MODULES),$(CUSTOM_MODULES)) 55288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectunknown_custom_modules := $(filter-out $(ALL_MODULES),$(CUSTOM_MODULES)) 55388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectCUSTOM_MODULES := \ 55488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(call module-installed-files,$(known_custom_modules)) \ 55588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(unknown_custom_modules) 55688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 55788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# ------------------------------------------------------------------- 55888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Define dependencies for modules that require other modules. 55988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# This can only happen now, after we've read in all module makefiles. 56088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# 56188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# TODO: deal with the fact that a bare module name isn't 56288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# unambiguous enough. Maybe declare short targets like 56388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# APPS:Quake or HOST:SHARED_LIBRARIES:libutils. 56488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# BUG: the system image won't know to depend on modules that are 56588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# brought in as requirements of other modules. 56614a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang# 56714a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang# Resolve the required module name to 32-bit or 64-bit variant. 56814a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang# Get a list of corresponding 32-bit module names, if one exists. 56914a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wangdefine get-32-bit-modules 57014a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang$(strip $(foreach m,$(1),\ 57114a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(if $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).CLASS),\ 57214a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX)))) 57314a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wangendef 57414a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang# Get a list of corresponding 32-bit module names, if one exists; 57514a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang# otherwise return the original module name 57614a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wangdefine get-32-bit-modules-if-we-can 57714a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang$(strip $(foreach m,$(1),\ 57814a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(if $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).CLASS),\ 57914a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX), 58014a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(m)))) 58114a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wangendef 58214a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang 58314a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang# If a module is built for 32-bit, the required modules must be 32-bit too; 58414a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang# Otherwise if the module is an exectuable or shared library, 58514a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang# the required modules must be 64-bit; 58614a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang# otherwise we require both 64-bit and 32-bit variant, if one exists. 58714a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang$(foreach m,$(ALL_MODULES),\ 58814a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(eval r := $(ALL_MODULES.$(m).REQUIRED))\ 58914a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(if $(r),\ 59014a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(if $(ALL_MODULES.$(m).FOR_2ND_ARCH),\ 59114a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(eval r_r := $(call get-32-bit-modules-if-we-can,$(r))),\ 59214a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(if $(filter EXECUTABLES SHARED_LIBRARIES,$(ALL_MODULES.$(m).CLASS)),\ 59314a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(eval r_r := $(r)),\ 59414a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang $(eval r_r := $(r) $(call get-32-bit-modules,$(r)))\ 59514a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang )\ 59614a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang )\ 597ff3a9045229b0613552e45de2a31a7ac8debb597Ying Wang $(eval ALL_MODULES.$(m).REQUIRED := $(strip $(r_r)))\ 59814a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang )\ 59914a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang) 60014a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wangr_r := 60114a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang 60288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectdefine add-required-deps 6039485a57bb2e55535fc337f2be803e79cd1c46b62Ying Wang$(1): | $(2) 60488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendef 60514a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang 60688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(foreach m,$(ALL_MODULES), \ 60788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(eval r := $(ALL_MODULES.$(m).REQUIRED)) \ 60888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(if $(r), \ 60988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(eval r := $(call module-installed-files,$(r))) \ 610d72db32f84dbb07b3932321fe9cc101a597b6206Ying Wang $(eval t_m := $(filter $(TARGET_OUT_ROOT)/%, $(ALL_MODULES.$(m).INSTALLED))) \ 611d72db32f84dbb07b3932321fe9cc101a597b6206Ying Wang $(eval h_m := $(filter $(HOST_OUT_ROOT)/%, $(ALL_MODULES.$(m).INSTALLED))) \ 612d72db32f84dbb07b3932321fe9cc101a597b6206Ying Wang $(eval t_r := $(filter $(TARGET_OUT_ROOT)/%, $(r))) \ 613d72db32f84dbb07b3932321fe9cc101a597b6206Ying Wang $(eval h_r := $(filter $(HOST_OUT_ROOT)/%, $(r))) \ 614fc33037547495aa21b25216d360b27a7100e2a42Ying Wang $(eval t_m := $(filter-out $(t_r), $(t_m))) \ 615fc33037547495aa21b25216d360b27a7100e2a42Ying Wang $(eval h_m := $(filter-out $(h_r), $(h_m))) \ 616d72db32f84dbb07b3932321fe9cc101a597b6206Ying Wang $(if $(t_m), $(eval $(call add-required-deps, $(t_m),$(t_r)))) \ 617d72db32f84dbb07b3932321fe9cc101a597b6206Ying Wang $(if $(h_m), $(eval $(call add-required-deps, $(h_m),$(h_r)))) \ 61888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project ) \ 61988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project ) 6209485a57bb2e55535fc337f2be803e79cd1c46b62Ying Wang 621d72db32f84dbb07b3932321fe9cc101a597b6206Ying Wangt_m := 622d72db32f84dbb07b3932321fe9cc101a597b6206Ying Wangh_m := 623d72db32f84dbb07b3932321fe9cc101a597b6206Ying Wangt_r := 624d72db32f84dbb07b3932321fe9cc101a597b6206Ying Wangh_r := 625d72db32f84dbb07b3932321fe9cc101a597b6206Ying Wang 626e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang# Establish the dependecies on the shared libraries. 627e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang# It also adds the shared library module names to ALL_MODULES.$(m).REQUIRED, 628e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang# so they can be expanded to product_MODULES later. 629e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang# $(1): TARGET_ or HOST_. 630e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang# $(2): non-empty for 2nd arch. 631e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wangdefine resolve-shared-libs-depes 632e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang$(foreach m,$($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))$(1)DEPENDENCIES_ON_SHARED_LIBRARIES),\ 633e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang $(eval p := $(subst :,$(space),$(m)))\ 634e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang $(eval mod := $(firstword $(p)))\ 635e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang $(eval deps := $(subst $(comma),$(space),$(lastword $(p))))\ 636e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang $(if $(2),$(eval deps := $(addsuffix $($(1)2ND_ARCH_MODULE_SUFFIX),$(deps))))\ 637e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang $(eval r := $(filter $($(1)OUT_ROOT)/%,$(call module-installed-files,\ 638e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang $(deps))))\ 639e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang $(eval $(call add-required-deps,$(word 2,$(p)),$(r)))\ 640e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang $(eval ALL_MODULES.$(mod).REQUIRED += $(deps))) 641e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wangendef 642e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang 643e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang$(call resolve-shared-libs-depes,TARGET_) 644791fa6a9094dced42b4b292c163708838a8d059eYing Wangifdef TARGET_2ND_ARCH 645e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang$(call resolve-shared-libs-depes,TARGET_,true) 6464d2cc665eafb16ffe20b4ec8b2b2fc3a55f6f6aeYing Wangendif 647e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang$(call resolve-shared-libs-depes,HOST_) 648966c1e0cae6a59f15264d3b542af08e21e2dc06cYing Wangifdef HOST_2ND_ARCH 649e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang$(call resolve-shared-libs-depes,HOST_,true) 650791fa6a9094dced42b4b292c163708838a8d059eYing Wangendif 6519485a57bb2e55535fc337f2be803e79cd1c46b62Ying Wang 65288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectm := 65388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectr := 6549485a57bb2e55535fc337f2be803e79cd1c46b62Ying Wangp := 655e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wangdeps := 65688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectadd-required-deps := 65788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 65888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# ------------------------------------------------------------------- 65988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Figure out our module sets. 6606a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onorato# 66188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Of the modules defined by the component makefiles, 66288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# determine what we actually want to build. 66388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 664e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang########################################################### 665e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang## Expand a module name list with REQUIRED modules 666e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang########################################################### 667e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang# $(1): The variable name that holds the initial module name list. 668e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang# the variable will be modified to hold the expanded results. 669e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang# $(2): The initial module name list. 670e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang# Returns empty string (maybe with some whitespaces). 671e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wangdefine expand-required-modules 672e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang$(eval _erm_new_modules := $(sort $(filter-out $($(1)),\ 673e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang $(foreach m,$(2),$(ALL_MODULES.$(m).REQUIRED)))))\ 674e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang$(if $(_erm_new_modules),$(eval $(1) += $(_erm_new_modules))\ 675e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang $(call expand-required-modules,$(1),$(_erm_new_modules))) 676e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wangendef 677e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang 67888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectifdef FULL_BUILD 67988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # The base list of modules to build for this product is specified 68088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # by the appropriate product definition file, which was included 68114a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang # by product_config.mk. 6828d0847e9246ab7728f9ef6e2e493f0025ac06f5bJoe Onorato product_MODULES := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES) 683489458fa3161ed0c299f737da68376862ce13f9fYing Wang # Filter out the overridden packages before doing expansion 684489458fa3161ed0c299f737da68376862ce13f9fYing Wang product_MODULES := $(filter-out $(foreach p, $(product_MODULES), \ 685489458fa3161ed0c299f737da68376862ce13f9fYing Wang $(PACKAGES.$(p).OVERRIDES)), $(product_MODULES)) 68614a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang 68714a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang # Resolve the :32 :64 module name 68814a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang modules_32 := $(patsubst %:32,%,$(filter %:32, $(product_MODULES))) 68914a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang modules_64 := $(patsubst %:64,%,$(filter %:64, $(product_MODULES))) 69014a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang modules_rest := $(filter-out %:32 %:64,$(product_MODULES)) 6917e73eb3f7cd8e6010df2c62c4d380cdc34ba3edcYing Wang # Note for 32-bit product, $(modules_32) and $(modules_64) will be 6927e73eb3f7cd8e6010df2c62c4d380cdc34ba3edcYing Wang # added as their original module names. 6937e73eb3f7cd8e6010df2c62c4d380cdc34ba3edcYing Wang product_MODULES := $(call get-32-bit-modules-if-we-can, $(modules_32)) 694ff3a9045229b0613552e45de2a31a7ac8debb597Ying Wang product_MODULES += $(modules_64) 695ff3a9045229b0613552e45de2a31a7ac8debb597Ying Wang # For the rest we add both 696ff3a9045229b0613552e45de2a31a7ac8debb597Ying Wang product_MODULES += $(call get-32-bit-modules, $(modules_rest)) 697ff3a9045229b0613552e45de2a31a7ac8debb597Ying Wang product_MODULES += $(modules_rest) 69814a6cbd9026659b30f63c31e112d6cce9b47a9d6Ying Wang 6998d0847e9246ab7728f9ef6e2e493f0025ac06f5bJoe Onorato $(call expand-required-modules,product_MODULES,$(product_MODULES)) 700e1b867dde77d59bb35f366c2e3d65fe37c696880Ying Wang 7018d0847e9246ab7728f9ef6e2e493f0025ac06f5bJoe Onorato product_FILES := $(call module-installed-files, $(product_MODULES)) 7026a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onorato ifeq (0,1) 7038d0847e9246ab7728f9ef6e2e493f0025ac06f5bJoe Onorato $(info product_FILES for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):) 7048d0847e9246ab7728f9ef6e2e493f0025ac06f5bJoe Onorato $(foreach p,$(product_FILES),$(info : $(p))) 7056a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onorato $(error done) 7066a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onorato endif 70788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectelse 70888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # We're not doing a full build, and are probably only including 70988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # a subset of the module makefiles. Don't try to build any modules 71088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # requested by the product, because we probably won't have rules 71188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project # to build them. 7128d0847e9246ab7728f9ef6e2e493f0025ac06f5bJoe Onorato product_FILES := 71388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 71488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 715d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onoratoeng_MODULES := $(sort \ 716d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato $(call get-tagged-modules,eng) \ 717d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_ENG)) \ 718d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato ) 719d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onoratodebug_MODULES := $(sort \ 720d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato $(call get-tagged-modules,debug) \ 721d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG)) \ 722d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato ) 723d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onoratotests_MODULES := $(sort \ 724d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato $(call get-tagged-modules,tests) \ 725d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS)) \ 726d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato ) 72788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 7286a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onorato# TODO: Remove the 3 places in the tree that use ALL_DEFAULT_INSTALLED_MODULES 7296a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onorato# and get rid of it from this list. 7306a185e453d423a8192f7b694cb0c707f9ec6c94bJoe Onoratomodules_to_install := $(sort \ 731e213944da4d6b699fea290ce84083dcd457c37adJoe Onorato $(ALL_DEFAULT_INSTALLED_MODULES) \ 7328d0847e9246ab7728f9ef6e2e493f0025ac06f5bJoe Onorato $(product_FILES) \ 733e213944da4d6b699fea290ce84083dcd457c37adJoe Onorato $(foreach tag,$(tags_to_install),$($(tag)_MODULES)) \ 734e213944da4d6b699fea290ce84083dcd457c37adJoe Onorato $(CUSTOM_MODULES) \ 735e213944da4d6b699fea290ce84083dcd457c37adJoe Onorato ) 73688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 73788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Some packages may override others using LOCAL_OVERRIDES_PACKAGES. 73888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Filter out (do not install) any overridden packages. 7392f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Projectoverridden_packages := $(call get-package-overrides,$(modules_to_install)) 74088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectifdef overridden_packages 7412f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project# old_modules_to_install := $(modules_to_install) 7422f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project modules_to_install := \ 74388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(filter-out $(foreach p,$(overridden_packages),$(p) %/$(p).apk), \ 7442f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project $(modules_to_install)) 74588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 7462f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project#$(error filtered out 7472f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project# $(filter-out $(modules_to_install),$(old_modules_to_install))) 74888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 74988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Don't include any GNU targets in the SDK. It's ok (and necessary) 75088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# to build the host tools, but nothing that's going to be installed 75188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# on the target (including static libraries). 752eb19b3e0d1189cc7833f185a067c9f80b5487707Joe Onoratoifdef is_sdk_build 75388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project target_gnu_MODULES := \ 75488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(filter \ 75588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(TARGET_OUT_INTERMEDIATES)/% \ 75688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(TARGET_OUT)/% \ 75788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(TARGET_OUT_DATA)/%, \ 75888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(sort $(call get-tagged-modules,gnu))) 75988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d))) 7602f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project modules_to_install := \ 7612f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Project $(filter-out $(target_gnu_MODULES),$(modules_to_install)) 762486be821985f5c6680daee90bdf3befb602a1ed0Ying Wang 763d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato # Ensure every module listed in PRODUCT_PACKAGES* gets something installed 764d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato # TODO: Should we do this for all builds and not just the sdk? 765d18e570fbaef9fdc6605ed75960641416a370a79Ying Wang dangling_modules := 766486be821985f5c6680daee90bdf3befb602a1ed0Ying Wang $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \ 767ff3a9045229b0613552e45de2a31a7ac8debb597Ying Wang $(if $(strip $(ALL_MODULES.$(m).INSTALLED) $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).INSTALLED)),,\ 768d18e570fbaef9fdc6605ed75960641416a370a79Ying Wang $(eval dangling_modules += $(m)))) 769d18e570fbaef9fdc6605ed75960641416a370a79Ying Wang ifneq ($(dangling_modules),) 77052cefc36cf4718cd85e6e35832b2a8674ba9e838Ying Wang $(warning: Modules '$(dangling_modules)' in PRODUCT_PACKAGES have nothing to install!) 771d18e570fbaef9fdc6605ed75960641416a370a79Ying Wang endif 772d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG), \ 773cea08a5220bb0b1169e227dd4a08dd94fef0720bJoe Onorato $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ 774c5fbef5413fea32b0084fd197bd27f9effcb2760Joe Onorato $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_DEBUG has nothing to install!))) 775d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_ENG), \ 776cea08a5220bb0b1169e227dd4a08dd94fef0720bJoe Onorato $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ 777c5fbef5413fea32b0084fd197bd27f9effcb2760Joe Onorato $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_ENG has nothing to install!))) 778d7d0afcaea24b0fb0cb37dca921a5ff52fd2485bJoe Onorato $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS), \ 779cea08a5220bb0b1169e227dd4a08dd94fef0720bJoe Onorato $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ 780c5fbef5413fea32b0084fd197bd27f9effcb2760Joe Onorato $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_TESTS has nothing to install!))) 78188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectendif 78288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 783e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato# build/core/Makefile contains extra stuff that we don't want to pollute this 78488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# top-level makefile with. It expects that ALL_DEFAULT_INSTALLED_MODULES 78588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# contains everything that's built during the current make, but it also further 78688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# extends ALL_DEFAULT_INSTALLED_MODULES. 7872f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source ProjectALL_DEFAULT_INSTALLED_MODULES := $(modules_to_install) 78888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectinclude $(BUILD_SYSTEM)/Makefile 7892f31293ba78695cb48ac5a1cab835197ace58d47The Android Open Source Projectmodules_to_install := $(sort $(ALL_DEFAULT_INSTALLED_MODULES)) 79088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectALL_DEFAULT_INSTALLED_MODULES := 79188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 792f93f5be23ec65d2893d3b221d3753eace24dc567Joe Onorato 793e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato# These are additional goals that we build, in order to make sure that there 794e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato# is as little code as possible in the tree that doesn't build. 795e334d255dc8f85d610f4d0339227a0b985494811Joe Onoratomodules_to_check := $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).CHECKED)) 796e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato 797e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato# If you would like to build all goals, and not skip any intermediate 798e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato# steps, you can pass the "all" modifier goal on the commandline. 799e334d255dc8f85d610f4d0339227a0b985494811Joe Onoratoifneq ($(filter all,$(MAKECMDGOALS)),) 800e334d255dc8f85d610f4d0339227a0b985494811Joe Onoratomodules_to_check += $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).BUILT)) 801e334d255dc8f85d610f4d0339227a0b985494811Joe Onoratoendif 802e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato 803e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato# for easier debugging 804e334d255dc8f85d610f4d0339227a0b985494811Joe Onoratomodules_to_check := $(sort $(modules_to_check)) 805e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato#$(error modules_to_check $(modules_to_check)) 806e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato 80788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# ------------------------------------------------------------------- 80888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# This is used to to get the ordering right, you can also use these, 80988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# but they're considered undocumented, so don't complain if their 81088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# behavior changes. 81188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: prebuilt 81288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectprebuilt: $(ALL_PREBUILT) 81388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 81488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# An internal target that depends on all copied headers 81588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# (see copy_headers.make). Other targets that need the 81688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# headers to be copied first can depend on this target. 81788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: all_copied_headers 81888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectall_copied_headers: ; 81988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 82088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project$(ALL_C_CPP_ETC_OBJECTS): | all_copied_headers 82188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 82288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# All the droid stuff, in directories 82388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: files 824e334d255dc8f85d610f4d0339227a0b985494811Joe Onoratofiles: prebuilt \ 825e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato $(modules_to_install) \ 826e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato $(INSTALLED_ANDROID_INFO_TXT_TARGET) 82788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 82888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# ------------------------------------------------------------------- 82988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 830e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato.PHONY: checkbuild 831e334d255dc8f85d610f4d0339227a0b985494811Joe Onoratocheckbuild: $(modules_to_check) 83231268316213d25b73288bee58cef686ba45640c9Ying Wangifeq (true,$(ANDROID_BUILD_EVERYTHING_BY_DEFAULT)$(filter $(MAKECMDGOALS),checkbuild)) 83331268316213d25b73288bee58cef686ba45640c9Ying Wangdroid: checkbuild 83431268316213d25b73288bee58cef686ba45640c9Ying Wangelse 83531268316213d25b73288bee58cef686ba45640c9Ying Wang# ANDROID_BUILD_EVERYTHING_BY_DEFAULT not set, or checkbuild is one of the cmd goals. 83631268316213d25b73288bee58cef686ba45640c9Ying Wangcheckbuild: droid 83731268316213d25b73288bee58cef686ba45640c9Ying Wangendif 838e334d255dc8f85d610f4d0339227a0b985494811Joe Onorato 83988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: ramdisk 84088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectramdisk: $(INSTALLED_RAMDISK_TARGET) 84188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 84289686538d77c47ed7816594c7597f5d1e456d656Ying Wang.PHONY: factory_ramdisk 84389686538d77c47ed7816594c7597f5d1e456d656Ying Wangfactory_ramdisk: $(INSTALLED_FACTORY_RAMDISK_TARGET) 84489686538d77c47ed7816594c7597f5d1e456d656Ying Wang 845e1d191ee956674147ac1b34129d1f2df322fc3aeJoe Onorato.PHONY: factory_bundle 846e1d191ee956674147ac1b34129d1f2df322fc3aeJoe Onoratofactory_bundle: $(INSTALLED_FACTORY_BUNDLE_TARGET) 847e1d191ee956674147ac1b34129d1f2df322fc3aeJoe Onorato 84888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: systemtarball 84988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectsystemtarball: $(INSTALLED_SYSTEMTARBALL_TARGET) 85088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 85152aac20307073b8149a31d01b0b295651ea4b042Bruce Beare.PHONY: boottarball 85252aac20307073b8149a31d01b0b295651ea4b042Bruce Beareboottarball: $(INSTALLED_BOOTTARBALL_TARGET) 85352aac20307073b8149a31d01b0b295651ea4b042Bruce Beare 85488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: userdataimage 85588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectuserdataimage: $(INSTALLED_USERDATAIMAGE_TARGET) 85688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 8579c0f3e355194d1c43bf70f35f953d6a2babc815aYing Wangifneq (,$(filter userdataimage, $(MAKECMDGOALS))) 8589c0f3e355194d1c43bf70f35f953d6a2babc815aYing Wang$(call dist-for-goals, userdataimage, $(BUILT_USERDATAIMAGE_TARGET)) 8599c0f3e355194d1c43bf70f35f953d6a2babc815aYing Wangendif 8609c0f3e355194d1c43bf70f35f953d6a2babc815aYing Wang 86188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: userdatatarball 86288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectuserdatatarball: $(INSTALLED_USERDATATARBALL_TARGET) 86388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 8649f8e8db188371cb3787a91a03d193f87ad244ea3Ying Wang.PHONY: cacheimage 8659f8e8db188371cb3787a91a03d193f87ad244ea3Ying Wangcacheimage: $(INSTALLED_CACHEIMAGE_TARGET) 8669f8e8db188371cb3787a91a03d193f87ad244ea3Ying Wang 867a0febe5e6de24ffee5cd32944d5a1814cf312efbYing Wang.PHONY: vendorimage 868a0febe5e6de24ffee5cd32944d5a1814cf312efbYing Wangvendorimage: $(INSTALLED_VENDORIMAGE_TARGET) 869a0febe5e6de24ffee5cd32944d5a1814cf312efbYing Wang 87088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: bootimage 87188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectbootimage: $(INSTALLED_BOOTIMAGE_TARGET) 87288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 873b607f7bd4c270c8bef16db46966992528ce25ebcYing Wang# phony target that include any targets in $(ALL_MODULES) 874b607f7bd4c270c8bef16db46966992528ce25ebcYing Wang.PHONY: all_modules 875b607f7bd4c270c8bef16db46966992528ce25ebcYing Wangifndef BUILD_MODULES_IN_PATHS 876b607f7bd4c270c8bef16db46966992528ce25ebcYing Wangall_modules: $(ALL_MODULES) 877b607f7bd4c270c8bef16db46966992528ce25ebcYing Wangelse 878b607f7bd4c270c8bef16db46966992528ce25ebcYing Wang# BUILD_MODULES_IN_PATHS is a list of paths relative to the top of the tree 879b607f7bd4c270c8bef16db46966992528ce25ebcYing Wangmodule_path_patterns := $(foreach p, $(BUILD_MODULES_IN_PATHS),\ 880b607f7bd4c270c8bef16db46966992528ce25ebcYing Wang $(if $(filter %/,$(p)),$(p)%,$(p)/%)) 881b607f7bd4c270c8bef16db46966992528ce25ebcYing Wangmy_all_modules := $(sort $(foreach m, $(ALL_MODULES),$(if $(filter\ 882b607f7bd4c270c8bef16db46966992528ce25ebcYing Wang $(module_path_patterns), $(addsuffix /,$(ALL_MODULES.$(m).PATH))),$(m)))) 883b607f7bd4c270c8bef16db46966992528ce25ebcYing Wangall_modules: $(my_all_modules) 884b607f7bd4c270c8bef16db46966992528ce25ebcYing Wangendif 885b607f7bd4c270c8bef16db46966992528ce25ebcYing Wang 886b607f7bd4c270c8bef16db46966992528ce25ebcYing Wang 88788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# Build files and then package it into the rom formats 88888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: droidcore 88988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectdroidcore: files \ 89088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project systemimage \ 89188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(INSTALLED_BOOTIMAGE_TARGET) \ 89288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(INSTALLED_RECOVERYIMAGE_TARGET) \ 89388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(INSTALLED_USERDATAIMAGE_TARGET) \ 8949f8e8db188371cb3787a91a03d193f87ad244ea3Ying Wang $(INSTALLED_CACHEIMAGE_TARGET) \ 895a0febe5e6de24ffee5cd32944d5a1814cf312efbYing Wang $(INSTALLED_VENDORIMAGE_TARGET) \ 89688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project $(INSTALLED_FILES_FILE) 89788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 898228fcef025cf827428a812a182bce0e9b7ee2b0bYing Wang# dist_files only for putting your library into the dist directory with a full build. 899228fcef025cf827428a812a182bce0e9b7ee2b0bYing Wang.PHONY: dist_files 900ad8aec94faa3c08b990110bbe12484eadc897839Ying Wang 90116fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onoratoifneq ($(TARGET_BUILD_APPS),) 902da12daf15f2e6aef7e94f340d23bc435ddc025f4Joe Onorato # If this build is just for apps, only build apps and not the full system by default. 90388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 90416fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato unbundled_build_modules := 90516fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato ifneq ($(filter all,$(TARGET_BUILD_APPS)),) 906c048c9b598b36dc7506a954cc0d3d80f308b1b13Ying Wang # If they used the magic goal "all" then build all apps in the source tree. 907c048c9b598b36dc7506a954cc0d3d80f308b1b13Ying Wang unbundled_build_modules := $(foreach m,$(sort $(ALL_MODULES)),$(if $(filter APPS,$(ALL_MODULES.$(m).CLASS)),$(m))) 90816fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato else 90916fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato unbundled_build_modules := $(TARGET_BUILD_APPS) 91016fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato endif 911ebd5a9e11f34d7980d0cb3ef07f32aa4ae8e834fYing Wang 9121e1241ce3d4259bcc4a0039ed68fc5b3fc8069b5Ying Wang # Dist the installed files if they exist. 913da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang apps_only_installed_files := $(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) 914da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang $(call dist-for-goals,apps_only, $(apps_only_installed_files)) 9151e1241ce3d4259bcc4a0039ed68fc5b3fc8069b5Ying Wang # For uninstallable modules such as static Java library, we have to dist the built file, 9161e1241ce3d4259bcc4a0039ed68fc5b3fc8069b5Ying Wang # as <module_name>.<suffix> 9171e1241ce3d4259bcc4a0039ed68fc5b3fc8069b5Ying Wang apps_only_dist_built_files := $(foreach m,$(unbundled_build_modules),$(if $(ALL_MODULES.$(m).INSTALLED),,\ 918495f68402493de82606b8c06213bae5bb1156a8bYing Wang $(if $(ALL_MODULES.$(m).BUILT),$(ALL_MODULES.$(m).BUILT):$(m)$(suffix $(ALL_MODULES.$(m).BUILT))))) 9191e1241ce3d4259bcc4a0039ed68fc5b3fc8069b5Ying Wang $(call dist-for-goals,apps_only, $(apps_only_dist_built_files)) 920da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang 921da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang ifeq ($(EMMA_INSTRUMENT),true) 922da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang $(EMMA_META_ZIP) : $(apps_only_installed_files) 923da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang 924da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang $(call dist-for-goals,apps_only, $(EMMA_META_ZIP)) 925da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang endif 92616fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato 927ae9115a525260a0ca317eadd13f075def733a66dYing Wang $(PROGUARD_DICT_ZIP) : $(apps_only_installed_files) 928ae9115a525260a0ca317eadd13f075def733a66dYing Wang $(call dist-for-goals,apps_only, $(PROGUARD_DICT_ZIP)) 929ae9115a525260a0ca317eadd13f075def733a66dYing Wang 930da12daf15f2e6aef7e94f340d23bc435ddc025f4Joe Onorato.PHONY: apps_only 931da12daf15f2e6aef7e94f340d23bc435ddc025f4Joe Onoratoapps_only: $(unbundled_build_modules) 93216fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato 933da12daf15f2e6aef7e94f340d23bc435ddc025f4Joe Onoratodroid: apps_only 934da12daf15f2e6aef7e94f340d23bc435ddc025f4Joe Onorato 93562c81f821f3675ea57485bfa6cb3320b7178759eYing Wang# Combine the NOTICE files for a apps_only build 93662c81f821f3675ea57485bfa6cb3320b7178759eYing Wang$(eval $(call combine-notice-files, \ 93762c81f821f3675ea57485bfa6cb3320b7178759eYing Wang $(target_notice_file_txt), \ 93862c81f821f3675ea57485bfa6cb3320b7178759eYing Wang $(target_notice_file_html), \ 93962c81f821f3675ea57485bfa6cb3320b7178759eYing Wang "Notices for files for apps:", \ 94062c81f821f3675ea57485bfa6cb3320b7178759eYing Wang $(TARGET_OUT_NOTICE_FILES), \ 94162c81f821f3675ea57485bfa6cb3320b7178759eYing Wang $(apps_only_installed_files))) 94262c81f821f3675ea57485bfa6cb3320b7178759eYing Wang 94362c81f821f3675ea57485bfa6cb3320b7178759eYing Wang 944da12daf15f2e6aef7e94f340d23bc435ddc025f4Joe Onoratoelse # TARGET_BUILD_APPS 945da12daf15f2e6aef7e94f340d23bc435ddc025f4Joe Onorato $(call dist-for-goals, droidcore, \ 94616fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato $(INTERNAL_UPDATE_PACKAGE_TARGET) \ 94716fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato $(INTERNAL_OTA_PACKAGE_TARGET) \ 94816fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato $(SYMBOLS_ZIP) \ 94916fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato $(INSTALLED_FILES_FILE) \ 95016fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato $(INSTALLED_BUILD_PROP_TARGET) \ 95116fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato $(BUILT_TARGET_FILES_PACKAGE) \ 95216fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato $(INSTALLED_ANDROID_INFO_TXT_TARGET) \ 9538532aa03becfb072aa6e884d313a67bada8a5abfEd Heyl $(INSTALLED_RAMDISK_TARGET) \ 95489686538d77c47ed7816594c7597f5d1e456d656Ying Wang $(INSTALLED_FACTORY_RAMDISK_TARGET) \ 955e1d191ee956674147ac1b34129d1f2df322fc3aeJoe Onorato $(INSTALLED_FACTORY_BUNDLE_TARGET) \ 95616fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato ) 95716fa4b290e8ce76652c9ba0ba16b80578456ab95Joe Onorato 95894de1eba0e87297421789b339c5f26bf3e48eeb1Ying Wang # Put a copy of the radio/bootloader files in the dist dir. 95994de1eba0e87297421789b339c5f26bf3e48eeb1Ying Wang $(foreach f,$(INSTALLED_RADIOIMAGE_TARGET), \ 96094de1eba0e87297421789b339c5f26bf3e48eeb1Ying Wang $(call dist-for-goals, droidcore, $(f))) 96194de1eba0e87297421789b339c5f26bf3e48eeb1Ying Wang 962253555b5e3ce7119e25159a5c2a05289abb8869fMike Lockwood ifneq ($(ANDROID_BUILD_EMBEDDED),true) 963971c246cb543b0021f78d52333bcbbe00ca106d8Colin Cross ifneq ($(TARGET_BUILD_PDK),true) 964971c246cb543b0021f78d52333bcbbe00ca106d8Colin Cross $(call dist-for-goals, droidcore, \ 965971c246cb543b0021f78d52333bcbbe00ca106d8Colin Cross $(APPS_ZIP) \ 966971c246cb543b0021f78d52333bcbbe00ca106d8Colin Cross $(INTERNAL_EMULATOR_PACKAGE_TARGET) \ 967971c246cb543b0021f78d52333bcbbe00ca106d8Colin Cross $(PACKAGE_STATS_FILE) \ 968971c246cb543b0021f78d52333bcbbe00ca106d8Colin Cross ) 969971c246cb543b0021f78d52333bcbbe00ca106d8Colin Cross endif 970253555b5e3ce7119e25159a5c2a05289abb8869fMike Lockwood endif 971971c246cb543b0021f78d52333bcbbe00ca106d8Colin Cross 972da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang ifeq ($(EMMA_INSTRUMENT),true) 973da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang $(EMMA_META_ZIP) : $(INSTALLED_SYSTEMIMAGE) 974da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang 975da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang $(call dist-for-goals, dist_files, $(EMMA_META_ZIP)) 976da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang endif 977da19eafc42e93bcd4aa97bd01c2ea93e967f78bfYing Wang 978da12daf15f2e6aef7e94f340d23bc435ddc025f4Joe Onorato# Building a full system-- the default is to build droidcore 979228fcef025cf827428a812a182bce0e9b7ee2b0bYing Wangdroid: droidcore dist_files 98018b75566429107b147368f8e392f6b25f975f5eeGuang Zhu 981f9cd36a0f71c78e20f5ff24f9dd48af17d741cb6Ying Wangendif # TARGET_BUILD_APPS 98288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 98388b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: docs 98488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectdocs: $(ALL_DOCS) 98588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 98688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: sdk 98788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source ProjectALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET) 98888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectsdk: $(ALL_SDK_TARGETS) 989c4d4731b4dd306b74b9e2245b4983b6b3c5b866eRaphael$(call dist-for-goals,sdk win_sdk, \ 990be188cafd21c7356cc33ae042661b682d0536e8bYing Wang $(ALL_SDK_TARGETS) \ 991be188cafd21c7356cc33ae042661b682d0536e8bYing Wang $(SYMBOLS_ZIP) \ 992be188cafd21c7356cc33ae042661b682d0536e8bYing Wang $(INSTALLED_BUILD_PROP_TARGET) \ 993be188cafd21c7356cc33ae042661b682d0536e8bYing Wang) 99488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 995ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wang# umbrella targets to assit engineers in verifying builds 9961d977e318331acdd90a66a972219419cd9508ccfYing Wang.PHONY: java native target host java-host java-target native-host native-target \ 997ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wang java-host-tests java-target-tests native-host-tests native-target-tests \ 998571fee8985746659c4d39ef613d659e6124c66afYing Wang java-tests native-tests host-tests target-tests tests 999ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wang# some synonyms 1000ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wang.PHONY: host-java target-java host-native target-native \ 1001ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wang target-java-tests target-native-tests 1002ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wanghost-java : java-host 1003ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wangtarget-java : java-target 1004ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wanghost-native : native-host 1005ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wangtarget-native : native-target 1006ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wangtarget-java-tests : java-target-tests 1007ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wangtarget-native-tests : native-target-tests 1008571fee8985746659c4d39ef613d659e6124c66afYing Wangtests : host-tests target-tests 1009ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wang 1010c2c368fb76ba6cd3593d17922f53079e0b630a03Ying Wang# To catch more build breakage, check build tests modules in eng and userdebug builds. 10119734252ccf26fd3067d68719d8476b48acc07a2fYing Wangifneq ($(TARGET_BUILD_PDK),true) 1012c2c368fb76ba6cd3593d17922f53079e0b630a03Ying Wangifneq ($(filter eng userdebug,$(TARGET_BUILD_VARIANT)),) 1013c2c368fb76ba6cd3593d17922f53079e0b630a03Ying Wangdroidcore : target-tests host-tests 1014c2c368fb76ba6cd3593d17922f53079e0b630a03Ying Wangendif 10159734252ccf26fd3067d68719d8476b48acc07a2fYing Wangendif 1016ef4d82f283fa279f58f48a0c8a86e40a20bfdcb5Ying Wang 10170d570a71630d70a80e838f068d413f1c1a5f55afYing Wang.PHONY: lintall 10180d570a71630d70a80e838f068d413f1c1a5f55afYing Wang 101948fbc42f93ea0913634f94d815a8937248317012Ying Wangifneq (,$(filter samplecode, $(MAKECMDGOALS))) 10208b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wang.PHONY: samplecode 10218b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wangsample_MODULES := $(sort $(call get-tagged-modules,samples)) 10228b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wangsample_APKS_DEST_PATH := $(TARGET_COMMON_OUT_ROOT)/samples 10238b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wangsample_APKS_COLLECTION := \ 10248b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wang $(foreach module,$(sample_MODULES),$(sample_APKS_DEST_PATH)/$(notdir $(module))) 10258b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wang$(foreach module,$(sample_MODULES),$(eval $(call \ 10268b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wang copy-one-file,$(module),$(sample_APKS_DEST_PATH)/$(notdir $(module))))) 10278b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wangsample_ADDITIONAL_INSTALLED := \ 10288b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wang $(filter-out $(modules_to_install) $(modules_to_check) $(ALL_PREBUILT),$(sample_MODULES)) 10298b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wangsamplecode: $(sample_APKS_COLLECTION) 10308b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wang @echo "Collect sample code apks: $^" 10318b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wang # remove apks that are not intended to be installed. 10328b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wang rm -f $(sample_ADDITIONAL_INSTALLED) 103348fbc42f93ea0913634f94d815a8937248317012Ying Wangendif # samplecode in $(MAKECMDGOALS) 10348b9b39e995407a025ed9bc87b5062194f1b5f51fYing Wang 103588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: findbugs 103688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectfindbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET) 103788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 103888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: clean 103988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectclean: 104038568b424d3139c6d590f9b3d7961e16b8795dc2Alan Viverette @rm -rf $(OUT_DIR)/* 104188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project @echo "Entire build directory removed." 104288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 1043dfc5e0cb7b32c172cc6f88c890c1e6e6ef1ff2feJoe Onorato.PHONY: clobber 1044dfc5e0cb7b32c172cc6f88c890c1e6e6ef1ff2feJoe Onoratoclobber: clean 1045dfc5e0cb7b32c172cc6f88c890c1e6e6ef1ff2feJoe Onorato 104688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project# The rules for dataclean and installclean are defined in cleanbuild.mk. 104788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 104888b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project#xxx scrape this from ALL_MODULE_NAME_TAGS 104988b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: modules 105088b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectmodules: 105188b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project @echo "Available sub-modules:" 105288b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project @echo "$(call module-names-for-tag-list,$(ALL_MODULE_TAGS))" | \ 1053f38069243078629d3ebe127a06b72be911f2dd74Evan JIANG tr -s ' ' '\n' | sort -u | $(COLUMN) 105488b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project 105588b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project.PHONY: showcommands 105688b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Projectshowcommands: 105788b607994a148f4af5bffee163e39ce8296750c6The Android Open Source Project @echo >/dev/null 105810649c632d7e4385909424473ad5a566177216b2Joe Onorato 105910649c632d7e4385909424473ad5a566177216b2Joe Onorato.PHONY: nothing 106010649c632d7e4385909424473ad5a566177216b2Joe Onoratonothing: 106110649c632d7e4385909424473ad5a566177216b2Joe Onorato @echo Successfully read the makefiles. 1062