2010-03-31 01:42:15 +02:00
|
|
|
# Only use ANDROID_BUILD_SHELL to wrap around bash.
|
|
|
|
# DO NOT use other shells such as zsh.
|
2010-03-30 21:55:13 +02:00
|
|
|
ifdef ANDROID_BUILD_SHELL
|
|
|
|
SHELL := $(ANDROID_BUILD_SHELL)
|
|
|
|
else
|
2009-03-04 04:28:42 +01: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-30 21:55:13 +02:00
|
|
|
endif
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2016-09-06 22:19:14 +02:00
|
|
|
ifndef KATI
|
2017-01-28 22:27:35 +01:00
|
|
|
USE_SOONG_UI ?= true
|
2016-09-06 22:19:14 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(USE_SOONG_UI),true)
|
|
|
|
|
|
|
|
host_prebuilts := linux-x86
|
|
|
|
ifeq ($(shell uname),Darwin)
|
|
|
|
host_prebuilts := darwin-x86
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: run_soong_ui
|
|
|
|
run_soong_ui:
|
|
|
|
+@prebuilts/build-tools/$(host_prebuilts)/bin/makeparallel --ninja build/soong/soong_ui.bash --make-mode $(MAKECMDGOALS)
|
|
|
|
|
|
|
|
.PHONY: $(MAKECMDGOALS)
|
2017-02-09 04:50:16 +01:00
|
|
|
$(sort $(MAKECMDGOALS)) : run_soong_ui
|
|
|
|
@#empty
|
2016-09-06 22:19:14 +02:00
|
|
|
|
|
|
|
else # USE_SOONG_UI
|
|
|
|
|
2012-05-23 03:29:02 +02:00
|
|
|
# Absolute path of the present working direcotry.
|
|
|
|
# This overrides the shell variable $PWD, which does not necessarily points to
|
|
|
|
# the top of the source tree, for example when "make -C" is used in m/mm/mmm.
|
|
|
|
PWD := $(shell pwd)
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
TOP := .
|
|
|
|
TOPDIR :=
|
|
|
|
|
|
|
|
BUILD_SYSTEM := $(TOPDIR)build/core
|
|
|
|
|
|
|
|
# This is the default target. It must be the first declared target.
|
2010-06-10 03:18:31 +02:00
|
|
|
.PHONY: droid
|
2009-03-04 04:28:42 +01:00
|
|
|
DEFAULT_GOAL := droid
|
2015-09-26 01:43:36 +02:00
|
|
|
$(DEFAULT_GOAL): droid_targets
|
|
|
|
|
|
|
|
.PHONY: droid_targets
|
|
|
|
droid_targets:
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2010-10-28 21:31:47 +02:00
|
|
|
# Targets that provide quick help on the build system.
|
|
|
|
include $(BUILD_SYSTEM)/help.mk
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
# Set up various standard variables based on configuration
|
|
|
|
# and host information.
|
|
|
|
include $(BUILD_SYSTEM)/config.mk
|
|
|
|
|
2016-01-06 23:28:36 +01:00
|
|
|
ifndef KATI
|
|
|
|
ifdef USE_NINJA
|
|
|
|
$(warning USE_NINJA is ignored. Ninja is always used.)
|
2015-09-29 00:36:05 +02:00
|
|
|
endif
|
|
|
|
|
2015-09-17 00:29:08 +02:00
|
|
|
# Mark this is a ninja build.
|
|
|
|
$(shell mkdir -p $(OUT_DIR) && touch $(OUT_DIR)/ninja_build)
|
2015-07-17 02:27:52 +02:00
|
|
|
include build/core/ninja.mk
|
2016-01-06 23:28:36 +01:00
|
|
|
else # KATI
|
2015-07-17 02:27:52 +02:00
|
|
|
|
2016-11-10 01:35:34 +01:00
|
|
|
ifneq ($(filter $(dont_bother_goals), $(MAKECMDGOALS)),)
|
|
|
|
dont_bother := true
|
|
|
|
endif
|
|
|
|
|
2016-03-29 21:32:16 +02:00
|
|
|
include $(SOONG_MAKEVARS_MK)
|
|
|
|
|
2016-12-15 00:54:01 +01:00
|
|
|
include $(BUILD_SYSTEM)/clang/config.mk
|
|
|
|
|
2015-07-17 02:15:19 +02:00
|
|
|
# Write the build number to a file so it can be read back in
|
|
|
|
# without changing the command line every time. Avoids rebuilds
|
|
|
|
# when using ninja.
|
2015-08-12 00:25:12 +02:00
|
|
|
$(shell mkdir -p $(OUT_DIR) && \
|
|
|
|
echo -n $(BUILD_NUMBER) > $(OUT_DIR)/build_number.txt && \
|
|
|
|
echo -n $(BUILD_DATETIME) > $(OUT_DIR)/build_date.txt)
|
2015-07-17 02:15:19 +02:00
|
|
|
BUILD_NUMBER_FROM_FILE := $$(cat $(OUT_DIR)/build_number.txt)
|
2015-08-12 00:25:12 +02:00
|
|
|
BUILD_DATETIME_FROM_FILE := $$(cat $(OUT_DIR)/build_date.txt)
|
|
|
|
ifeq ($(HOST_OS),darwin)
|
|
|
|
DATE_FROM_FILE := date -r $(BUILD_DATETIME_FROM_FILE)
|
|
|
|
else
|
|
|
|
DATE_FROM_FILE := date -d @$(BUILD_DATETIME_FROM_FILE)
|
|
|
|
endif
|
2015-07-17 02:15:19 +02:00
|
|
|
|
2015-02-13 19:28:40 +01:00
|
|
|
# CTS-specific config.
|
|
|
|
-include cts/build/config.mk
|
2016-02-25 00:41:01 +01:00
|
|
|
# VTS-specific config.
|
|
|
|
-include test/vts/tools/vts-tradefed/build/config.mk
|
2017-02-16 20:49:18 +01:00
|
|
|
# device-tests-specific-config.
|
|
|
|
-include tools/tradefederation/build/suites/device-tests/config.mk
|
|
|
|
# general-tests-specific-config.
|
|
|
|
-include tools/tradefederation/build/suites/general-tests/config.mk
|
2015-02-13 19:28:40 +01:00
|
|
|
|
2013-02-23 03:15:29 +01:00
|
|
|
# This allows us to force a clean build - included after the config.mk
|
2009-03-04 04:28:42 +01:00
|
|
|
# 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
|
|
|
|
|
Build from source or prebuilt
With this change, you can easily switch between building from source
code and prebuilt.
Set LOCAL_PREBUILT_MODULE_FILE to the path of the prebuilt file,
relative to the top of the source tree, in the usual module definition.
The prebuilt will be used unless any of the followings satisfied:
1) ANDROID_BUILD_FROM_SOURCE is "true", which disable prebuilt globally;
2) The module name is in ANDROID_NO_PREBUILT_MODULES;
3) The LOCAL_PATH is prefixed by any of ANDROID_NO_PREBUILT_PATHS.
A developer can set ANDROID_NO_PREBUILT_MODULES or
ANDROID_NO_PREBUILT_PATHS to build only his own module(s) from source,
while build other modules from prebuilts.
You can set ANDROID_BUILD_FROM_SOURCE to true to build everything from
source.
Those variables can be set with shell environmental variable or in your
buildspec.mk.
Sometimes module B is able to be built from source only if module A is
also
built from source, for example, if B is the test apk of A.
In that case, you can use the macro include-if-build-from-source to
include B's Android.mk only if A is built from source too, or
if-build-from-source to conditionally include the definition of module
B,
if their module definitions are in the same Android.mk.
Support host-executable-hook and host-shared-library-hook.
Change-Id: Icab7cf028c87eaba0dd7efc2a7749fd6f32b44e4
2012-12-14 03:23:01 +01:00
|
|
|
# Include the google-specific config
|
|
|
|
-include vendor/google/build/config.mk
|
|
|
|
|
2016-01-25 18:35:57 +01:00
|
|
|
VERSION_CHECK_SEQUENCE_NUMBER := 6
|
2016-02-06 03:24:17 +01:00
|
|
|
JAVA_NOT_REQUIRED_CHECKED :=
|
2009-07-30 20:54:27 +02:00
|
|
|
-include $(OUT_DIR)/versions_checked.mk
|
2016-02-06 03:24:17 +01:00
|
|
|
ifneq ($(VERSION_CHECK_SEQUENCE_NUMBER)$(JAVA_NOT_REQUIRED),$(VERSIONS_CHECKED)$(JAVA_NOT_REQUIRED_CHECKED))
|
2009-07-30 20:54:27 +02:00
|
|
|
|
|
|
|
$(info Checking build tools versions...)
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
# 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
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2016-02-06 03:24:17 +01:00
|
|
|
ifneq ($(JAVA_NOT_REQUIRED),true)
|
2014-04-01 15:16:26 +02:00
|
|
|
java_version_str := $(shell unset _JAVA_OPTIONS && java -version 2>&1)
|
|
|
|
javac_version_str := $(shell unset _JAVA_OPTIONS && javac -version 2>&1)
|
|
|
|
|
2016-01-25 18:35:57 +01:00
|
|
|
# Check for the correct version of java, should be 1.8 by
|
|
|
|
# default and only 1.7 if LEGACY_USE_JAVA7 is set.
|
|
|
|
ifeq ($(LEGACY_USE_JAVA7),) # if LEGACY_USE_JAVA7 == ''
|
2014-10-16 11:23:03 +02:00
|
|
|
required_version := "1.8.x"
|
|
|
|
required_javac_version := "1.8"
|
2015-10-12 18:29:45 +02:00
|
|
|
java_version := $(shell echo '$(java_version_str)' | grep '[ "]1\.8[\. "$$]')
|
2014-10-16 11:23:03 +02:00
|
|
|
javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.8[\. "$$]')
|
2016-01-25 18:35:57 +01:00
|
|
|
else
|
2014-04-01 15:16:26 +02:00
|
|
|
required_version := "1.7.x"
|
|
|
|
required_javac_version := "1.7"
|
|
|
|
java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.7[\. "$$]')
|
|
|
|
javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.7[\. "$$]')
|
2016-01-25 18:35:57 +01:00
|
|
|
endif # if LEGACY_USE_JAVA7 == ''
|
2014-04-01 15:16:26 +02: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: $(java_version_str).)
|
|
|
|
$(info The required version is: $(required_version))
|
|
|
|
$(info $(space))
|
|
|
|
$(info Please follow the machine setup instructions at)
|
|
|
|
$(info $(space)$(space)$(space)$(space)https://source.android.com/source/initializing.html)
|
|
|
|
$(info ************************************************************)
|
|
|
|
$(error stop)
|
|
|
|
endif
|
|
|
|
|
2013-12-05 13:26:35 +01:00
|
|
|
# Check for the current JDK.
|
|
|
|
#
|
2016-01-25 18:35:57 +01:00
|
|
|
# For Java 1.7/1.8, we require OpenJDK on linux and Oracle JDK on Mac OS.
|
2013-12-05 13:26:35 +01:00
|
|
|
requires_openjdk := false
|
2015-05-05 20:41:52 +02:00
|
|
|
ifeq ($(BUILD_OS),linux)
|
2013-12-05 13:26:35 +01:00
|
|
|
requires_openjdk := true
|
|
|
|
endif
|
|
|
|
|
2013-11-14 00:05:15 +01:00
|
|
|
|
2013-09-21 02:11:43 +02:00
|
|
|
# Check for the current jdk
|
2013-12-05 13:26:35 +01:00
|
|
|
ifeq ($(requires_openjdk), true)
|
2016-01-20 19:46:13 +01:00
|
|
|
# The user asked for openjdk, so check that the host
|
|
|
|
# java version is really openjdk and not some other JDK.
|
2013-11-14 00:05:15 +01:00
|
|
|
ifeq ($(shell echo '$(java_version_str)' | grep -i openjdk),)
|
2013-09-21 02:11:43 +02:00
|
|
|
$(info ************************************************************)
|
2016-01-20 19:46:13 +01:00
|
|
|
$(info You asked for an OpenJDK based build but your version is)
|
2013-11-14 00:05:15 +01:00
|
|
|
$(info $(java_version_str).)
|
2013-09-21 02:11:43 +02:00
|
|
|
$(info ************************************************************)
|
|
|
|
$(error stop)
|
|
|
|
endif # java version is not OpenJdk
|
2013-12-05 13:26:35 +01:00
|
|
|
else # if requires_openjdk
|
2013-11-14 00:05:15 +01:00
|
|
|
ifneq ($(shell echo '$(java_version_str)' | grep -i openjdk),)
|
2013-02-23 20:25:00 +01:00
|
|
|
$(info ************************************************************)
|
|
|
|
$(info You are attempting to build with an unsupported JDK.)
|
|
|
|
$(info $(space))
|
|
|
|
$(info You use OpenJDK but only Sun/Oracle JDK is supported.)
|
|
|
|
$(info Please follow the machine setup instructions at)
|
|
|
|
$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html)
|
|
|
|
$(info ************************************************************)
|
|
|
|
$(error stop)
|
2013-09-21 02:11:43 +02:00
|
|
|
endif # java version is not Sun Oracle JDK
|
2013-12-05 13:26:35 +01:00
|
|
|
endif # if requires_openjdk
|
2013-09-21 02:11:43 +02:00
|
|
|
|
2016-04-13 23:33:00 +02:00
|
|
|
KNOWN_INCOMPATIBLE_JAVAC_VERSIONS := google
|
|
|
|
incompat_javac := $(foreach v,$(KNOWN_INCOMPATIBLE_JAVAC_VERSIONS),$(findstring $(v),$(javac_version_str)))
|
|
|
|
ifneq ($(incompat_javac),)
|
|
|
|
javac_version :=
|
|
|
|
endif
|
|
|
|
|
2009-06-23 03:15:38 +02:00
|
|
|
# Check for the correct version of javac
|
|
|
|
ifeq ($(strip $(javac_version)),)
|
|
|
|
$(info ************************************************************)
|
|
|
|
$(info You are attempting to build with the incorrect version)
|
|
|
|
$(info of javac.)
|
|
|
|
$(info $(space))
|
2013-11-14 00:05:15 +01:00
|
|
|
$(info Your version is: $(javac_version_str).)
|
2016-04-13 23:33:00 +02:00
|
|
|
ifneq ($(incompat_javac),)
|
|
|
|
$(info This '$(incompat_javac)' version is not supported for Android platform builds.)
|
|
|
|
$(info Use a publicly available JDK and make sure you have run envsetup.sh / lunch.)
|
|
|
|
else
|
2013-09-21 02:11:43 +02:00
|
|
|
$(info The required version is: $(required_javac_version))
|
2016-04-13 23:33:00 +02:00
|
|
|
endif
|
2009-06-23 03:15:38 +02:00
|
|
|
$(info $(space))
|
|
|
|
$(info Please follow the machine setup instructions at)
|
2012-04-19 23:53:27 +02:00
|
|
|
$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html)
|
2009-06-23 03:15:38 +02:00
|
|
|
$(info ************************************************************)
|
2010-06-22 01:26:38 +02:00
|
|
|
$(error stop)
|
2009-06-23 03:15:38 +02:00
|
|
|
endif
|
|
|
|
|
2016-01-29 01:12:01 +01:00
|
|
|
endif # if JAVA_NOT_REQUIRED
|
2013-11-14 00:05:15 +01:00
|
|
|
|
2013-04-12 23:14:36 +02:00
|
|
|
ifndef BUILD_EMULATOR
|
2014-05-09 15:19:45 +02:00
|
|
|
# Emulator binaries are now provided under prebuilts/android-emulator/
|
2012-07-25 23:28:05 +02:00
|
|
|
BUILD_EMULATOR := false
|
2013-04-12 23:14:36 +02:00
|
|
|
endif
|
2012-06-29 01:02:19 +02:00
|
|
|
|
2009-07-30 20:54:27 +02:00
|
|
|
$(shell echo 'VERSIONS_CHECKED := $(VERSION_CHECK_SEQUENCE_NUMBER)' \
|
|
|
|
> $(OUT_DIR)/versions_checked.mk)
|
2013-04-12 23:14:36 +02:00
|
|
|
$(shell echo 'BUILD_EMULATOR ?= $(BUILD_EMULATOR)' \
|
2012-07-26 02:55:03 +02:00
|
|
|
>> $(OUT_DIR)/versions_checked.mk)
|
2016-02-06 03:24:17 +01:00
|
|
|
$(shell echo 'JAVA_NOT_REQUIRED_CHECKED := $(JAVA_NOT_REQUIRED)' \
|
|
|
|
>> $(OUT_DIR)/versions_checked.mk)
|
2009-07-30 20:54:27 +02:00
|
|
|
endif
|
|
|
|
|
2009-03-04 04:28:42 +01: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)
|
2015-05-08 22:27:25 +02:00
|
|
|
INTERNAL_MODIFIER_TARGETS := showcommands all
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2012-08-22 01:59:01 +02:00
|
|
|
# EMMA_INSTRUMENT_STATIC merges the static emma library to each emma-enabled module.
|
|
|
|
ifeq (true,$(EMMA_INSTRUMENT_STATIC))
|
|
|
|
EMMA_INSTRUMENT := true
|
|
|
|
endif
|
|
|
|
|
2017-01-20 05:17:12 +01:00
|
|
|
#
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Validate ADDITIONAL_DEFAULT_PROPERTIES.
|
|
|
|
ifneq ($(ADDITIONAL_DEFAULT_PROPERTIES),)
|
|
|
|
$(error ADDITIONAL_DEFAULT_PROPERTIES must not be set before here: $(ADDITIONAL_DEFAULT_PROPERTIES))
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Validate ADDITIONAL_BUILD_PROPERTIES.
|
|
|
|
ifneq ($(ADDITIONAL_BUILD_PROPERTIES),)
|
|
|
|
$(error ADDITIONAL_BUILD_PROPERTIES must not be set before here: $(ADDITIONAL_BUILD_PROPERTIES))
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Add the product-defined properties to the build properties.
|
|
|
|
ifdef PRODUCT_SHIPPING_API_LEVEL
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES += \
|
|
|
|
ro.product.first_api_level=$(PRODUCT_SHIPPING_API_LEVEL)
|
|
|
|
endif
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES := \
|
|
|
|
$(ADDITIONAL_BUILD_PROPERTIES) \
|
|
|
|
$(PRODUCT_PROPERTY_OVERRIDES)
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
# Bring in standard build system definitions.
|
|
|
|
include $(BUILD_SYSTEM)/definitions.mk
|
|
|
|
|
2010-09-18 01:36:06 +02:00
|
|
|
# Bring in dex_preopt.mk
|
|
|
|
include $(BUILD_SYSTEM)/dex_preopt.mk
|
|
|
|
|
2012-05-22 23:08:50 +02:00
|
|
|
ifneq ($(filter user userdebug eng,$(MAKECMDGOALS)),)
|
2009-03-04 04:28:42 +01:00
|
|
|
$(info ***************************************************************)
|
|
|
|
$(info ***************************************************************)
|
2011-11-17 23:51:12 +01:00
|
|
|
$(info Do not pass '$(filter user userdebug eng,$(MAKECMDGOALS))' on \
|
|
|
|
the make command line.)
|
2009-03-04 04:28:42 +01:00
|
|
|
$(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or)
|
|
|
|
$(info choosecombo.)
|
|
|
|
$(info ***************************************************************)
|
|
|
|
$(info ***************************************************************)
|
|
|
|
$(error stopping)
|
|
|
|
endif
|
|
|
|
|
2009-03-09 19:52:11 +01:00
|
|
|
ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
|
|
|
|
$(info ***************************************************************)
|
|
|
|
$(info ***************************************************************)
|
2015-01-21 03:23:05 +01:00
|
|
|
$(info Invalid variant: $(TARGET_BUILD_VARIANT))
|
|
|
|
$(info Valid values are: $(INTERNAL_VALID_VARIANTS))
|
2009-03-09 19:52:11 +01:00
|
|
|
$(info ***************************************************************)
|
|
|
|
$(info ***************************************************************)
|
|
|
|
$(error stopping)
|
|
|
|
endif
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2012-06-07 02:19:29 +02:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Variable to check java support level inside PDK build.
|
|
|
|
# Not necessary if the components is not in PDK.
|
|
|
|
# not defined : not supported
|
|
|
|
# "sdk" : sdk API only
|
|
|
|
# "platform" : platform API supproted
|
|
|
|
TARGET_BUILD_JAVA_SUPPORT_LEVEL := platform
|
|
|
|
|
2012-02-28 00:49:23 +01:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# The pdk (Platform Development Kit) build
|
2012-03-31 03:08:07 +02:00
|
|
|
include build/core/pdk_config.mk
|
|
|
|
|
2015-07-03 15:46:51 +02:00
|
|
|
#
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Jack version configuration
|
2015-11-13 00:29:12 +01:00
|
|
|
-include $(TOPDIR)prebuilts/sdk/tools/jack_versions.mk
|
|
|
|
-include $(TOPDIR)prebuilts/sdk/tools/jack_for_module.mk
|
2015-07-03 15:46:51 +02:00
|
|
|
|
2015-12-03 10:23:33 +01:00
|
|
|
#
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Install and start Jack server
|
|
|
|
-include $(TOPDIR)prebuilts/sdk/tools/jack_server_setup.mk
|
|
|
|
|
2015-11-19 17:53:00 +01:00
|
|
|
#
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Jacoco package name for Jack
|
|
|
|
-include $(TOPDIR)external/jacoco/config.mk
|
|
|
|
|
2016-02-27 01:24:26 +01:00
|
|
|
#
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Enable dynamic linker developer warnings for all builds except
|
|
|
|
# final release.
|
|
|
|
ifneq ($(PLATFORM_VERSION_CODENAME),REL)
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES += ro.bionic.ld.warning=1
|
|
|
|
endif
|
|
|
|
|
2017-03-01 01:48:23 +01:00
|
|
|
# Boolean variable determining if Treble is fully enabled
|
|
|
|
PRODUCT_FULL_TREBLE := false
|
|
|
|
ifeq ($(PRODUCT_FULL_TREBLE_OVERRIDE),true)
|
|
|
|
PRODUCT_FULL_TREBLE := true
|
|
|
|
else ifeq ($(PRODUCT_SHIPPING_API_LEVEL),)
|
|
|
|
#$(warning no product shipping level defined)
|
|
|
|
else ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),26),)
|
|
|
|
PRODUCT_FULL_TREBLE := true
|
|
|
|
endif
|
|
|
|
|
2012-02-28 00:49:23 +01:00
|
|
|
# -----------------------------------------------------------------
|
2009-03-04 04:28:42 +01:00
|
|
|
###
|
|
|
|
### In this section we set up the things that are different
|
|
|
|
### between the build variants
|
|
|
|
###
|
|
|
|
|
2009-04-14 01:32:16 +02:00
|
|
|
is_sdk_build :=
|
2011-02-16 01:09:36 +01:00
|
|
|
|
|
|
|
ifneq ($(filter sdk win_sdk sdk_addon,$(MAKECMDGOALS)),)
|
2009-04-14 01:32:16 +02:00
|
|
|
is_sdk_build := true
|
|
|
|
endif
|
|
|
|
|
2014-10-17 10:05:50 +02:00
|
|
|
# Add build properties for ART. These define system properties used by installd
|
|
|
|
# to pass flags to dex2oat.
|
2015-11-10 08:42:49 +01:00
|
|
|
ADDITIONAL_BUILD_PROPERTIES += persist.sys.dalvik.vm.lib.2=libart.so
|
2014-10-17 10:05:50 +02:00
|
|
|
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).variant=$(DEX2OAT_TARGET_CPU_VARIANT)
|
|
|
|
ifneq ($(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),)
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).features=$(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
|
|
|
|
endif
|
|
|
|
|
2014-08-19 21:28:08 +02:00
|
|
|
ifdef TARGET_2ND_ARCH
|
2014-10-17 10:05:50 +02:00
|
|
|
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_2ND_ARCH).variant=$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT)
|
|
|
|
ifneq ($($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),)
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_2ND_ARCH).features=$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
|
|
|
|
endif
|
2014-08-19 21:28:08 +02:00
|
|
|
endif
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
## user/userdebug ##
|
|
|
|
|
2012-05-22 23:08:50 +02:00
|
|
|
user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT))
|
2009-03-04 04:28:42 +01:00
|
|
|
enable_target_debugging := true
|
2012-05-22 23:08:50 +02:00
|
|
|
tags_to_install :=
|
2009-03-04 04:28:42 +01:00
|
|
|
ifneq (,$(user_variant))
|
|
|
|
# Target is secure in user builds.
|
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1
|
2016-05-17 06:40:52 +02:00
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += security.perf_harden=1
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2015-12-16 22:42:49 +01:00
|
|
|
ifeq ($(user_variant),user)
|
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1
|
|
|
|
endif
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
ifeq ($(user_variant),userdebug)
|
|
|
|
# Pick up some extra useful tools
|
2009-03-09 19:52:11 +01:00
|
|
|
tags_to_install += debug
|
2009-03-04 04:28:42 +01:00
|
|
|
else
|
|
|
|
# Disable debugging in plain user builds.
|
|
|
|
enable_target_debugging :=
|
|
|
|
endif
|
2010-09-08 02:45:44 +02:00
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
# Disallow mock locations by default for user builds
|
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=0
|
2010-09-08 02:45:44 +02:00
|
|
|
|
2009-03-04 04:28:42 +01: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-01 18:31:47 +02:00
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
|
2014-09-19 20:30:27 +02:00
|
|
|
# Enable Dalvik lock contention logging.
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500
|
2009-03-04 04:28:42 +01: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-01 18:31:47 +02:00
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0
|
2009-03-04 04:28:42 +01:00
|
|
|
endif # !enable_target_debugging
|
|
|
|
|
2009-03-09 19:52:11 +01:00
|
|
|
## eng ##
|
|
|
|
|
|
|
|
ifeq ($(TARGET_BUILD_VARIANT),eng)
|
2012-05-22 23:08:50 +02:00
|
|
|
tags_to_install := debug eng
|
2011-12-01 21:46:12 +01:00
|
|
|
ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))),)
|
2009-03-11 20:11:54 +01:00
|
|
|
# Don't require the setup wizard on eng builds
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\
|
2009-10-07 19:01:13 +02:00
|
|
|
$(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))) \
|
|
|
|
ro.setupwizard.mode=OPTIONAL
|
2009-03-09 19:52:11 +01:00
|
|
|
endif
|
2014-10-03 22:36:51 +02:00
|
|
|
ifndef is_sdk_build
|
2015-12-15 10:53:05 +01:00
|
|
|
# To speedup startup of non-preopted builds, don't verify or compile the boot image.
|
2015-03-19 18:34:23 +01:00
|
|
|
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.image-dex2oat-filter=verify-at-runtime
|
2014-10-03 22:36:51 +02:00
|
|
|
endif
|
2011-12-01 21:46:12 +01:00
|
|
|
endif
|
2009-03-09 19:52:11 +01:00
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
## sdk ##
|
|
|
|
|
2009-04-14 01:32:16 +02:00
|
|
|
ifdef is_sdk_build
|
2011-02-16 01:09:36 +01: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)))
|
|
|
|
|
2015-10-28 20:34:03 +01:00
|
|
|
ifneq ($(words $(sort $(filter-out $(INTERNAL_MODIFIER_TARGETS) checkbuild emulator_tests target-files-package,$(MAKECMDGOALS)))),1)
|
2009-03-04 04:28:42 +01:00
|
|
|
$(error The 'sdk' target may not be specified with any other targets)
|
|
|
|
endif
|
2010-04-17 02:50:09 +02:00
|
|
|
|
2016-08-02 02:41:49 +02:00
|
|
|
# AUX dependencies are already added by now; remove triggers from the MAKECMDGOALS
|
|
|
|
MAKECMDGOALS := $(strip $(filter-out AUX-%,$(MAKECMDGOALS)))
|
|
|
|
|
2009-03-09 19:52:11 +01:00
|
|
|
# TODO: this should be eng I think. Since the sdk is built from the eng
|
|
|
|
# variant.
|
2012-05-22 23:08:50 +02:00
|
|
|
tags_to_install := debug eng
|
2009-03-04 04:28:42 +01:00
|
|
|
ADDITIONAL_BUILD_PROPERTIES += xmpp.auto-presence=true
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES += ro.config.nocheckin=yes
|
|
|
|
else # !sdk
|
|
|
|
endif
|
|
|
|
|
2010-08-30 21:48:03 +02:00
|
|
|
BUILD_WITHOUT_PV := true
|
|
|
|
|
2009-03-04 04:28:42 +01: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-09 19:52:11 +01:00
|
|
|
# For most goals, anything not tagged with the "tests" tag should
|
2009-03-04 04:28:42 +01:00
|
|
|
# be installed in /system.
|
|
|
|
define should-install-to-system
|
2009-03-09 19:52:11 +01:00
|
|
|
$(if $(filter tests,$(1)),,true)
|
2009-03-04 04:28:42 +01:00
|
|
|
endef
|
|
|
|
|
2009-04-14 01:32:16 +02:00
|
|
|
ifdef is_sdk_build
|
2009-03-04 04:28:42 +01: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-09 19:52:11 +01:00
|
|
|
$(if $(filter samples tests,$(1)),,true)
|
2009-03-04 04:28:42 +01:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2013-02-22 03:41:51 +01:00
|
|
|
# If they only used the modifier goals (showcommands, etc), we'll actually
|
2009-07-17 21:33:40 +02:00
|
|
|
# build the default target.
|
|
|
|
ifeq ($(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS)),)
|
|
|
|
.PHONY: $(INTERNAL_MODIFIER_TARGETS)
|
|
|
|
$(INTERNAL_MODIFIER_TARGETS): $(DEFAULT_GOAL)
|
2009-03-04 04:28:42 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Typical build; include any Android.mk files we can find.
|
|
|
|
#
|
|
|
|
|
|
|
|
FULL_BUILD := true
|
|
|
|
|
2016-10-06 01:57:27 +02:00
|
|
|
# Before we go and include all of the module makefiles, mark the PRODUCT_*
|
2017-01-20 05:17:12 +01:00
|
|
|
# and ADDITIONAL*PROPERTIES values readonly so that they won't be modified.
|
2016-10-06 01:57:27 +02:00
|
|
|
$(call readonly-product-vars)
|
2017-01-20 05:17:12 +01:00
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES := $(strip $(ADDITIONAL_DEFAULT_PROPERTIES))
|
|
|
|
.KATI_READONLY := ADDITIONAL_DEFAULT_PROPERTIES
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES := $(strip $(ADDITIONAL_BUILD_PROPERTIES))
|
|
|
|
.KATI_READONLY := ADDITIONAL_BUILD_PROPERTIES
|
2010-09-14 19:09:48 +02:00
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
ifneq ($(ONE_SHOT_MAKEFILE),)
|
|
|
|
# We've probably been invoked by the "mm" shell function
|
|
|
|
# with a subdirectory's makefile.
|
2016-07-12 01:57:33 +02:00
|
|
|
include $(SOONG_ANDROID_MK) $(wildcard $(ONE_SHOT_MAKEFILE))
|
2009-03-04 04:28:42 +01:00
|
|
|
# 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-07 20:19:39 +01:00
|
|
|
CUSTOM_MODULES := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS)))
|
2009-03-04 04:28:42 +01:00
|
|
|
FULL_BUILD :=
|
|
|
|
# Stub out the notice targets, which probably aren't defined
|
|
|
|
# when using ONE_SHOT_MAKEFILE.
|
|
|
|
NOTICE-HOST-%: ;
|
|
|
|
NOTICE-TARGET-%: ;
|
2009-07-30 20:20:04 +02:00
|
|
|
|
2013-08-16 22:24:47 +02:00
|
|
|
# A helper goal printing out install paths
|
2016-08-12 02:20:33 +02:00
|
|
|
define register_module_install_path
|
|
|
|
.PHONY: GET-MODULE-INSTALL-PATH-$(1)
|
|
|
|
GET-MODULE-INSTALL-PATH-$(1):
|
|
|
|
echo 'INSTALL-PATH: $(1) $(ALL_MODULES.$(1).INSTALLED)'
|
|
|
|
endef
|
|
|
|
|
|
|
|
SORTED_ALL_MODULES := $(sort $(ALL_MODULES))
|
|
|
|
UNIQUE_ALL_MODULES :=
|
|
|
|
$(foreach m,$(SORTED_ALL_MODULES),\
|
|
|
|
$(if $(call streq,$(m),$(lastword $(UNIQUE_ALL_MODULES))),,\
|
|
|
|
$(eval UNIQUE_ALL_MODULES += $(m))))
|
|
|
|
SORTED_ALL_MODULES :=
|
|
|
|
|
|
|
|
$(foreach mod,$(UNIQUE_ALL_MODULES),$(if $(ALL_MODULES.$(mod).INSTALLED),\
|
|
|
|
$(eval $(call register_module_install_path,$(mod)))\
|
|
|
|
$(foreach path,$(ALL_MODULES.$(mod).PATH),\
|
|
|
|
$(eval my_path_prefix := GET-INSTALL-PATH-IN)\
|
|
|
|
$(foreach component,$(subst /,$(space),$(path)),\
|
|
|
|
$(eval my_path_prefix := $$(my_path_prefix)-$$(component))\
|
|
|
|
$(eval .PHONY: $$(my_path_prefix))\
|
|
|
|
$(eval $$(my_path_prefix): GET-MODULE-INSTALL-PATH-$(mod))))))
|
|
|
|
UNIQUE_ALL_MODULES :=
|
2013-08-16 22:24:47 +02:00
|
|
|
|
2009-07-30 20:20:04 +02:00
|
|
|
else # ONE_SHOT_MAKEFILE
|
|
|
|
|
2013-09-09 21:11:02 +02:00
|
|
|
ifneq ($(dont_bother),true)
|
2009-07-30 20:20:04 +02:00
|
|
|
#
|
|
|
|
# Include all of the makefiles in the system
|
|
|
|
#
|
|
|
|
|
2016-05-28 00:23:13 +02:00
|
|
|
subdir_makefiles := $(SOONG_ANDROID_MK) $(call first-makefiles-under,$(TOP))
|
2017-02-18 19:41:30 +01:00
|
|
|
subdir_makefiles_total := $(words $(subdir_makefiles))
|
|
|
|
.KATI_READONLY := subdir_makefiles_total
|
2016-01-11 21:33:23 +01:00
|
|
|
|
2017-02-18 19:41:30 +01:00
|
|
|
$(foreach mk,$(subdir_makefiles),$(info [$(call inc_and_print,subdir_makefiles_inc)/$(subdir_makefiles_total)] including $(mk) ...)$(eval include $(mk)))
|
2012-05-25 06:05:19 +02:00
|
|
|
|
2016-03-11 19:32:01 +01:00
|
|
|
ifdef PDK_FUSION_PLATFORM_ZIP
|
|
|
|
# Bring in the PDK platform.zip modules.
|
|
|
|
include $(BUILD_SYSTEM)/pdk_fusion_modules.mk
|
|
|
|
endif # PDK_FUSION_PLATFORM_ZIP
|
|
|
|
|
2013-09-09 21:11:02 +02:00
|
|
|
endif # dont_bother
|
|
|
|
|
2009-07-30 20:20:04 +02:00
|
|
|
endif # ONE_SHOT_MAKEFILE
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
# -------------------------------------------------------------------
|
|
|
|
# All module makefiles have been included at this point.
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
# 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.
|
2014-02-11 07:26:23 +01:00
|
|
|
#
|
|
|
|
# Resolve the required module name to 32-bit or 64-bit variant.
|
|
|
|
# Get a list of corresponding 32-bit module names, if one exists.
|
2016-03-17 03:53:19 +01:00
|
|
|
ifneq ($(TARGET_TRANSLATE_2ND_ARCH),true)
|
2014-02-11 07:26:23 +01:00
|
|
|
define get-32-bit-modules
|
2016-03-17 03:53:19 +01:00
|
|
|
$(sort $(foreach m,$(1),\
|
2014-02-11 07:26:23 +01:00
|
|
|
$(if $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).CLASS),\
|
2016-03-17 03:53:19 +01:00
|
|
|
$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX))\
|
|
|
|
$(if $(ALL_MODULES.$(m)$(HOST_2ND_ARCH_MODULE_SUFFIX).CLASS),\
|
|
|
|
$(m)$(HOST_2ND_ARCH_MODULE_SUFFIX))\
|
|
|
|
))
|
2014-02-11 07:26:23 +01:00
|
|
|
endef
|
|
|
|
# Get a list of corresponding 32-bit module names, if one exists;
|
|
|
|
# otherwise return the original module name
|
|
|
|
define get-32-bit-modules-if-we-can
|
2016-03-17 03:53:19 +01:00
|
|
|
$(sort $(foreach m,$(1),\
|
|
|
|
$(if $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).CLASS)$(ALL_MODULES.$(m)$(HOST_2ND_ARCH_MODULE_SUFFIX).CLASS),\
|
|
|
|
$(if $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).CLASS),$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX)) \
|
|
|
|
$(if $(ALL_MODULES.$(m)$(HOST_2ND_ARCH_MODULE_SUFFIX).CLASS),$(m)$(HOST_2ND_ARCH_MODULE_SUFFIX)),\
|
|
|
|
$(m))))
|
|
|
|
endef
|
|
|
|
else # TARGET_TRANSLATE_2ND_ARCH
|
|
|
|
# For binary translation config, by default only install the first arch.
|
|
|
|
define get-32-bit-modules
|
|
|
|
endef
|
|
|
|
|
|
|
|
define get-32-bit-modules-if-we-can
|
|
|
|
$(strip $(1))
|
2014-02-11 07:26:23 +01:00
|
|
|
endef
|
2016-03-17 03:53:19 +01:00
|
|
|
endif # TARGET_TRANSLATE_2ND_ARCH
|
2014-02-11 07:26:23 +01:00
|
|
|
|
2015-08-14 21:59:50 +02:00
|
|
|
# If a module is for a cross host os, the required modules must be for
|
|
|
|
# that OS too.
|
2014-02-11 07:26:23 +01:00
|
|
|
# If a module is built for 32-bit, the required modules must be 32-bit too;
|
|
|
|
# Otherwise if the module is an exectuable or shared library,
|
|
|
|
# the required modules must be 64-bit;
|
|
|
|
# otherwise we require both 64-bit and 32-bit variant, if one exists.
|
|
|
|
$(foreach m,$(ALL_MODULES),\
|
|
|
|
$(eval r := $(ALL_MODULES.$(m).REQUIRED))\
|
|
|
|
$(if $(r),\
|
2015-08-14 21:59:50 +02:00
|
|
|
$(if $(ALL_MODULES.$(m).FOR_HOST_CROSS),\
|
|
|
|
$(eval r := $(addprefix host_cross_,$(r))))\
|
2014-02-11 07:26:23 +01:00
|
|
|
$(if $(ALL_MODULES.$(m).FOR_2ND_ARCH),\
|
|
|
|
$(eval r_r := $(call get-32-bit-modules-if-we-can,$(r))),\
|
Add NATIVE_TESTS class, move host native tests
Host native tests have been getting installed into
out/host/linux-x86/bin/..., but this pollutes the bin directory with a
lot of poorly named tests. Also, to support 32-bit and 64-bit tests, we
need to have different names with different suffixes. This causes
problems when tests expect to be named something specific (like gtest).
It's also convenient to store test data next to the test itself.
So with this change, native tests will be installed in
out/host/linux-x86/nativetest[64]/$(LOCAL_MODULE)/$(LOCAL_MODULE_STEM)
just like target tests get installed into /data/nativetest[64].
Implement this using a new NATIVE_TESTS class, which is like
EXECUTABLES, but sets up the install path differently, and configures
the rpath to load shared libraries with the proper relative path.
LOCAL_MODULE_RELATIVE_PATH can be used to control the directory name, it
will default to $(LOCAL_MODULE). This way multiple related tests can be
grouped together.
Target native tests also use NATIVE_TESTS now, but nothing should change
other than LOCAL_MODULE_RELATIVE_PATH can be used.
Change-Id: I535e42b1a6b21c5b8d6a580aa2f944d2be35e27d
2016-03-02 22:54:51 +01:00
|
|
|
$(if $(filter EXECUTABLES SHARED_LIBRARIES NATIVE_TESTS,$(ALL_MODULES.$(m).CLASS)),\
|
2014-02-11 07:26:23 +01:00
|
|
|
$(eval r_r := $(r)),\
|
|
|
|
$(eval r_r := $(r) $(call get-32-bit-modules,$(r)))\
|
|
|
|
)\
|
|
|
|
)\
|
2014-06-11 04:23:29 +02:00
|
|
|
$(eval ALL_MODULES.$(m).REQUIRED := $(strip $(r_r)))\
|
2014-02-11 07:26:23 +01:00
|
|
|
)\
|
|
|
|
)
|
|
|
|
r_r :=
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
define add-required-deps
|
2013-02-22 23:32:30 +01:00
|
|
|
$(1): | $(2)
|
2009-03-04 04:28:42 +01:00
|
|
|
endef
|
2014-02-11 07:26:23 +01:00
|
|
|
|
2016-10-04 01:49:02 +02:00
|
|
|
# Use a normal dependency instead of an order-only dependency when installing
|
|
|
|
# host dynamic binaries so that the timestamp of the final binary always
|
|
|
|
# changes, even if the toc optimization has skipped relinking the binary
|
|
|
|
# and its dependant shared libraries.
|
|
|
|
define add-required-host-so-deps
|
|
|
|
$(1): $(2)
|
|
|
|
endef
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
$(foreach m,$(ALL_MODULES), \
|
|
|
|
$(eval r := $(ALL_MODULES.$(m).REQUIRED)) \
|
|
|
|
$(if $(r), \
|
|
|
|
$(eval r := $(call module-installed-files,$(r))) \
|
2013-06-07 03:05:53 +02:00
|
|
|
$(eval t_m := $(filter $(TARGET_OUT_ROOT)/%, $(ALL_MODULES.$(m).INSTALLED))) \
|
2016-09-13 22:28:51 +02:00
|
|
|
$(eval h_m := $(filter $(HOST_OUT)/%, $(ALL_MODULES.$(m).INSTALLED))) \
|
|
|
|
$(eval hc_m := $(filter $(HOST_CROSS_OUT)/%, $(ALL_MODULES.$(m).INSTALLED))) \
|
2013-06-07 03:05:53 +02:00
|
|
|
$(eval t_r := $(filter $(TARGET_OUT_ROOT)/%, $(r))) \
|
2016-09-13 22:28:51 +02:00
|
|
|
$(eval h_r := $(filter $(HOST_OUT)/%, $(r))) \
|
|
|
|
$(eval hc_r := $(filter $(HOST_CROSS_OUT)/%, $(r))) \
|
2014-02-01 04:22:35 +01:00
|
|
|
$(eval t_m := $(filter-out $(t_r), $(t_m))) \
|
|
|
|
$(eval h_m := $(filter-out $(h_r), $(h_m))) \
|
2015-08-14 21:59:50 +02:00
|
|
|
$(eval hc_m := $(filter-out $(hc_r), $(hc_m))) \
|
2013-06-07 03:05:53 +02:00
|
|
|
$(if $(t_m), $(eval $(call add-required-deps, $(t_m),$(t_r)))) \
|
|
|
|
$(if $(h_m), $(eval $(call add-required-deps, $(h_m),$(h_r)))) \
|
2015-08-14 21:59:50 +02:00
|
|
|
$(if $(hc_m), $(eval $(call add-required-deps, $(hc_m),$(hc_r)))) \
|
2009-03-04 04:28:42 +01:00
|
|
|
) \
|
|
|
|
)
|
2013-02-22 23:32:30 +01:00
|
|
|
|
2013-06-07 03:05:53 +02:00
|
|
|
t_m :=
|
|
|
|
h_m :=
|
2015-08-14 21:59:50 +02:00
|
|
|
hc_m :=
|
2013-06-07 03:05:53 +02:00
|
|
|
t_r :=
|
|
|
|
h_r :=
|
2015-08-14 21:59:50 +02:00
|
|
|
hc_r :=
|
2013-06-07 03:05:53 +02:00
|
|
|
|
2014-06-10 23:21:20 +02:00
|
|
|
# Establish the dependecies on the shared libraries.
|
|
|
|
# It also adds the shared library module names to ALL_MODULES.$(m).REQUIRED,
|
|
|
|
# so they can be expanded to product_MODULES later.
|
2015-08-14 21:59:50 +02:00
|
|
|
# $(1): TARGET_ or HOST_ or HOST_CROSS_.
|
2014-06-10 23:21:20 +02:00
|
|
|
# $(2): non-empty for 2nd arch.
|
2015-08-14 21:59:50 +02:00
|
|
|
# $(3): non-empty for host cross compile.
|
2014-06-10 23:21:20 +02:00
|
|
|
define resolve-shared-libs-depes
|
|
|
|
$(foreach m,$($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))$(1)DEPENDENCIES_ON_SHARED_LIBRARIES),\
|
|
|
|
$(eval p := $(subst :,$(space),$(m)))\
|
|
|
|
$(eval mod := $(firstword $(p)))\
|
|
|
|
$(eval deps := $(subst $(comma),$(space),$(lastword $(p))))\
|
2016-09-13 22:28:51 +02:00
|
|
|
$(eval root := $(1)OUT$(if $(call streq,$(1),TARGET_),_ROOT))\
|
2014-06-10 23:21:20 +02:00
|
|
|
$(if $(2),$(eval deps := $(addsuffix $($(1)2ND_ARCH_MODULE_SUFFIX),$(deps))))\
|
2015-08-14 21:59:50 +02:00
|
|
|
$(if $(3),$(eval deps := $(addprefix host_cross_,$(deps))))\
|
2016-09-13 22:28:51 +02:00
|
|
|
$(eval r := $(filter $($(root))/%,$(call module-installed-files,\
|
2014-06-10 23:21:20 +02:00
|
|
|
$(deps))))\
|
2016-10-04 01:49:02 +02:00
|
|
|
$(if $(filter $(1),HOST_),\
|
|
|
|
$(eval $(call add-required-host-so-deps,$(word 2,$(p)),$(r))),\
|
|
|
|
$(eval $(call add-required-deps,$(word 2,$(p)),$(r))))\
|
2014-06-10 23:21:20 +02:00
|
|
|
$(eval ALL_MODULES.$(mod).REQUIRED += $(deps)))
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(call resolve-shared-libs-depes,TARGET_)
|
2014-01-16 21:36:34 +01:00
|
|
|
ifdef TARGET_2ND_ARCH
|
2014-06-10 23:21:20 +02:00
|
|
|
$(call resolve-shared-libs-depes,TARGET_,true)
|
2014-01-16 21:36:34 +01:00
|
|
|
endif
|
2014-06-10 23:21:20 +02:00
|
|
|
$(call resolve-shared-libs-depes,HOST_)
|
2014-05-20 23:43:51 +02:00
|
|
|
ifdef HOST_2ND_ARCH
|
2014-06-10 23:21:20 +02:00
|
|
|
$(call resolve-shared-libs-depes,HOST_,true)
|
2014-01-16 21:36:34 +01:00
|
|
|
endif
|
2015-08-14 21:59:50 +02:00
|
|
|
ifdef HOST_CROSS_OS
|
|
|
|
$(call resolve-shared-libs-depes,HOST_CROSS_,,true)
|
|
|
|
endif
|
2013-02-22 23:32:30 +01:00
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
m :=
|
|
|
|
r :=
|
2013-02-22 23:32:30 +01:00
|
|
|
p :=
|
2014-06-10 23:21:20 +02:00
|
|
|
deps :=
|
2009-03-04 04:28:42 +01:00
|
|
|
add-required-deps :=
|
|
|
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
# Figure out our module sets.
|
2012-05-22 23:08:50 +02:00
|
|
|
#
|
2009-03-04 04:28:42 +01:00
|
|
|
# Of the modules defined by the component makefiles,
|
|
|
|
# determine what we actually want to build.
|
|
|
|
|
2014-06-10 23:21:20 +02:00
|
|
|
###########################################################
|
|
|
|
## Expand a module name list with REQUIRED modules
|
|
|
|
###########################################################
|
|
|
|
# $(1): The variable name that holds the initial module name list.
|
|
|
|
# the variable will be modified to hold the expanded results.
|
|
|
|
# $(2): The initial module name list.
|
|
|
|
# Returns empty string (maybe with some whitespaces).
|
|
|
|
define expand-required-modules
|
|
|
|
$(eval _erm_new_modules := $(sort $(filter-out $($(1)),\
|
|
|
|
$(foreach m,$(2),$(ALL_MODULES.$(m).REQUIRED)))))\
|
|
|
|
$(if $(_erm_new_modules),$(eval $(1) += $(_erm_new_modules))\
|
|
|
|
$(call expand-required-modules,$(1),$(_erm_new_modules)))
|
|
|
|
endef
|
|
|
|
|
2009-03-04 04:28:42 +01: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
|
2014-02-11 07:26:23 +01:00
|
|
|
# by product_config.mk.
|
2012-07-12 04:38:48 +02:00
|
|
|
product_MODULES := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES)
|
2012-08-24 00:08:34 +02:00
|
|
|
# Filter out the overridden packages before doing expansion
|
|
|
|
product_MODULES := $(filter-out $(foreach p, $(product_MODULES), \
|
|
|
|
$(PACKAGES.$(p).OVERRIDES)), $(product_MODULES))
|
2014-02-11 07:26:23 +01:00
|
|
|
|
|
|
|
# Resolve the :32 :64 module name
|
|
|
|
modules_32 := $(patsubst %:32,%,$(filter %:32, $(product_MODULES)))
|
|
|
|
modules_64 := $(patsubst %:64,%,$(filter %:64, $(product_MODULES)))
|
|
|
|
modules_rest := $(filter-out %:32 %:64,$(product_MODULES))
|
2014-06-24 19:22:17 +02:00
|
|
|
# Note for 32-bit product, $(modules_32) and $(modules_64) will be
|
|
|
|
# added as their original module names.
|
|
|
|
product_MODULES := $(call get-32-bit-modules-if-we-can, $(modules_32))
|
2014-06-11 04:23:29 +02:00
|
|
|
product_MODULES += $(modules_64)
|
|
|
|
# For the rest we add both
|
|
|
|
product_MODULES += $(call get-32-bit-modules, $(modules_rest))
|
|
|
|
product_MODULES += $(modules_rest)
|
2014-02-11 07:26:23 +01:00
|
|
|
|
2012-07-12 04:38:48 +02:00
|
|
|
$(call expand-required-modules,product_MODULES,$(product_MODULES))
|
2014-06-10 23:21:20 +02:00
|
|
|
|
2012-07-12 04:38:48 +02:00
|
|
|
product_FILES := $(call module-installed-files, $(product_MODULES))
|
2012-05-22 23:08:50 +02:00
|
|
|
ifeq (0,1)
|
2012-07-12 04:38:48 +02:00
|
|
|
$(info product_FILES for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):)
|
|
|
|
$(foreach p,$(product_FILES),$(info : $(p)))
|
2012-05-22 23:08:50 +02:00
|
|
|
$(error done)
|
|
|
|
endif
|
2009-03-04 04:28:42 +01:00
|
|
|
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.
|
2012-07-12 04:38:48 +02:00
|
|
|
product_FILES :=
|
2009-03-04 04:28:42 +01:00
|
|
|
endif
|
|
|
|
|
2012-06-06 00:54:09 +02:00
|
|
|
eng_MODULES := $(sort \
|
|
|
|
$(call get-tagged-modules,eng) \
|
|
|
|
$(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_ENG)) \
|
|
|
|
)
|
|
|
|
debug_MODULES := $(sort \
|
|
|
|
$(call get-tagged-modules,debug) \
|
|
|
|
$(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG)) \
|
|
|
|
)
|
|
|
|
tests_MODULES := $(sort \
|
|
|
|
$(call get-tagged-modules,tests) \
|
|
|
|
$(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS)) \
|
|
|
|
)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2012-05-22 23:08:50 +02:00
|
|
|
# TODO: Remove the 3 places in the tree that use ALL_DEFAULT_INSTALLED_MODULES
|
|
|
|
# and get rid of it from this list.
|
|
|
|
modules_to_install := $(sort \
|
2012-05-23 02:33:22 +02:00
|
|
|
$(ALL_DEFAULT_INSTALLED_MODULES) \
|
2012-07-12 04:38:48 +02:00
|
|
|
$(product_FILES) \
|
2012-05-23 02:33:22 +02:00
|
|
|
$(foreach tag,$(tags_to_install),$($(tag)_MODULES)) \
|
|
|
|
$(CUSTOM_MODULES) \
|
|
|
|
)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
# Some packages may override others using LOCAL_OVERRIDES_PACKAGES.
|
|
|
|
# Filter out (do not install) any overridden packages.
|
2009-03-09 19:52:11 +01:00
|
|
|
overridden_packages := $(call get-package-overrides,$(modules_to_install))
|
2009-03-04 04:28:42 +01:00
|
|
|
ifdef overridden_packages
|
2009-03-09 19:52:11 +01:00
|
|
|
# old_modules_to_install := $(modules_to_install)
|
|
|
|
modules_to_install := \
|
2016-03-11 19:32:01 +01:00
|
|
|
$(filter-out $(foreach p,$(overridden_packages),$(p) %/$(p).apk %/$(p).odex), \
|
2009-03-09 19:52:11 +01:00
|
|
|
$(modules_to_install))
|
2009-03-04 04:28:42 +01:00
|
|
|
endif
|
2009-03-09 19:52:11 +01:00
|
|
|
#$(error filtered out
|
|
|
|
# $(filter-out $(modules_to_install),$(old_modules_to_install)))
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2015-05-16 01:55:30 +02:00
|
|
|
# Don't include any GNU General Public License shared objects or static
|
|
|
|
# libraries in SDK images. GPL executables (not static/dynamic libraries)
|
|
|
|
# are okay if they don't link against any closed source libraries (directly
|
|
|
|
# or indirectly)
|
|
|
|
|
|
|
|
# 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 01:32:16 +02:00
|
|
|
ifdef is_sdk_build
|
2009-03-04 04:28:42 +01:00
|
|
|
target_gnu_MODULES := \
|
|
|
|
$(filter \
|
|
|
|
$(TARGET_OUT_INTERMEDIATES)/% \
|
|
|
|
$(TARGET_OUT)/% \
|
|
|
|
$(TARGET_OUT_DATA)/%, \
|
|
|
|
$(sort $(call get-tagged-modules,gnu)))
|
2015-05-18 21:02:26 +02:00
|
|
|
target_gnu_MODULES := $(filter-out $(TARGET_OUT_EXECUTABLES)/%,$(target_gnu_MODULES))
|
2009-03-04 04:28:42 +01:00
|
|
|
$(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d)))
|
2009-03-09 19:52:11 +01:00
|
|
|
modules_to_install := \
|
|
|
|
$(filter-out $(target_gnu_MODULES),$(modules_to_install))
|
2011-10-08 23:31:54 +02:00
|
|
|
|
2012-06-06 00:54:09 +02:00
|
|
|
# Ensure every module listed in PRODUCT_PACKAGES* gets something installed
|
|
|
|
# TODO: Should we do this for all builds and not just the sdk?
|
2014-02-12 02:28:30 +01:00
|
|
|
dangling_modules :=
|
2011-10-08 23:31:54 +02:00
|
|
|
$(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \
|
2014-06-11 04:23:29 +02:00
|
|
|
$(if $(strip $(ALL_MODULES.$(m).INSTALLED) $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).INSTALLED)),,\
|
2014-02-12 02:28:30 +01:00
|
|
|
$(eval dangling_modules += $(m))))
|
|
|
|
ifneq ($(dangling_modules),)
|
2014-02-18 20:17:53 +01:00
|
|
|
$(warning: Modules '$(dangling_modules)' in PRODUCT_PACKAGES have nothing to install!)
|
2014-02-12 02:28:30 +01:00
|
|
|
endif
|
2012-06-06 00:54:09 +02:00
|
|
|
$(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG), \
|
2012-08-17 09:09:27 +02:00
|
|
|
$(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\
|
2012-08-17 10:26:41 +02:00
|
|
|
$(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_DEBUG has nothing to install!)))
|
2012-06-06 00:54:09 +02:00
|
|
|
$(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_ENG), \
|
2012-08-17 09:09:27 +02:00
|
|
|
$(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\
|
2012-08-17 10:26:41 +02:00
|
|
|
$(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_ENG has nothing to install!)))
|
2012-06-06 00:54:09 +02:00
|
|
|
$(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS), \
|
2012-08-17 09:09:27 +02:00
|
|
|
$(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\
|
2012-08-17 10:26:41 +02:00
|
|
|
$(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_TESTS has nothing to install!)))
|
2009-03-04 04:28:42 +01:00
|
|
|
endif
|
|
|
|
|
2009-07-17 21:33:40 +02:00
|
|
|
# build/core/Makefile contains extra stuff that we don't want to pollute this
|
2009-03-04 04:28:42 +01: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-09 19:52:11 +01:00
|
|
|
ALL_DEFAULT_INSTALLED_MODULES := $(modules_to_install)
|
2009-03-04 04:28:42 +01:00
|
|
|
include $(BUILD_SYSTEM)/Makefile
|
2009-03-09 19:52:11 +01:00
|
|
|
modules_to_install := $(sort $(ALL_DEFAULT_INSTALLED_MODULES))
|
2009-03-04 04:28:42 +01:00
|
|
|
ALL_DEFAULT_INSTALLED_MODULES :=
|
|
|
|
|
2012-05-21 21:16:05 +02:00
|
|
|
|
2009-07-17 21:33:40 +02: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 04:28:42 +01: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.
|
|
|
|
# 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
|
2016-03-23 22:14:35 +01:00
|
|
|
files: $(modules_to_install) \
|
|
|
|
$(INSTALLED_ANDROID_INFO_TXT_TARGET)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
2009-07-17 21:33:40 +02:00
|
|
|
.PHONY: checkbuild
|
2015-09-26 01:43:36 +02:00
|
|
|
checkbuild: $(modules_to_check) droid_targets
|
2016-05-25 21:55:43 +02:00
|
|
|
|
2015-09-26 01:43:36 +02:00
|
|
|
ifeq (true,$(ANDROID_BUILD_EVERYTHING_BY_DEFAULT))
|
2013-02-22 03:41:51 +01:00
|
|
|
droid: checkbuild
|
|
|
|
endif
|
2009-07-17 21:33:40 +02:00
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
.PHONY: ramdisk
|
|
|
|
ramdisk: $(INSTALLED_RAMDISK_TARGET)
|
|
|
|
|
|
|
|
.PHONY: systemtarball
|
|
|
|
systemtarball: $(INSTALLED_SYSTEMTARBALL_TARGET)
|
|
|
|
|
2010-06-05 00:24:49 +02:00
|
|
|
.PHONY: boottarball
|
|
|
|
boottarball: $(INSTALLED_BOOTTARBALL_TARGET)
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
.PHONY: userdataimage
|
|
|
|
userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET)
|
|
|
|
|
2011-02-01 23:52:05 +01:00
|
|
|
ifneq (,$(filter userdataimage, $(MAKECMDGOALS)))
|
|
|
|
$(call dist-for-goals, userdataimage, $(BUILT_USERDATAIMAGE_TARGET))
|
|
|
|
endif
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
.PHONY: userdatatarball
|
|
|
|
userdatatarball: $(INSTALLED_USERDATATARBALL_TARGET)
|
|
|
|
|
2011-11-04 19:37:01 +01:00
|
|
|
.PHONY: cacheimage
|
|
|
|
cacheimage: $(INSTALLED_CACHEIMAGE_TARGET)
|
|
|
|
|
2016-04-08 21:08:03 +02:00
|
|
|
.PHONY: bptimage
|
|
|
|
bptimage: $(INSTALLED_BPTIMAGE_TARGET)
|
|
|
|
|
2013-03-20 19:02:05 +01:00
|
|
|
.PHONY: vendorimage
|
|
|
|
vendorimage: $(INSTALLED_VENDORIMAGE_TARGET)
|
|
|
|
|
2016-06-16 23:47:10 +02:00
|
|
|
.PHONY: systemotherimage
|
|
|
|
systemotherimage: $(INSTALLED_SYSTEMOTHERIMAGE_TARGET)
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
.PHONY: bootimage
|
|
|
|
bootimage: $(INSTALLED_BOOTIMAGE_TARGET)
|
|
|
|
|
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
BUG=31264226
TEST=Manually tested on edison-eng by inspecting {boot, system,
vbmeta}.img in out/ directory as well as their counterparts in
the IMAGES/ directory of edision-target_files-eng.zeuthen.zip
Merged-In: Ic9a61cfc65c148b12996e57f04da5432eef6b982
Change-Id: I97042655bca15e7eac899f12c5bada2f6184d307
2016-09-15 19:43:54 +02:00
|
|
|
.PHONY: vbmetaimage
|
|
|
|
vbmetaimage: $(INSTALLED_VBMETAIMAGE_TARGET)
|
|
|
|
|
2016-08-02 02:41:49 +02:00
|
|
|
.PHONY: auxiliary
|
|
|
|
auxiliary: $(INSTALLED_AUX_TARGETS)
|
2013-02-09 03:01:04 +01:00
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
# Build files and then package it into the rom formats
|
|
|
|
.PHONY: droidcore
|
|
|
|
droidcore: files \
|
|
|
|
systemimage \
|
|
|
|
$(INSTALLED_BOOTIMAGE_TARGET) \
|
|
|
|
$(INSTALLED_RECOVERYIMAGE_TARGET) \
|
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
BUG=31264226
TEST=Manually tested on edison-eng by inspecting {boot, system,
vbmeta}.img in out/ directory as well as their counterparts in
the IMAGES/ directory of edision-target_files-eng.zeuthen.zip
Merged-In: Ic9a61cfc65c148b12996e57f04da5432eef6b982
Change-Id: I97042655bca15e7eac899f12c5bada2f6184d307
2016-09-15 19:43:54 +02:00
|
|
|
$(INSTALLED_VBMETAIMAGE_TARGET) \
|
2009-03-04 04:28:42 +01:00
|
|
|
$(INSTALLED_USERDATAIMAGE_TARGET) \
|
2011-11-04 19:37:01 +01:00
|
|
|
$(INSTALLED_CACHEIMAGE_TARGET) \
|
2016-04-08 21:08:03 +02:00
|
|
|
$(INSTALLED_BPTIMAGE_TARGET) \
|
2013-03-20 19:02:05 +01:00
|
|
|
$(INSTALLED_VENDORIMAGE_TARGET) \
|
2016-06-16 23:47:10 +02:00
|
|
|
$(INSTALLED_SYSTEMOTHERIMAGE_TARGET) \
|
2015-09-15 23:22:12 +02:00
|
|
|
$(INSTALLED_FILES_FILE) \
|
2016-06-16 23:47:10 +02:00
|
|
|
$(INSTALLED_FILES_FILE_VENDOR) \
|
|
|
|
$(INSTALLED_FILES_FILE_SYSTEMOTHER)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2010-12-09 05:07:48 +01:00
|
|
|
# dist_files only for putting your library into the dist directory with a full build.
|
|
|
|
.PHONY: dist_files
|
2010-07-14 06:08:38 +02:00
|
|
|
|
2010-06-10 01:35:58 +02:00
|
|
|
ifneq ($(TARGET_BUILD_APPS),)
|
2010-06-10 03:18:31 +02:00
|
|
|
# If this build is just for apps, only build apps and not the full system by default.
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2010-06-10 01:35:58 +02:00
|
|
|
unbundled_build_modules :=
|
|
|
|
ifneq ($(filter all,$(TARGET_BUILD_APPS)),)
|
2010-06-25 00:08:33 +02: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 01:35:58 +02:00
|
|
|
else
|
|
|
|
unbundled_build_modules := $(TARGET_BUILD_APPS)
|
|
|
|
endif
|
2010-05-11 23:36:32 +02:00
|
|
|
|
2013-06-13 00:25:23 +02:00
|
|
|
# Dist the installed files if they exist.
|
2012-08-15 21:22:44 +02:00
|
|
|
apps_only_installed_files := $(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED))
|
|
|
|
$(call dist-for-goals,apps_only, $(apps_only_installed_files))
|
2013-06-13 00:25:23 +02:00
|
|
|
# For uninstallable modules such as static Java library, we have to dist the built file,
|
|
|
|
# as <module_name>.<suffix>
|
|
|
|
apps_only_dist_built_files := $(foreach m,$(unbundled_build_modules),$(if $(ALL_MODULES.$(m).INSTALLED),,\
|
2014-12-18 02:00:53 +01:00
|
|
|
$(if $(ALL_MODULES.$(m).BUILT),$(ALL_MODULES.$(m).BUILT):$(m)$(suffix $(ALL_MODULES.$(m).BUILT)))\
|
|
|
|
$(if $(ALL_MODULES.$(m).AAR),$(ALL_MODULES.$(m).AAR):$(m).aar)\
|
|
|
|
))
|
2013-06-13 00:25:23 +02:00
|
|
|
$(call dist-for-goals,apps_only, $(apps_only_dist_built_files))
|
2012-08-15 21:22:44 +02:00
|
|
|
|
|
|
|
ifeq ($(EMMA_INSTRUMENT),true)
|
|
|
|
$(EMMA_META_ZIP) : $(apps_only_installed_files)
|
|
|
|
|
|
|
|
$(call dist-for-goals,apps_only, $(EMMA_META_ZIP))
|
|
|
|
endif
|
2010-06-10 01:35:58 +02:00
|
|
|
|
2013-08-23 05:52:47 +02:00
|
|
|
$(PROGUARD_DICT_ZIP) : $(apps_only_installed_files)
|
|
|
|
$(call dist-for-goals,apps_only, $(PROGUARD_DICT_ZIP))
|
|
|
|
|
2014-10-24 20:36:59 +02:00
|
|
|
$(SYMBOLS_ZIP) : $(apps_only_installed_files)
|
|
|
|
$(call dist-for-goals,apps_only, $(SYMBOLS_ZIP))
|
|
|
|
|
2016-09-12 22:56:50 +02:00
|
|
|
$(COVERAGE_ZIP) : $(apps_only_installed_files)
|
|
|
|
$(call dist-for-goals,apps_only, $(COVERAGE_ZIP))
|
|
|
|
|
2010-06-10 03:18:31 +02:00
|
|
|
.PHONY: apps_only
|
|
|
|
apps_only: $(unbundled_build_modules)
|
2010-06-10 01:35:58 +02:00
|
|
|
|
2015-09-26 01:43:36 +02:00
|
|
|
droid_targets: apps_only
|
2010-06-10 03:18:31 +02:00
|
|
|
|
2013-08-23 05:02:03 +02:00
|
|
|
# Combine the NOTICE files for a apps_only build
|
|
|
|
$(eval $(call combine-notice-files, \
|
|
|
|
$(target_notice_file_txt), \
|
|
|
|
$(target_notice_file_html), \
|
|
|
|
"Notices for files for apps:", \
|
|
|
|
$(TARGET_OUT_NOTICE_FILES), \
|
|
|
|
$(apps_only_installed_files)))
|
|
|
|
|
|
|
|
|
2010-06-10 03:18:31 +02:00
|
|
|
else # TARGET_BUILD_APPS
|
|
|
|
$(call dist-for-goals, droidcore, \
|
2010-06-10 01:35:58 +02:00
|
|
|
$(INTERNAL_UPDATE_PACKAGE_TARGET) \
|
|
|
|
$(INTERNAL_OTA_PACKAGE_TARGET) \
|
2015-08-25 02:13:53 +02:00
|
|
|
$(BUILT_OTATOOLS_PACKAGE) \
|
2010-06-10 01:35:58 +02:00
|
|
|
$(SYMBOLS_ZIP) \
|
2016-09-12 22:56:50 +02:00
|
|
|
$(COVERAGE_ZIP) \
|
2010-06-10 01:35:58 +02:00
|
|
|
$(INSTALLED_FILES_FILE) \
|
2015-09-15 23:22:12 +02:00
|
|
|
$(INSTALLED_FILES_FILE_VENDOR) \
|
2016-06-16 23:47:10 +02:00
|
|
|
$(INSTALLED_FILES_FILE_SYSTEMOTHER) \
|
2010-06-10 01:35:58 +02:00
|
|
|
$(INSTALLED_BUILD_PROP_TARGET) \
|
|
|
|
$(BUILT_TARGET_FILES_PACKAGE) \
|
|
|
|
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \
|
2010-07-01 19:07:28 +02:00
|
|
|
$(INSTALLED_RAMDISK_TARGET) \
|
2010-06-10 01:35:58 +02:00
|
|
|
)
|
|
|
|
|
2013-07-26 21:19:20 +02:00
|
|
|
# Put a copy of the radio/bootloader files in the dist dir.
|
|
|
|
$(foreach f,$(INSTALLED_RADIOIMAGE_TARGET), \
|
|
|
|
$(call dist-for-goals, droidcore, $(f)))
|
|
|
|
|
2013-10-02 16:51:11 +02:00
|
|
|
ifneq ($(ANDROID_BUILD_EMBEDDED),true)
|
2012-03-29 23:31:08 +02:00
|
|
|
ifneq ($(TARGET_BUILD_PDK),true)
|
|
|
|
$(call dist-for-goals, droidcore, \
|
|
|
|
$(APPS_ZIP) \
|
|
|
|
$(INTERNAL_EMULATOR_PACKAGE_TARGET) \
|
|
|
|
$(PACKAGE_STATS_FILE) \
|
|
|
|
)
|
|
|
|
endif
|
2013-10-02 16:51:11 +02:00
|
|
|
endif
|
2012-03-29 23:31:08 +02:00
|
|
|
|
2012-08-15 21:22:44 +02:00
|
|
|
ifeq ($(EMMA_INSTRUMENT),true)
|
|
|
|
$(EMMA_META_ZIP) : $(INSTALLED_SYSTEMIMAGE)
|
|
|
|
|
|
|
|
$(call dist-for-goals, dist_files, $(EMMA_META_ZIP))
|
|
|
|
endif
|
|
|
|
|
2010-06-10 03:18:31 +02:00
|
|
|
# Building a full system-- the default is to build droidcore
|
2015-09-26 01:43:36 +02:00
|
|
|
droid_targets: droidcore dist_files
|
2010-05-14 01:46:21 +02:00
|
|
|
|
2010-06-16 00:43:13 +02:00
|
|
|
endif # TARGET_BUILD_APPS
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
.PHONY: docs
|
|
|
|
docs: $(ALL_DOCS)
|
|
|
|
|
|
|
|
.PHONY: sdk
|
|
|
|
ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET)
|
|
|
|
sdk: $(ALL_SDK_TARGETS)
|
2011-02-16 01:09:36 +01:00
|
|
|
$(call dist-for-goals,sdk win_sdk, \
|
2011-03-08 01:13:32 +01:00
|
|
|
$(ALL_SDK_TARGETS) \
|
|
|
|
$(SYMBOLS_ZIP) \
|
2016-09-12 22:56:50 +02:00
|
|
|
$(COVERAGE_ZIP) \
|
2011-03-08 01:13:32 +01:00
|
|
|
$(INSTALLED_BUILD_PROP_TARGET) \
|
|
|
|
)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2013-01-30 01:59:18 +01:00
|
|
|
# umbrella targets to assit engineers in verifying builds
|
2013-01-30 20:22:06 +01:00
|
|
|
.PHONY: java native target host java-host java-target native-host native-target \
|
2013-01-30 01:59:18 +01:00
|
|
|
java-host-tests java-target-tests native-host-tests native-target-tests \
|
2014-05-08 01:39:21 +02:00
|
|
|
java-tests native-tests host-tests target-tests tests
|
2013-01-30 01:59:18 +01:00
|
|
|
# some synonyms
|
|
|
|
.PHONY: host-java target-java host-native target-native \
|
|
|
|
target-java-tests target-native-tests
|
|
|
|
host-java : java-host
|
|
|
|
target-java : java-target
|
|
|
|
host-native : native-host
|
|
|
|
target-native : native-target
|
|
|
|
target-java-tests : java-target-tests
|
|
|
|
target-native-tests : native-target-tests
|
2014-05-08 01:39:21 +02:00
|
|
|
tests : host-tests target-tests
|
2013-01-30 01:59:18 +01:00
|
|
|
|
2016-03-24 19:00:30 +01:00
|
|
|
# Phony target to run all java compilations that use javac instead of jack.
|
|
|
|
.PHONY: javac-check
|
|
|
|
|
2014-02-26 20:55:38 +01:00
|
|
|
ifneq (,$(filter samplecode, $(MAKECMDGOALS)))
|
2010-02-26 05:20:43 +01: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 := \
|
2016-03-23 22:14:35 +01:00
|
|
|
$(filter-out $(modules_to_install) $(modules_to_check),$(sample_MODULES))
|
2010-02-26 05:20:43 +01:00
|
|
|
samplecode: $(sample_APKS_COLLECTION)
|
|
|
|
@echo "Collect sample code apks: $^"
|
|
|
|
# remove apks that are not intended to be installed.
|
|
|
|
rm -f $(sample_ADDITIONAL_INSTALLED)
|
2014-02-26 20:55:38 +01:00
|
|
|
endif # samplecode in $(MAKECMDGOALS)
|
2010-02-26 05:20:43 +01:00
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
.PHONY: findbugs
|
|
|
|
findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2014-03-25 01:24:35 +01:00
|
|
|
@rm -rf $(OUT_DIR)/*
|
2009-03-04 04:28:42 +01:00
|
|
|
@echo "Entire build directory removed."
|
|
|
|
|
2010-09-03 19:25:11 +02:00
|
|
|
.PHONY: clobber
|
|
|
|
clobber: clean
|
|
|
|
|
2009-03-04 04:28:42 +01: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-23 17:11:30 +01:00
|
|
|
tr -s ' ' '\n' | sort -u | $(COLUMN)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
.PHONY: showcommands
|
|
|
|
showcommands:
|
|
|
|
@echo >/dev/null
|
2012-05-19 05:41:38 +02:00
|
|
|
|
|
|
|
.PHONY: nothing
|
|
|
|
nothing:
|
|
|
|
@echo Successfully read the makefiles.
|
2016-04-01 01:30:23 +02:00
|
|
|
|
|
|
|
.PHONY: tidy_only
|
|
|
|
tidy_only:
|
|
|
|
@echo Successfully make tidy_only.
|
|
|
|
|
2016-07-28 06:57:49 +02:00
|
|
|
ndk: $(SOONG_OUT_DIR)/ndk.timestamp
|
|
|
|
.PHONY: ndk
|
|
|
|
|
2016-09-15 06:38:29 +02:00
|
|
|
.PHONY: all_link_types
|
|
|
|
all_link_types:
|
|
|
|
|
2016-01-06 23:28:36 +01:00
|
|
|
endif # KATI
|
2016-09-06 22:19:14 +02:00
|
|
|
endif # USE_SOONG_UI
|