2010-03-31 07:42:15 +08:00
|
|
|
# Only use ANDROID_BUILD_SHELL to wrap around bash.
|
|
|
|
# DO NOT use other shells such as zsh.
|
2010-03-31 03:55:13 +08:00
|
|
|
ifdef ANDROID_BUILD_SHELL
|
|
|
|
SHELL := $(ANDROID_BUILD_SHELL)
|
|
|
|
else
|
2009-03-04 11:28:42 +08:00
|
|
|
# Use bash, not whatever shell somebody has installed as /bin/sh
|
|
|
|
# This is repeated in config.mk, since envsetup.sh runs that file
|
|
|
|
# directly.
|
|
|
|
SHELL := /bin/bash
|
2010-03-31 03:55:13 +08:00
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# this turns off the suffix rules built into make
|
|
|
|
.SUFFIXES:
|
|
|
|
|
2011-06-23 05:18:57 +08:00
|
|
|
# this turns off the RCS / SCCS implicit rules of GNU Make
|
|
|
|
% : RCS/%,v
|
|
|
|
% : RCS/%
|
|
|
|
% : %,v
|
|
|
|
% : s.%
|
|
|
|
% : SCCS/s.%
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# If a rule fails, delete $@.
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
|
|
|
|
# Figure out where we are.
|
|
|
|
#TOP := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
|
|
|
|
#TOP := $(patsubst %/,%,$(TOP))
|
|
|
|
|
|
|
|
# TOPDIR is the normal variable you should use, because
|
|
|
|
# if we are executing relative to the current directory
|
|
|
|
# it can be "", whereas TOP must be "." which causes
|
|
|
|
# pattern matching probles when make strips off the
|
|
|
|
# trailing "./" from paths in various places.
|
|
|
|
#ifeq ($(TOP),.)
|
|
|
|
#TOPDIR :=
|
|
|
|
#else
|
|
|
|
#TOPDIR := $(TOP)/
|
|
|
|
#endif
|
|
|
|
|
2011-12-20 05:37:55 +08:00
|
|
|
# Check for broken versions of make.
|
|
|
|
# (Allow any version under Cygwin since we don't actually build the platform there.)
|
|
|
|
ifeq (,$(findstring CYGWIN,$(shell uname -sm)))
|
2010-11-19 02:32:12 +08:00
|
|
|
ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.81))
|
2011-12-23 01:46:19 +08:00
|
|
|
ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.82))
|
2009-03-04 11:28:42 +08:00
|
|
|
$(warning ********************************************************************************)
|
|
|
|
$(warning * You are using version $(MAKE_VERSION) of make.)
|
2011-12-23 01:46:19 +08:00
|
|
|
$(warning * Android can only be built by versions 3.81 and 3.82.)
|
2010-06-26 08:31:30 +08:00
|
|
|
$(warning * see http://source.android.com/source/download.html)
|
2009-03-04 11:28:42 +08:00
|
|
|
$(warning ********************************************************************************)
|
|
|
|
$(error stopping)
|
|
|
|
endif
|
2011-12-20 05:37:55 +08:00
|
|
|
endif
|
2011-12-23 01:46:19 +08:00
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
TOP := .
|
|
|
|
TOPDIR :=
|
|
|
|
|
|
|
|
BUILD_SYSTEM := $(TOPDIR)build/core
|
|
|
|
|
|
|
|
# This is the default target. It must be the first declared target.
|
2010-06-10 09:18:31 +08:00
|
|
|
.PHONY: droid
|
2009-03-04 11:28:42 +08:00
|
|
|
DEFAULT_GOAL := droid
|
|
|
|
$(DEFAULT_GOAL):
|
|
|
|
|
2010-05-18 09:16:11 +08:00
|
|
|
# Used to force goals to build. Only use for conditionally defined goals.
|
|
|
|
.PHONY: FORCE
|
|
|
|
FORCE:
|
|
|
|
|
2010-10-29 03:31:47 +08:00
|
|
|
# Targets that provide quick help on the build system.
|
|
|
|
include $(BUILD_SYSTEM)/help.mk
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# Set up various standard variables based on configuration
|
|
|
|
# and host information.
|
|
|
|
include $(BUILD_SYSTEM)/config.mk
|
|
|
|
|
|
|
|
# This allows us to force a clean build - included after the config.make
|
|
|
|
# environment setup is done, but before we generate any dependencies. This
|
|
|
|
# file does the rm -rf inline so the deps which are all done below will
|
|
|
|
# be generated correctly
|
|
|
|
include $(BUILD_SYSTEM)/cleanbuild.mk
|
|
|
|
|
2010-07-08 09:12:25 +08:00
|
|
|
VERSION_CHECK_SEQUENCE_NUMBER := 2
|
2009-07-31 02:54:27 +08:00
|
|
|
-include $(OUT_DIR)/versions_checked.mk
|
|
|
|
ifneq ($(VERSION_CHECK_SEQUENCE_NUMBER),$(VERSIONS_CHECKED))
|
|
|
|
|
|
|
|
$(info Checking build tools versions...)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
ifneq ($(HOST_OS),windows)
|
|
|
|
ifneq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc)
|
|
|
|
# check for a case sensitive file system
|
|
|
|
ifneq (a,$(shell mkdir -p $(OUT_DIR) ; \
|
|
|
|
echo a > $(OUT_DIR)/casecheck.txt; \
|
|
|
|
echo B > $(OUT_DIR)/CaseCheck.txt; \
|
|
|
|
cat $(OUT_DIR)/casecheck.txt))
|
|
|
|
$(warning ************************************************************)
|
|
|
|
$(warning You are building on a case-insensitive filesystem.)
|
|
|
|
$(warning Please move your source tree to a case-sensitive filesystem.)
|
|
|
|
$(warning ************************************************************)
|
|
|
|
$(error Case-insensitive filesystems not supported)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Make sure that there are no spaces in the absolute path; the
|
|
|
|
# build system can't deal with them.
|
|
|
|
ifneq ($(words $(shell pwd)),1)
|
|
|
|
$(warning ************************************************************)
|
|
|
|
$(warning You are building in a directory whose absolute path contains)
|
|
|
|
$(warning a space character:)
|
|
|
|
$(warning $(space))
|
|
|
|
$(warning "$(shell pwd)")
|
|
|
|
$(warning $(space))
|
|
|
|
$(warning Please move your source tree to a path that does not contain)
|
|
|
|
$(warning any spaces.)
|
|
|
|
$(warning ************************************************************)
|
|
|
|
$(error Directory names containing spaces not supported)
|
|
|
|
endif
|
|
|
|
|
2009-06-23 09:15:38 +08:00
|
|
|
|
|
|
|
# Check for the correct version of java
|
2010-10-09 01:58:38 +08:00
|
|
|
java_version := $(shell java -version 2>&1 | head -n 1 | grep '^java .*[ "]1\.6[\. "$$]')
|
|
|
|
ifneq ($(shell java -version 2>&1 | grep -i openjdk),)
|
|
|
|
java_version :=
|
|
|
|
endif
|
2009-06-23 09:15:38 +08:00
|
|
|
ifeq ($(strip $(java_version)),)
|
|
|
|
$(info ************************************************************)
|
|
|
|
$(info You are attempting to build with the incorrect version)
|
|
|
|
$(info of java.)
|
|
|
|
$(info $(space))
|
|
|
|
$(info Your version is: $(shell java -version 2>&1 | head -n 1).)
|
2010-10-09 01:58:38 +08:00
|
|
|
$(info The correct version is: Java SE 1.6.)
|
2009-06-23 09:15:38 +08:00
|
|
|
$(info $(space))
|
|
|
|
$(info Please follow the machine setup instructions at)
|
2010-06-26 08:31:30 +08:00
|
|
|
$(info $(space)$(space)$(space)$(space)http://source.android.com/source/download.html)
|
2009-06-23 09:15:38 +08:00
|
|
|
$(info ************************************************************)
|
2010-06-22 07:26:38 +08:00
|
|
|
$(error stop)
|
2009-06-23 09:15:38 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Check for the correct version of javac
|
2010-06-22 07:26:38 +08:00
|
|
|
javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
|
2009-06-23 09:15:38 +08:00
|
|
|
ifeq ($(strip $(javac_version)),)
|
|
|
|
$(info ************************************************************)
|
|
|
|
$(info You are attempting to build with the incorrect version)
|
|
|
|
$(info of javac.)
|
|
|
|
$(info $(space))
|
|
|
|
$(info Your version is: $(shell javac -version 2>&1 | head -n 1).)
|
2010-06-22 07:26:38 +08:00
|
|
|
$(info The correct version is: 1.6.)
|
2009-06-23 09:15:38 +08:00
|
|
|
$(info $(space))
|
|
|
|
$(info Please follow the machine setup instructions at)
|
2010-06-26 08:31:30 +08:00
|
|
|
$(info $(space)$(space)$(space)$(space)http://source.android.com/source/download.html)
|
2009-06-23 09:15:38 +08:00
|
|
|
$(info ************************************************************)
|
2010-06-22 07:26:38 +08:00
|
|
|
$(error stop)
|
2009-06-23 09:15:38 +08:00
|
|
|
endif
|
|
|
|
|
2009-07-31 02:54:27 +08:00
|
|
|
$(shell echo 'VERSIONS_CHECKED := $(VERSION_CHECK_SEQUENCE_NUMBER)' \
|
|
|
|
> $(OUT_DIR)/versions_checked.mk)
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# These are the modifier targets that don't do anything themselves, but
|
|
|
|
# change the behavior of the build.
|
|
|
|
# (must be defined before including definitions.make)
|
2011-01-21 07:01:56 +08:00
|
|
|
INTERNAL_MODIFIER_TARGETS := showcommands checkbuild all incrementaljavac
|
|
|
|
|
|
|
|
.PHONY: incrementaljavac
|
|
|
|
incrementaljavac: ;
|
|
|
|
|
|
|
|
# WARNING:
|
|
|
|
# ENABLE_INCREMENTALJAVAC should NOT be enabled by default, because change of
|
|
|
|
# a Java source file won't trigger rebuild of its dependent Java files.
|
|
|
|
# You can only enable it by adding "incrementaljavac" to your make command line.
|
|
|
|
# You are responsible for the correctness of the incremental build.
|
|
|
|
# This may decrease incremental build time dramatically for large Java libraries,
|
|
|
|
# such as core.jar, framework.jar, etc.
|
|
|
|
ENABLE_INCREMENTALJAVAC :=
|
|
|
|
ifneq (,$(filter incrementaljavac, $(MAKECMDGOALS)))
|
|
|
|
ENABLE_INCREMENTALJAVAC := true
|
|
|
|
MAKECMDGOALS := $(filter-out incrementaljavac, $(MAKECMDGOALS))
|
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# Bring in standard build system definitions.
|
|
|
|
include $(BUILD_SYSTEM)/definitions.mk
|
|
|
|
|
2010-09-18 07:36:06 +08:00
|
|
|
# Bring in dex_preopt.mk
|
|
|
|
include $(BUILD_SYSTEM)/dex_preopt.mk
|
|
|
|
|
2012-03-14 09:58:27 +08:00
|
|
|
ifneq ($(filter eng user userdebug,$(MAKECMDGOALS)),)
|
2009-03-04 11:28:42 +08:00
|
|
|
$(info ***************************************************************)
|
|
|
|
$(info ***************************************************************)
|
|
|
|
$(info Don't pass '$(filter eng user userdebug tests,$(MAKECMDGOALS))' on \
|
|
|
|
the make command line.)
|
2009-03-10 02:52:11 +08:00
|
|
|
# XXX The single quote on this line fixes gvim's syntax highlighting.
|
|
|
|
# Without which, the rest of this file is impossible to read.
|
2009-03-04 11:28:42 +08:00
|
|
|
$(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or)
|
|
|
|
$(info choosecombo.)
|
|
|
|
$(info ***************************************************************)
|
|
|
|
$(info ***************************************************************)
|
|
|
|
$(error stopping)
|
|
|
|
endif
|
|
|
|
|
2009-03-10 02:52:11 +08:00
|
|
|
ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
|
|
|
|
$(info ***************************************************************)
|
|
|
|
$(info ***************************************************************)
|
|
|
|
$(info Invalid variant: $(TARGET_BUILD_VARIANT)
|
|
|
|
$(info Valid values are: $(INTERNAL_VALID_VARIANTS)
|
|
|
|
$(info ***************************************************************)
|
|
|
|
$(info ***************************************************************)
|
|
|
|
$(error stopping)
|
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2012-02-28 07:49:23 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# The pdk (Platform Development Kit) build
|
2012-03-16 03:23:05 +08:00
|
|
|
# pdk_eng : for building binary blob necessary for pdk_rel build
|
|
|
|
# pdk_rel : HAL build for chipset vendors
|
2012-02-28 07:49:23 +08:00
|
|
|
|
2012-03-16 03:23:05 +08:00
|
|
|
PDK_BUILD_TYPE:= $(filter pdk_eng pdk_rel,$(MAKECMDGOALS))
|
2012-03-13 03:10:42 +08:00
|
|
|
ifeq (2,$(words $(PDK_BUILD_TYPE)))
|
2012-03-16 03:23:05 +08:00
|
|
|
$(error You can't build pdk_eng and pdk_rel in the same run.)
|
2012-02-28 07:49:23 +08:00
|
|
|
endif
|
|
|
|
ifneq ($(PDK_BUILD_TYPE),)
|
|
|
|
$(info PDK build type $(PDK_BUILD_TYPE))
|
2012-03-24 07:04:13 +08:00
|
|
|
BUILD_PDK:=true
|
|
|
|
TARGET_BUILD_PDK:=true
|
2012-02-28 07:49:23 +08:00
|
|
|
include pdk/build/pdk.mk
|
|
|
|
# force droid target
|
|
|
|
MAKECMDGOALS:= $(subst $(PDK_BUILD_TYPE),droid,$(MAKECMDGOALS))
|
2012-03-16 03:23:05 +08:00
|
|
|
ifeq ($(PDK_BUILD_TYPE), pdk_eng)
|
|
|
|
.PHONY: pdk_eng
|
|
|
|
pdk_eng: droid pdk_bin_zip
|
2012-02-28 07:49:23 +08:00
|
|
|
|
2012-03-16 03:23:05 +08:00
|
|
|
else # pdk_rel
|
|
|
|
.PHONY: pdk_rel
|
|
|
|
pdk_rel: droid
|
2012-02-28 07:49:23 +08:00
|
|
|
|
2012-03-16 03:23:05 +08:00
|
|
|
endif # pdk_rel
|
2012-02-28 07:49:23 +08:00
|
|
|
endif # PDK_BUILD_TYPE
|
|
|
|
# -----------------------------------------------------------------
|
2009-03-04 11:28:42 +08:00
|
|
|
###
|
|
|
|
### In this section we set up the things that are different
|
|
|
|
### between the build variants
|
|
|
|
###
|
|
|
|
|
2009-04-14 07:32:16 +08:00
|
|
|
is_sdk_build :=
|
2011-02-16 08:09:36 +08:00
|
|
|
|
|
|
|
ifneq ($(filter sdk win_sdk sdk_addon,$(MAKECMDGOALS)),)
|
2009-04-14 07:32:16 +08:00
|
|
|
is_sdk_build := true
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
## user/userdebug ##
|
|
|
|
|
|
|
|
user_variant := $(filter userdebug user,$(TARGET_BUILD_VARIANT))
|
|
|
|
enable_target_debugging := true
|
|
|
|
ifneq (,$(user_variant))
|
|
|
|
# Target is secure in user builds.
|
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1
|
|
|
|
|
2009-03-10 02:52:11 +08:00
|
|
|
tags_to_install := user
|
2009-03-04 11:28:42 +08:00
|
|
|
ifeq ($(user_variant),userdebug)
|
|
|
|
# Pick up some extra useful tools
|
2009-03-10 02:52:11 +08:00
|
|
|
tags_to_install += debug
|
2010-04-17 07:55:41 +08:00
|
|
|
|
|
|
|
# Enable Dalvik lock contention logging for userdebug builds.
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500
|
2009-03-04 11:28:42 +08:00
|
|
|
else
|
|
|
|
# Disable debugging in plain user builds.
|
|
|
|
enable_target_debugging :=
|
|
|
|
endif
|
2010-09-08 08:45:44 +08:00
|
|
|
|
2011-06-01 01:29:47 +08:00
|
|
|
# Turn on Dalvik preoptimization for user builds, but only if not
|
|
|
|
# explicitly disabled and the build is running on Linux (since host
|
|
|
|
# Dalvik isn't built for non-Linux hosts).
|
2010-09-28 01:37:25 +08:00
|
|
|
ifneq (true,$(DISABLE_DEXPREOPT))
|
2011-06-01 01:29:47 +08:00
|
|
|
ifeq ($(user_variant),user)
|
|
|
|
ifeq ($(HOST_OS),linux)
|
|
|
|
WITH_DEXPREOPT := true
|
|
|
|
endif
|
|
|
|
endif
|
2010-09-28 01:37:25 +08:00
|
|
|
endif
|
2010-09-08 08:45:44 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# Disallow mock locations by default for user builds
|
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=0
|
2010-09-08 08:45:44 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
else # !user_variant
|
|
|
|
# Turn on checkjni for non-user builds.
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES += ro.kernel.android.checkjni=1
|
|
|
|
# Set device insecure for non-user builds.
|
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0
|
|
|
|
# Allow mock locations by default for non user builds
|
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=1
|
|
|
|
endif # !user_variant
|
|
|
|
|
|
|
|
ifeq (true,$(strip $(enable_target_debugging)))
|
|
|
|
# Target is more debuggable and adbd is on by default
|
2011-07-02 00:31:47 +08:00
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
|
2009-03-04 11:28:42 +08:00
|
|
|
# Include the debugging/testing OTA keys in this build.
|
|
|
|
INCLUDE_TEST_OTA_KEYS := true
|
|
|
|
else # !enable_target_debugging
|
|
|
|
# Target is less debuggable and adbd is off by default
|
2011-07-02 00:31:47 +08:00
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0
|
2009-03-04 11:28:42 +08:00
|
|
|
endif # !enable_target_debugging
|
|
|
|
|
2009-03-10 02:52:11 +08:00
|
|
|
## eng ##
|
|
|
|
|
|
|
|
ifeq ($(TARGET_BUILD_VARIANT),eng)
|
|
|
|
tags_to_install := user debug eng
|
2011-12-02 04:46:12 +08:00
|
|
|
ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))),)
|
2009-03-12 03:11:54 +08:00
|
|
|
# Don't require the setup wizard on eng builds
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\
|
2009-10-08 01:01:13 +08:00
|
|
|
$(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))) \
|
|
|
|
ro.setupwizard.mode=OPTIONAL
|
2009-03-10 02:52:11 +08:00
|
|
|
endif
|
2011-12-02 04:46:12 +08:00
|
|
|
endif
|
2009-03-10 02:52:11 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
## tests ##
|
|
|
|
|
|
|
|
ifeq ($(TARGET_BUILD_VARIANT),tests)
|
2009-03-10 02:52:11 +08:00
|
|
|
tags_to_install := user debug eng tests
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
## sdk ##
|
|
|
|
|
2009-04-14 07:32:16 +08:00
|
|
|
ifdef is_sdk_build
|
2011-02-16 08:09:36 +08:00
|
|
|
|
|
|
|
# Detect if we want to build a repository for the SDK
|
|
|
|
sdk_repo_goal := $(strip $(filter sdk_repo,$(MAKECMDGOALS)))
|
|
|
|
MAKECMDGOALS := $(strip $(filter-out sdk_repo,$(MAKECMDGOALS)))
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
ifneq ($(words $(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))),1)
|
|
|
|
$(error The 'sdk' target may not be specified with any other targets)
|
|
|
|
endif
|
2010-04-17 08:50:09 +08:00
|
|
|
|
2009-03-10 02:52:11 +08:00
|
|
|
# TODO: this should be eng I think. Since the sdk is built from the eng
|
|
|
|
# variant.
|
2009-04-07 11:32:24 +08:00
|
|
|
tags_to_install := user debug eng
|
2009-03-04 11:28:42 +08:00
|
|
|
ADDITIONAL_BUILD_PROPERTIES += xmpp.auto-presence=true
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES += ro.config.nocheckin=yes
|
|
|
|
else # !sdk
|
|
|
|
endif
|
|
|
|
|
2010-08-31 03:48:03 +08:00
|
|
|
BUILD_WITHOUT_PV := true
|
|
|
|
|
2009-04-14 05:48:35 +08:00
|
|
|
## precise GC ##
|
|
|
|
|
|
|
|
ifneq ($(filter dalvik.gc.type-precise,$(PRODUCT_TAGS)),)
|
|
|
|
# Enabling type-precise GC results in larger optimized DEX files. The
|
|
|
|
# additional storage requirements for ".odex" files can cause /system
|
|
|
|
# to overflow on some devices, so this is configured separately for
|
|
|
|
# each product.
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.dexopt-flags=m=y
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
ADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android
|
|
|
|
|
|
|
|
# enable vm tracing in files for now to help track
|
|
|
|
# the cause of ANRs in the content process
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.stack-trace-file=/data/anr/traces.txt
|
|
|
|
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
# Define a function that, given a list of module tags, returns
|
|
|
|
# non-empty if that module should be installed in /system.
|
|
|
|
|
2009-03-10 02:52:11 +08:00
|
|
|
# For most goals, anything not tagged with the "tests" tag should
|
2009-03-04 11:28:42 +08:00
|
|
|
# be installed in /system.
|
|
|
|
define should-install-to-system
|
2009-03-10 02:52:11 +08:00
|
|
|
$(if $(filter tests,$(1)),,true)
|
2009-03-04 11:28:42 +08:00
|
|
|
endef
|
|
|
|
|
2009-04-14 07:32:16 +08:00
|
|
|
ifdef is_sdk_build
|
2009-03-04 11:28:42 +08:00
|
|
|
# For the sdk goal, anything with the "samples" tag should be
|
|
|
|
# installed in /data even if that module also has "eng"/"debug"/"user".
|
|
|
|
define should-install-to-system
|
2009-03-10 02:52:11 +08:00
|
|
|
$(if $(filter samples tests,$(1)),,true)
|
2009-03-04 11:28:42 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2009-07-18 03:33:40 +08:00
|
|
|
# If they only used the modifier goals (showcommands, checkbuild), we'll actually
|
|
|
|
# build the default target.
|
|
|
|
ifeq ($(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS)),)
|
|
|
|
.PHONY: $(INTERNAL_MODIFIER_TARGETS)
|
|
|
|
$(INTERNAL_MODIFIER_TARGETS): $(DEFAULT_GOAL)
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
# These targets are going to delete stuff, don't bother including
|
|
|
|
# the whole directory tree if that's all we're going to do
|
|
|
|
ifeq ($(MAKECMDGOALS),clean)
|
|
|
|
dont_bother := true
|
|
|
|
endif
|
|
|
|
ifeq ($(MAKECMDGOALS),clobber)
|
|
|
|
dont_bother := true
|
|
|
|
endif
|
|
|
|
ifeq ($(MAKECMDGOALS),dataclean)
|
|
|
|
dont_bother := true
|
|
|
|
endif
|
|
|
|
ifeq ($(MAKECMDGOALS),installclean)
|
|
|
|
dont_bother := true
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Bring in all modules that need to be built.
|
|
|
|
ifneq ($(dont_bother),true)
|
|
|
|
|
2010-04-14 01:38:35 +08:00
|
|
|
ifeq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc)
|
2009-03-04 11:28:42 +08:00
|
|
|
SDK_ONLY := true
|
2010-04-14 01:38:35 +08:00
|
|
|
$(info Building the SDK under darwin-ppc is actually obsolete and unsupported.)
|
|
|
|
$(error stop)
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
2010-04-14 01:38:35 +08:00
|
|
|
|
|
|
|
ifeq ($(HOST_OS),windows)
|
2009-03-04 11:28:42 +08:00
|
|
|
SDK_ONLY := true
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SDK_ONLY),true)
|
2012-01-27 07:11:46 +08:00
|
|
|
include $(TOPDIR)sdk/build/sdk_only_whitelist.mk
|
|
|
|
include $(TOPDIR)development/build/sdk_only_whitelist.mk
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# Exclude tools/acp when cross-compiling windows under linux
|
|
|
|
ifeq ($(findstring Linux,$(UNAME)),)
|
|
|
|
subdirs += build/tools/acp
|
|
|
|
endif
|
|
|
|
|
|
|
|
else # !SDK_ONLY
|
|
|
|
ifeq ($(BUILD_TINY_ANDROID), true)
|
|
|
|
|
2011-06-23 05:18:57 +08:00
|
|
|
# TINY_ANDROID is a super-minimal build configuration, handy for board
|
2009-03-04 11:28:42 +08:00
|
|
|
# bringup and very low level debugging
|
|
|
|
|
|
|
|
subdirs := \
|
|
|
|
bionic \
|
|
|
|
system/core \
|
2011-01-21 07:33:23 +08:00
|
|
|
system/extras/ext4_utils \
|
2011-01-24 09:06:58 +08:00
|
|
|
system/extras/su \
|
2009-03-04 11:28:42 +08:00
|
|
|
build/libs \
|
|
|
|
build/target \
|
|
|
|
build/tools/acp \
|
2012-02-07 10:47:00 +08:00
|
|
|
external/gcc-demangle \
|
2011-08-17 07:15:26 +08:00
|
|
|
external/mksh \
|
2009-03-04 11:28:42 +08:00
|
|
|
external/yaffs2 \
|
|
|
|
external/zlib
|
|
|
|
else # !BUILD_TINY_ANDROID
|
2012-02-28 07:49:23 +08:00
|
|
|
ifneq ($(BUILD_PDK),)
|
|
|
|
subdirs := $(BUILD_PDK_SUBDIRS)
|
|
|
|
FULL_BUILD := true
|
|
|
|
else # Normal droid build
|
2009-03-04 11:28:42 +08:00
|
|
|
#
|
|
|
|
# Typical build; include any Android.mk files we can find.
|
|
|
|
#
|
|
|
|
subdirs := $(TOP)
|
|
|
|
|
|
|
|
FULL_BUILD := true
|
|
|
|
|
2012-02-28 07:49:23 +08:00
|
|
|
endif # !BUILD_PDK
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
endif # !BUILD_TINY_ANDROID
|
|
|
|
|
|
|
|
endif # !SDK_ONLY
|
|
|
|
|
2010-09-15 01:09:48 +08:00
|
|
|
# Before we go and include all of the module makefiles, stash away
|
2010-10-12 07:31:49 +08:00
|
|
|
# the PRODUCT_* values so that later we can verify they are not modified.
|
|
|
|
stash_product_vars:=true
|
2010-09-15 01:09:48 +08:00
|
|
|
ifeq ($(stash_product_vars),true)
|
2010-10-12 07:31:49 +08:00
|
|
|
$(call stash-product-vars, __STASHED)
|
2010-09-15 01:09:48 +08:00
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
ifneq ($(ONE_SHOT_MAKEFILE),)
|
|
|
|
# We've probably been invoked by the "mm" shell function
|
|
|
|
# with a subdirectory's makefile.
|
|
|
|
include $(ONE_SHOT_MAKEFILE)
|
|
|
|
# Change CUSTOM_MODULES to include only modules that were
|
|
|
|
# defined by this makefile; this will install all of those
|
|
|
|
# modules as a side-effect. Do this after including ONE_SHOT_MAKEFILE
|
|
|
|
# so that the modules will be installed in the same place they
|
|
|
|
# would have been with a normal make.
|
2010-01-08 03:19:39 +08:00
|
|
|
CUSTOM_MODULES := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS)))
|
2009-03-04 11:28:42 +08:00
|
|
|
FULL_BUILD :=
|
|
|
|
# Stub out the notice targets, which probably aren't defined
|
|
|
|
# when using ONE_SHOT_MAKEFILE.
|
|
|
|
NOTICE-HOST-%: ;
|
|
|
|
NOTICE-TARGET-%: ;
|
2009-07-31 02:20:04 +08:00
|
|
|
|
|
|
|
else # ONE_SHOT_MAKEFILE
|
|
|
|
|
|
|
|
#
|
|
|
|
# Include all of the makefiles in the system
|
|
|
|
#
|
|
|
|
|
|
|
|
# Can't use first-makefiles-under here because
|
|
|
|
# --mindepth=2 makes the prunes not work.
|
|
|
|
subdir_makefiles := \
|
2009-08-05 03:58:26 +08:00
|
|
|
$(shell build/tools/findleaves.py --prune=out --prune=.repo --prune=.git $(subdirs) Android.mk)
|
2009-07-31 02:20:04 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
include $(subdir_makefiles)
|
2009-07-31 02:20:04 +08:00
|
|
|
endif # ONE_SHOT_MAKEFILE
|
|
|
|
|
2010-09-15 01:09:48 +08:00
|
|
|
ifeq ($(stash_product_vars),true)
|
2010-10-12 07:31:49 +08:00
|
|
|
$(call assert-product-vars, __STASHED)
|
2010-09-15 01:09:48 +08:00
|
|
|
endif
|
|
|
|
|
2010-09-27 04:05:41 +08:00
|
|
|
include $(BUILD_SYSTEM)/legacy_prebuilts.mk
|
|
|
|
ifneq ($(filter-out $(GRANDFATHERED_ALL_PREBUILT),$(strip $(notdir $(ALL_PREBUILT)))),)
|
|
|
|
$(warning *** Some files have been added to ALL_PREBUILT.)
|
|
|
|
$(warning *)
|
2010-11-19 06:27:00 +08:00
|
|
|
$(warning * ALL_PREBUILT is a deprecated mechanism that)
|
2010-09-27 04:05:41 +08:00
|
|
|
$(warning * should not be used for new files.)
|
|
|
|
$(warning * As an alternative, use PRODUCT_COPY_FILES in)
|
|
|
|
$(warning * the appropriate product definition.)
|
|
|
|
$(warning * build/target/product/core.mk is the product)
|
|
|
|
$(warning * definition used in all products.)
|
|
|
|
$(warning *)
|
|
|
|
$(foreach bad_prebuilt,$(filter-out $(GRANDFATHERED_ALL_PREBUILT),$(strip $(notdir $(ALL_PREBUILT)))),$(warning * unexpected $(bad_prebuilt) in ALL_PREBUILT))
|
|
|
|
$(warning *)
|
|
|
|
$(error ALL_PREBUILT contains unexpected files)
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# -------------------------------------------------------------------
|
|
|
|
# All module makefiles have been included at this point.
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
# Include any makefiles that must happen after the module makefiles
|
|
|
|
# have been included.
|
|
|
|
# TODO: have these files register themselves via a global var rather
|
|
|
|
# than hard-coding the list here.
|
|
|
|
ifdef FULL_BUILD
|
|
|
|
# Only include this during a full build, otherwise we can't be
|
|
|
|
# guaranteed that any policies were included.
|
|
|
|
-include frameworks/policies/base/PolicyConfig.mk
|
|
|
|
endif
|
|
|
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
# Fix up CUSTOM_MODULES to refer to installed files rather than
|
|
|
|
# just bare module names. Leave unknown modules alone in case
|
|
|
|
# they're actually full paths to a particular file.
|
|
|
|
known_custom_modules := $(filter $(ALL_MODULES),$(CUSTOM_MODULES))
|
|
|
|
unknown_custom_modules := $(filter-out $(ALL_MODULES),$(CUSTOM_MODULES))
|
|
|
|
CUSTOM_MODULES := \
|
|
|
|
$(call module-installed-files,$(known_custom_modules)) \
|
|
|
|
$(unknown_custom_modules)
|
|
|
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
# Define dependencies for modules that require other modules.
|
|
|
|
# This can only happen now, after we've read in all module makefiles.
|
|
|
|
#
|
|
|
|
# TODO: deal with the fact that a bare module name isn't
|
|
|
|
# unambiguous enough. Maybe declare short targets like
|
|
|
|
# APPS:Quake or HOST:SHARED_LIBRARIES:libutils.
|
|
|
|
# BUG: the system image won't know to depend on modules that are
|
|
|
|
# brought in as requirements of other modules.
|
|
|
|
define add-required-deps
|
|
|
|
$(1): $(2)
|
|
|
|
endef
|
|
|
|
$(foreach m,$(ALL_MODULES), \
|
|
|
|
$(eval r := $(ALL_MODULES.$(m).REQUIRED)) \
|
|
|
|
$(if $(r), \
|
|
|
|
$(eval r := $(call module-installed-files,$(r))) \
|
2010-09-28 08:37:17 +08:00
|
|
|
$(eval $(call add-required-deps,$(ALL_MODULES.$(m).INSTALLED),$(r))) \
|
2009-03-04 11:28:42 +08:00
|
|
|
) \
|
|
|
|
)
|
|
|
|
m :=
|
|
|
|
r :=
|
2010-09-24 10:07:32 +08:00
|
|
|
i :=
|
2009-03-04 11:28:42 +08:00
|
|
|
add-required-deps :=
|
|
|
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
# Figure out our module sets.
|
|
|
|
|
|
|
|
# Of the modules defined by the component makefiles,
|
|
|
|
# determine what we actually want to build.
|
|
|
|
Default_MODULES := $(sort $(ALL_DEFAULT_INSTALLED_MODULES) \
|
|
|
|
$(CUSTOM_MODULES))
|
2009-03-10 02:52:11 +08:00
|
|
|
# TODO: Remove the 3 places in the tree that use
|
|
|
|
# ALL_DEFAULT_INSTALLED_MODULES and get rid of it from this list.
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
ifdef FULL_BUILD
|
|
|
|
# The base list of modules to build for this product is specified
|
|
|
|
# by the appropriate product definition file, which was included
|
|
|
|
# by product_config.make.
|
|
|
|
user_PACKAGES := $(call module-installed-files, \
|
|
|
|
$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES))
|
|
|
|
ifeq (0,1)
|
|
|
|
$(info user packages for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):)
|
|
|
|
$(foreach p,$(user_PACKAGES),$(info : $(p)))
|
|
|
|
$(error done)
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
# We're not doing a full build, and are probably only including
|
|
|
|
# a subset of the module makefiles. Don't try to build any modules
|
|
|
|
# requested by the product, because we probably won't have rules
|
|
|
|
# to build them.
|
|
|
|
user_PACKAGES :=
|
|
|
|
endif
|
|
|
|
# Use tags to get the non-APPS user modules. Use the product
|
|
|
|
# definition files to get the APPS user modules.
|
2010-06-04 01:57:02 +08:00
|
|
|
user_MODULES := $(sort $(call get-tagged-modules,user shell_$(TARGET_SHELL)))
|
2009-03-04 11:28:42 +08:00
|
|
|
user_MODULES := $(user_MODULES) $(user_PACKAGES)
|
|
|
|
|
2010-01-08 03:44:22 +08:00
|
|
|
eng_MODULES := $(sort $(call get-tagged-modules,eng))
|
|
|
|
debug_MODULES := $(sort $(call get-tagged-modules,debug))
|
|
|
|
tests_MODULES := $(sort $(call get-tagged-modules,tests))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2009-03-10 02:52:11 +08:00
|
|
|
ifeq ($(strip $(tags_to_install)),)
|
|
|
|
$(error ASSERTION FAILED: tags_to_install should not be empty)
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
2009-03-10 02:52:11 +08:00
|
|
|
modules_to_install := $(sort $(Default_MODULES) \
|
|
|
|
$(foreach tag,$(tags_to_install),$($(tag)_MODULES)))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# Some packages may override others using LOCAL_OVERRIDES_PACKAGES.
|
|
|
|
# Filter out (do not install) any overridden packages.
|
2009-03-10 02:52:11 +08:00
|
|
|
overridden_packages := $(call get-package-overrides,$(modules_to_install))
|
2009-03-04 11:28:42 +08:00
|
|
|
ifdef overridden_packages
|
2009-03-10 02:52:11 +08:00
|
|
|
# old_modules_to_install := $(modules_to_install)
|
|
|
|
modules_to_install := \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(filter-out $(foreach p,$(overridden_packages),$(p) %/$(p).apk), \
|
2009-03-10 02:52:11 +08:00
|
|
|
$(modules_to_install))
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
2009-03-10 02:52:11 +08:00
|
|
|
#$(error filtered out
|
|
|
|
# $(filter-out $(modules_to_install),$(old_modules_to_install)))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# Don't include any GNU targets in the SDK. It's ok (and necessary)
|
|
|
|
# to build the host tools, but nothing that's going to be installed
|
|
|
|
# on the target (including static libraries).
|
2009-04-14 07:32:16 +08:00
|
|
|
ifdef is_sdk_build
|
2009-03-04 11:28:42 +08:00
|
|
|
target_gnu_MODULES := \
|
|
|
|
$(filter \
|
|
|
|
$(TARGET_OUT_INTERMEDIATES)/% \
|
|
|
|
$(TARGET_OUT)/% \
|
|
|
|
$(TARGET_OUT_DATA)/%, \
|
|
|
|
$(sort $(call get-tagged-modules,gnu)))
|
|
|
|
$(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d)))
|
2009-03-10 02:52:11 +08:00
|
|
|
modules_to_install := \
|
|
|
|
$(filter-out $(target_gnu_MODULES),$(modules_to_install))
|
2011-10-09 05:31:54 +08:00
|
|
|
|
|
|
|
# Ensure every module listed in PRODUCT_PACKAGES gets something installed
|
|
|
|
$(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \
|
|
|
|
$(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\
|
|
|
|
$(error Module '$(m)' in PRODUCT_PACKAGES has nothing to install!)))
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2009-07-18 03:33:40 +08:00
|
|
|
# build/core/Makefile contains extra stuff that we don't want to pollute this
|
2009-03-04 11:28:42 +08:00
|
|
|
# top-level makefile with. It expects that ALL_DEFAULT_INSTALLED_MODULES
|
|
|
|
# contains everything that's built during the current make, but it also further
|
|
|
|
# extends ALL_DEFAULT_INSTALLED_MODULES.
|
2009-03-10 02:52:11 +08:00
|
|
|
ALL_DEFAULT_INSTALLED_MODULES := $(modules_to_install)
|
2009-03-04 11:28:42 +08:00
|
|
|
include $(BUILD_SYSTEM)/Makefile
|
2009-03-10 02:52:11 +08:00
|
|
|
modules_to_install := $(sort $(ALL_DEFAULT_INSTALLED_MODULES))
|
2009-03-04 11:28:42 +08:00
|
|
|
ALL_DEFAULT_INSTALLED_MODULES :=
|
|
|
|
|
|
|
|
endif # dont_bother
|
|
|
|
|
2009-07-18 03:33:40 +08:00
|
|
|
# These are additional goals that we build, in order to make sure that there
|
|
|
|
# is as little code as possible in the tree that doesn't build.
|
|
|
|
modules_to_check := $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).CHECKED))
|
|
|
|
|
|
|
|
# If you would like to build all goals, and not skip any intermediate
|
|
|
|
# steps, you can pass the "all" modifier goal on the commandline.
|
|
|
|
ifneq ($(filter all,$(MAKECMDGOALS)),)
|
|
|
|
modules_to_check += $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).BUILT))
|
|
|
|
endif
|
|
|
|
|
|
|
|
# for easier debugging
|
|
|
|
modules_to_check := $(sort $(modules_to_check))
|
|
|
|
#$(error modules_to_check $(modules_to_check))
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# -------------------------------------------------------------------
|
|
|
|
# This is used to to get the ordering right, you can also use these,
|
|
|
|
# but they're considered undocumented, so don't complain if their
|
|
|
|
# behavior changes.
|
|
|
|
.PHONY: prebuilt
|
|
|
|
prebuilt: $(ALL_PREBUILT)
|
|
|
|
|
|
|
|
# An internal target that depends on all copied headers
|
|
|
|
# (see copy_headers.make). Other targets that need the
|
|
|
|
# headers to be copied first can depend on this target.
|
|
|
|
.PHONY: all_copied_headers
|
|
|
|
all_copied_headers: ;
|
|
|
|
|
|
|
|
$(ALL_C_CPP_ETC_OBJECTS): | all_copied_headers
|
|
|
|
|
|
|
|
# All the droid stuff, in directories
|
|
|
|
.PHONY: files
|
2009-07-18 03:33:40 +08:00
|
|
|
files: prebuilt \
|
|
|
|
$(modules_to_install) \
|
|
|
|
$(modules_to_check) \
|
|
|
|
$(INSTALLED_ANDROID_INFO_TXT_TARGET)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
2009-07-18 03:33:40 +08:00
|
|
|
.PHONY: checkbuild
|
|
|
|
checkbuild: $(modules_to_check)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
.PHONY: ramdisk
|
|
|
|
ramdisk: $(INSTALLED_RAMDISK_TARGET)
|
|
|
|
|
2011-12-17 03:27:52 +08:00
|
|
|
.PHONY: factory_ramdisk
|
|
|
|
factory_ramdisk: $(INSTALLED_FACTORY_RAMDISK_TARGET)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
.PHONY: systemtarball
|
|
|
|
systemtarball: $(INSTALLED_SYSTEMTARBALL_TARGET)
|
|
|
|
|
2010-06-05 06:24:49 +08:00
|
|
|
.PHONY: boottarball
|
|
|
|
boottarball: $(INSTALLED_BOOTTARBALL_TARGET)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
.PHONY: userdataimage
|
|
|
|
userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET)
|
|
|
|
|
2011-02-02 06:52:05 +08:00
|
|
|
ifneq (,$(filter userdataimage, $(MAKECMDGOALS)))
|
|
|
|
$(call dist-for-goals, userdataimage, $(BUILT_USERDATAIMAGE_TARGET))
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
.PHONY: userdatatarball
|
|
|
|
userdatatarball: $(INSTALLED_USERDATATARBALL_TARGET)
|
|
|
|
|
2011-11-05 02:37:01 +08:00
|
|
|
.PHONY: cacheimage
|
|
|
|
cacheimage: $(INSTALLED_CACHEIMAGE_TARGET)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
.PHONY: bootimage
|
|
|
|
bootimage: $(INSTALLED_BOOTIMAGE_TARGET)
|
|
|
|
|
|
|
|
ifeq ($(BUILD_TINY_ANDROID), true)
|
|
|
|
INSTALLED_RECOVERYIMAGE_TARGET :=
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Build files and then package it into the rom formats
|
|
|
|
.PHONY: droidcore
|
|
|
|
droidcore: files \
|
|
|
|
systemimage \
|
|
|
|
$(INSTALLED_BOOTIMAGE_TARGET) \
|
|
|
|
$(INSTALLED_RECOVERYIMAGE_TARGET) \
|
|
|
|
$(INSTALLED_USERDATAIMAGE_TARGET) \
|
2011-11-05 02:37:01 +08:00
|
|
|
$(INSTALLED_CACHEIMAGE_TARGET) \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(INSTALLED_FILES_FILE)
|
|
|
|
|
2010-12-09 12:07:48 +08:00
|
|
|
# dist_files only for putting your library into the dist directory with a full build.
|
|
|
|
.PHONY: dist_files
|
2010-07-14 12:08:38 +08:00
|
|
|
|
2010-06-22 03:34:51 +08:00
|
|
|
ifeq ($(EMMA_INSTRUMENT),true)
|
2010-12-09 12:07:48 +08:00
|
|
|
$(call dist-for-goals, dist_files, $(EMMA_META_ZIP))
|
2010-06-22 03:34:51 +08:00
|
|
|
endif
|
|
|
|
|
2010-04-29 03:59:51 +08:00
|
|
|
# Dist for droid if droid is among the cmd goals, or no cmd goal is given.
|
|
|
|
ifneq ($(filter droid,$(MAKECMDGOALS))$(filter ||,|$(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))|),)
|
2010-07-08 07:57:28 +08:00
|
|
|
|
2010-06-10 07:35:58 +08:00
|
|
|
ifneq ($(TARGET_BUILD_APPS),)
|
2010-06-10 09:18:31 +08:00
|
|
|
# If this build is just for apps, only build apps and not the full system by default.
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2010-06-10 07:35:58 +08:00
|
|
|
unbundled_build_modules :=
|
|
|
|
ifneq ($(filter all,$(TARGET_BUILD_APPS)),)
|
2010-06-25 06:08:33 +08:00
|
|
|
# If they used the magic goal "all" then build all apps in the source tree.
|
|
|
|
unbundled_build_modules := $(foreach m,$(sort $(ALL_MODULES)),$(if $(filter APPS,$(ALL_MODULES.$(m).CLASS)),$(m)))
|
2010-06-10 07:35:58 +08:00
|
|
|
else
|
|
|
|
unbundled_build_modules := $(TARGET_BUILD_APPS)
|
|
|
|
endif
|
2010-05-12 05:36:32 +08:00
|
|
|
|
2010-06-10 07:35:58 +08:00
|
|
|
# dist the unbundled app.
|
2010-06-10 09:18:31 +08:00
|
|
|
$(call dist-for-goals,apps_only, \
|
2010-06-10 07:35:58 +08:00
|
|
|
$(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) \
|
2010-05-12 05:36:32 +08:00
|
|
|
)
|
2010-06-10 07:35:58 +08:00
|
|
|
|
2010-06-10 09:18:31 +08:00
|
|
|
.PHONY: apps_only
|
|
|
|
apps_only: $(unbundled_build_modules)
|
2010-06-10 07:35:58 +08:00
|
|
|
|
2010-06-10 09:18:31 +08:00
|
|
|
droid: apps_only
|
|
|
|
|
|
|
|
else # TARGET_BUILD_APPS
|
|
|
|
$(call dist-for-goals, droidcore, \
|
2010-06-10 07:35:58 +08:00
|
|
|
$(INTERNAL_UPDATE_PACKAGE_TARGET) \
|
|
|
|
$(INTERNAL_OTA_PACKAGE_TARGET) \
|
|
|
|
$(SYMBOLS_ZIP) \
|
|
|
|
$(INSTALLED_FILES_FILE) \
|
|
|
|
$(INSTALLED_BUILD_PROP_TARGET) \
|
|
|
|
$(BUILT_TARGET_FILES_PACKAGE) \
|
|
|
|
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \
|
2010-07-02 01:07:28 +08:00
|
|
|
$(INSTALLED_RAMDISK_TARGET) \
|
2011-12-17 03:27:52 +08:00
|
|
|
$(INSTALLED_FACTORY_RAMDISK_TARGET) \
|
2010-06-10 07:35:58 +08:00
|
|
|
)
|
|
|
|
|
2012-03-30 05:31:08 +08:00
|
|
|
ifneq ($(TARGET_BUILD_PDK),true)
|
|
|
|
$(call dist-for-goals, droidcore, \
|
|
|
|
$(APPS_ZIP) \
|
|
|
|
$(INTERNAL_EMULATOR_PACKAGE_TARGET) \
|
|
|
|
$(PACKAGE_STATS_FILE) \
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2010-06-10 09:18:31 +08:00
|
|
|
# Building a full system-- the default is to build droidcore
|
2010-12-09 12:07:48 +08:00
|
|
|
droid: droidcore dist_files
|
2010-05-14 07:46:21 +08:00
|
|
|
|
2010-06-16 06:43:13 +08:00
|
|
|
endif # TARGET_BUILD_APPS
|
|
|
|
endif # droid in $(MAKECMDGOALS)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2010-06-10 09:18:31 +08:00
|
|
|
|
2012-03-14 09:58:27 +08:00
|
|
|
.PHONY: droid
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2010-07-21 07:18:16 +08:00
|
|
|
# phony target that include any targets in $(ALL_MODULES)
|
|
|
|
.PHONY: all_modules
|
|
|
|
all_modules: $(ALL_MODULES)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
.PHONY: docs
|
|
|
|
docs: $(ALL_DOCS)
|
|
|
|
|
|
|
|
.PHONY: sdk
|
|
|
|
ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET)
|
|
|
|
sdk: $(ALL_SDK_TARGETS)
|
2011-02-16 08:09:36 +08:00
|
|
|
ifneq ($(filter sdk win_sdk,$(MAKECMDGOALS)),)
|
|
|
|
$(call dist-for-goals,sdk win_sdk, \
|
2011-03-08 08:13:32 +08:00
|
|
|
$(ALL_SDK_TARGETS) \
|
|
|
|
$(SYMBOLS_ZIP) \
|
|
|
|
$(INSTALLED_BUILD_PROP_TARGET) \
|
|
|
|
)
|
2010-04-29 03:59:51 +08:00
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2010-02-26 12:20:43 +08:00
|
|
|
.PHONY: samplecode
|
|
|
|
sample_MODULES := $(sort $(call get-tagged-modules,samples))
|
|
|
|
sample_APKS_DEST_PATH := $(TARGET_COMMON_OUT_ROOT)/samples
|
|
|
|
sample_APKS_COLLECTION := \
|
|
|
|
$(foreach module,$(sample_MODULES),$(sample_APKS_DEST_PATH)/$(notdir $(module)))
|
|
|
|
$(foreach module,$(sample_MODULES),$(eval $(call \
|
|
|
|
copy-one-file,$(module),$(sample_APKS_DEST_PATH)/$(notdir $(module)))))
|
|
|
|
sample_ADDITIONAL_INSTALLED := \
|
|
|
|
$(filter-out $(modules_to_install) $(modules_to_check) $(ALL_PREBUILT),$(sample_MODULES))
|
|
|
|
samplecode: $(sample_APKS_COLLECTION)
|
|
|
|
@echo "Collect sample code apks: $^"
|
|
|
|
# remove apks that are not intended to be installed.
|
|
|
|
rm -f $(sample_ADDITIONAL_INSTALLED)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
.PHONY: findbugs
|
|
|
|
findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
@rm -rf $(OUT_DIR)
|
|
|
|
@echo "Entire build directory removed."
|
|
|
|
|
2010-09-04 01:25:11 +08:00
|
|
|
.PHONY: clobber
|
|
|
|
clobber: clean
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# The rules for dataclean and installclean are defined in cleanbuild.mk.
|
|
|
|
|
|
|
|
#xxx scrape this from ALL_MODULE_NAME_TAGS
|
|
|
|
.PHONY: modules
|
|
|
|
modules:
|
|
|
|
@echo "Available sub-modules:"
|
|
|
|
@echo "$(call module-names-for-tag-list,$(ALL_MODULE_TAGS))" | \
|
2009-01-24 00:11:30 +08:00
|
|
|
tr -s ' ' '\n' | sort -u | $(COLUMN)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
.PHONY: showcommands
|
|
|
|
showcommands:
|
|
|
|
@echo >/dev/null
|