2009-03-04 11:28:42 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2007 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Functions for including AndroidProducts.mk files
|
2012-09-28 04:26:25 +08:00
|
|
|
# PRODUCT_MAKEFILES is set up in AndroidProducts.mks.
|
|
|
|
# Format of PRODUCT_MAKEFILES:
|
|
|
|
# <product_name>:<path_to_the_product_makefile>
|
|
|
|
# If the <product_name> is the same as the base file name (without dir
|
|
|
|
# and the .mk suffix) of the product makefile, "<product_name>:" can be
|
|
|
|
# omitted.
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the list of all AndroidProducts.mk files.
|
|
|
|
# $(call ) isn't necessary.
|
|
|
|
#
|
|
|
|
define _find-android-products-files
|
2018-05-02 13:34:03 +08:00
|
|
|
$(file <$(OUT_DIR)/.module_paths/AndroidProducts.mk.list) \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(SRC_TARGET_DIR)/product/AndroidProducts.mk
|
|
|
|
endef
|
|
|
|
|
2018-04-05 06:41:41 +08:00
|
|
|
#
|
|
|
|
# For entries returned by get-product-makefiles, decode an entry to a short
|
|
|
|
# product name. These either may be in the form of <name>:path/to/file.mk or
|
|
|
|
# path/to/<name>.mk
|
|
|
|
# $(1): The entry to decode
|
|
|
|
#
|
|
|
|
# Returns two words:
|
|
|
|
# <name> <file>
|
|
|
|
#
|
|
|
|
define _decode-product-name
|
|
|
|
$(strip \
|
|
|
|
$(eval _cpm_words := $(subst :,$(space),$(1))) \
|
|
|
|
$(if $(word 2,$(_cpm_words)), \
|
|
|
|
$(wordlist 1,2,$(_cpm_words)), \
|
|
|
|
$(basename $(notdir $(1))) $(1)))
|
|
|
|
endef
|
|
|
|
|
|
|
|
#
|
|
|
|
# Validates the new common lunch choices -- ensures that they're in an
|
|
|
|
# appropriate form, and are paired with definitions of their products.
|
|
|
|
# $(1): The new list of COMMON_LUNCH_CHOICES
|
|
|
|
# $(2): The new list of PRODUCT_MAKEFILES
|
|
|
|
#
|
|
|
|
define _validate-common-lunch-choices
|
|
|
|
$(strip $(foreach choice,$(1),\
|
|
|
|
$(eval _parts := $(subst -,$(space),$(choice))) \
|
|
|
|
$(if $(call math_lt,$(words $(_parts)),2), \
|
|
|
|
$(error $(LOCAL_DIR): $(choice): Invalid lunch choice)) \
|
|
|
|
$(if $(call math_gt_or_eq,$(words $(_parts)),4), \
|
|
|
|
$(error $(LOCAL_DIR): $(choice): Invalid lunch choice)) \
|
|
|
|
$(if $(filter-out eng userdebug user,$(word 2,$(_parts))), \
|
|
|
|
$(error $(LOCAL_DIR): $(choice): Invalid variant: $(word 2,$(_parts)))) \
|
|
|
|
$(if $(filter-out $(foreach p,$(2),$(call _decode-product-name,$(p))),$(word 1,$(_parts))), \
|
|
|
|
$(error $(LOCAL_DIR): $(word 1,$(_parts)): Product not defined in this file)) \
|
|
|
|
))
|
|
|
|
endef
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
#
|
2010-05-11 07:35:39 +08:00
|
|
|
# Returns the sorted concatenation of PRODUCT_MAKEFILES
|
|
|
|
# variables set in the given AndroidProducts.mk files.
|
|
|
|
# $(1): the list of AndroidProducts.mk files.
|
2009-03-04 11:28:42 +08:00
|
|
|
#
|
2018-04-05 06:41:41 +08:00
|
|
|
# As a side-effect, COMMON_LUNCH_CHOICES will be set to a
|
|
|
|
# union of all of the COMMON_LUNCH_CHOICES definitions within
|
|
|
|
# each AndroidProducts.mk file.
|
|
|
|
#
|
2010-05-11 07:35:39 +08:00
|
|
|
define get-product-makefiles
|
2009-03-04 11:28:42 +08:00
|
|
|
$(sort \
|
2018-04-05 06:41:41 +08:00
|
|
|
$(eval _COMMON_LUNCH_CHOICES :=) \
|
2010-05-11 07:35:39 +08:00
|
|
|
$(foreach f,$(1), \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(eval PRODUCT_MAKEFILES :=) \
|
2018-04-05 06:41:41 +08:00
|
|
|
$(eval COMMON_LUNCH_CHOICES :=) \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(eval LOCAL_DIR := $(patsubst %/,%,$(dir $(f)))) \
|
|
|
|
$(eval include $(f)) \
|
2018-04-05 06:41:41 +08:00
|
|
|
$(call _validate-common-lunch-choices,$(COMMON_LUNCH_CHOICES),$(PRODUCT_MAKEFILES)) \
|
|
|
|
$(eval _COMMON_LUNCH_CHOICES += $(COMMON_LUNCH_CHOICES)) \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(PRODUCT_MAKEFILES) \
|
|
|
|
) \
|
|
|
|
$(eval PRODUCT_MAKEFILES :=) \
|
|
|
|
$(eval LOCAL_DIR :=) \
|
2019-02-12 13:31:47 +08:00
|
|
|
$(eval COMMON_LUNCH_CHOICES := $(sort $(_COMMON_LUNCH_CHOICES))) \
|
2018-04-05 06:41:41 +08:00
|
|
|
$(eval _COMMON_LUNCH_CHOICES :=) \
|
2009-03-04 11:28:42 +08:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2010-05-11 07:35:39 +08:00
|
|
|
#
|
|
|
|
# Returns the sorted concatenation of all PRODUCT_MAKEFILES
|
|
|
|
# variables set in all AndroidProducts.mk files.
|
|
|
|
# $(call ) isn't necessary.
|
|
|
|
#
|
|
|
|
define get-all-product-makefiles
|
|
|
|
$(call get-product-makefiles,$(_find-android-products-files))
|
|
|
|
endef
|
|
|
|
|
2019-05-06 21:40:57 +08:00
|
|
|
# Variables that are meant to hold only a single value.
|
|
|
|
# - The value set in the current makefile takes precedence over inherited values
|
|
|
|
# - If multiple inherited makefiles set the var, the first-inherited value wins
|
|
|
|
_product_single_value_vars :=
|
|
|
|
|
|
|
|
# Variables that are lists of values.
|
|
|
|
_product_list_vars :=
|
|
|
|
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_NAME
|
|
|
|
_product_single_value_vars += PRODUCT_MODEL
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# The resoure configuration options to use for this product.
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_LOCALES
|
|
|
|
_product_list_vars += PRODUCT_AAPT_CONFIG
|
|
|
|
_product_list_vars += PRODUCT_AAPT_PREF_CONFIG
|
|
|
|
_product_list_vars += PRODUCT_AAPT_PREBUILT_DPI
|
|
|
|
_product_list_vars += PRODUCT_HOST_PACKAGES
|
|
|
|
_product_list_vars += PRODUCT_PACKAGES
|
|
|
|
_product_list_vars += PRODUCT_PACKAGES_DEBUG
|
|
|
|
_product_list_vars += PRODUCT_PACKAGES_DEBUG_ASAN
|
2019-06-12 01:27:47 +08:00
|
|
|
# Packages included only for eng/userdebug builds, when building with EMMA_INSTRUMENT=true
|
|
|
|
_product_list_vars += PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_PACKAGES_ENG
|
|
|
|
_product_list_vars += PRODUCT_PACKAGES_TESTS
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2019-03-28 22:47:25 +08:00
|
|
|
# The device that this product maps to.
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_DEVICE
|
|
|
|
_product_single_value_vars += PRODUCT_MANUFACTURER
|
|
|
|
_product_single_value_vars += PRODUCT_BRAND
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# These PRODUCT_SYSTEM_* flags, if defined, are used in place of the
|
|
|
|
# corresponding PRODUCT_* flags for the sysprops on /system.
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += \
|
2018-12-21 23:36:00 +08:00
|
|
|
PRODUCT_SYSTEM_NAME \
|
|
|
|
PRODUCT_SYSTEM_MODEL \
|
|
|
|
PRODUCT_SYSTEM_DEVICE \
|
|
|
|
PRODUCT_SYSTEM_BRAND \
|
|
|
|
PRODUCT_SYSTEM_MANUFACTURER \
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# A list of property assignments, like "key = value", with zero or more
|
|
|
|
# whitespace characters on either side of the '='.
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_PROPERTY_OVERRIDES
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# A list of property assignments, like "key = value", with zero or more
|
|
|
|
# whitespace characters on either side of the '='.
|
|
|
|
# used for adding properties to default.prop
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_DEFAULT_PROPERTY_OVERRIDES
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# A list of property assignments, like "key = value", with zero or more
|
|
|
|
# whitespace characters on either side of the '='.
|
|
|
|
# used for adding properties to build.prop of product partition
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_PRODUCT_PROPERTIES
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# A list of property assignments, like "key = value", with zero or more
|
|
|
|
# whitespace characters on either side of the '='.
|
2019-06-25 14:58:13 +08:00
|
|
|
# used for adding properties to build.prop of system_ext and odm partitions
|
|
|
|
_product_list_vars += PRODUCT_SYSTEM_EXT_PROPERTIES
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_ODM_PROPERTIES
|
2019-05-14 01:06:45 +08:00
|
|
|
|
|
|
|
# The characteristics of the product, which among other things is passed to aapt
|
|
|
|
_product_single_value_vars += PRODUCT_CHARACTERISTICS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# A list of words like <source path>:<destination path>[:<owner>].
|
|
|
|
# The file at the source path should be copied to the destination path
|
|
|
|
# when building this product. <destination path> is relative to
|
|
|
|
# $(PRODUCT_OUT), so it should look like, e.g., "system/etc/file.xml".
|
|
|
|
# The rules for these copy steps are defined in build/make/core/Makefile.
|
|
|
|
# The optional :<owner> is used to indicate the owner of a vendor file.
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_COPY_FILES
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# The OTA key(s) specified by the product config, if any. The names
|
|
|
|
# of these keys are stored in the target-files zip so that post-build
|
|
|
|
# signing tools can substitute them for the test key embedded by
|
|
|
|
# default.
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_OTA_PUBLIC_KEYS
|
|
|
|
_product_list_vars += PRODUCT_EXTRA_RECOVERY_KEYS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Should we use the default resources or add any product specific overlays
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_PACKAGE_OVERLAYS
|
|
|
|
_product_list_vars += DEVICE_PACKAGE_OVERLAYS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Resource overlay list which must be excluded from enforcing RRO.
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Package list to apply enforcing RRO.
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_ENFORCE_RRO_TARGETS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_SDK_ATREE_FILES
|
|
|
|
_product_list_vars += PRODUCT_SDK_ADDON_NAME
|
|
|
|
_product_list_vars += PRODUCT_SDK_ADDON_COPY_FILES
|
|
|
|
_product_list_vars += PRODUCT_SDK_ADDON_COPY_MODULES
|
|
|
|
_product_list_vars += PRODUCT_SDK_ADDON_DOC_MODULES
|
|
|
|
_product_list_vars += PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# which Soong namespaces to export to Make
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_SOONG_NAMESPACES
|
2019-03-28 22:47:25 +08:00
|
|
|
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_DEFAULT_WIFI_CHANNELS
|
|
|
|
_product_list_vars += PRODUCT_DEFAULT_DEV_CERTIFICATE
|
|
|
|
_product_list_vars += PRODUCT_RESTRICT_VENDOR_FILES
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# The list of product-specific kernel header dirs
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_VENDOR_KERNEL_HEADERS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# A list of module names of BOOTCLASSPATH (jar files)
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_BOOT_JARS
|
|
|
|
_product_list_vars += PRODUCT_SUPPORTS_BOOT_SIGNER
|
|
|
|
_product_list_vars += PRODUCT_SUPPORTS_VBOOT
|
|
|
|
_product_list_vars += PRODUCT_SUPPORTS_VERITY
|
|
|
|
_product_list_vars += PRODUCT_SUPPORTS_VERITY_FEC
|
|
|
|
_product_list_vars += PRODUCT_OEM_PROPERTIES
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# A list of property assignments, like "key = value", with zero or more
|
|
|
|
# whitespace characters on either side of the '='.
|
|
|
|
# used for adding properties to default.prop of system partition
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_SYSTEM_DEFAULT_PROPERTIES
|
2019-03-28 22:47:25 +08:00
|
|
|
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_SYSTEM_PROPERTY_BLACKLIST
|
|
|
|
_product_list_vars += PRODUCT_VENDOR_PROPERTY_BLACKLIST
|
|
|
|
_product_list_vars += PRODUCT_SYSTEM_SERVER_APPS
|
|
|
|
_product_list_vars += PRODUCT_SYSTEM_SERVER_JARS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# All of the apps that we force preopt, this overrides WITH_DEXPREOPT.
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK
|
|
|
|
_product_list_vars += PRODUCT_DEXPREOPT_SPEED_APPS
|
|
|
|
_product_list_vars += PRODUCT_LOADED_BY_PRIVILEGED_MODULES
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_VBOOT_SIGNING_KEY
|
|
|
|
_product_single_value_vars += PRODUCT_VBOOT_SIGNING_SUBKEY
|
|
|
|
_product_single_value_vars += PRODUCT_VERITY_SIGNING_KEY
|
|
|
|
_product_single_value_vars += PRODUCT_SYSTEM_VERITY_PARTITION
|
|
|
|
_product_single_value_vars += PRODUCT_VENDOR_VERITY_PARTITION
|
|
|
|
_product_single_value_vars += PRODUCT_PRODUCT_VERITY_PARTITION
|
2019-06-25 14:58:13 +08:00
|
|
|
_product_single_value_vars += PRODUCT_SYSTEM_EXT_VERITY_PARTITION
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_ODM_VERITY_PARTITION
|
|
|
|
_product_single_value_vars += PRODUCT_SYSTEM_SERVER_DEBUG_INFO
|
|
|
|
_product_single_value_vars += PRODUCT_OTHER_JAVA_DEBUG_INFO
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Per-module dex-preopt configs.
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_DEX_PREOPT_MODULE_CONFIGS
|
|
|
|
_product_list_vars += PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER
|
|
|
|
_product_list_vars += PRODUCT_DEX_PREOPT_DEFAULT_FLAGS
|
|
|
|
_product_list_vars += PRODUCT_DEX_PREOPT_BOOT_FLAGS
|
|
|
|
_product_list_vars += PRODUCT_DEX_PREOPT_PROFILE_DIR
|
|
|
|
_product_list_vars += PRODUCT_DEX_PREOPT_GENERATE_DM_FILES
|
|
|
|
_product_list_vars += PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING
|
|
|
|
_product_list_vars += PRODUCT_DEX_PREOPT_RESOLVE_STARTUP_STRINGS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Boot image options.
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += \
|
2017-06-29 09:23:37 +08:00
|
|
|
PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE \
|
2019-03-28 22:47:25 +08:00
|
|
|
PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION \
|
2019-05-02 06:34:47 +08:00
|
|
|
PRODUCT_USES_DEFAULT_ART_CONFIG \
|
2019-03-28 22:47:25 +08:00
|
|
|
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_SYSTEM_SERVER_COMPILER_FILTER
|
2019-03-28 22:47:25 +08:00
|
|
|
# Per-module sanitizer configs
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_SANITIZER_MODULE_CONFIGS
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_SYSTEM_BASE_FS_PATH
|
|
|
|
_product_single_value_vars += PRODUCT_VENDOR_BASE_FS_PATH
|
|
|
|
_product_single_value_vars += PRODUCT_PRODUCT_BASE_FS_PATH
|
2019-06-25 14:58:13 +08:00
|
|
|
_product_single_value_vars += PRODUCT_SYSTEM_EXT_BASE_FS_PATH
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_ODM_BASE_FS_PATH
|
|
|
|
|
|
|
|
# The first API level this product shipped with
|
|
|
|
_product_single_value_vars += PRODUCT_SHIPPING_API_LEVEL
|
|
|
|
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += VENDOR_PRODUCT_RESTRICT_VENDOR_FILES
|
|
|
|
_product_list_vars += VENDOR_EXCEPTION_MODULES
|
|
|
|
_product_list_vars += VENDOR_EXCEPTION_PATHS
|
2019-03-28 22:47:25 +08:00
|
|
|
# Whether the product wants to ship libartd. For rules and meaning, see art/Android.mk.
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Make this art variable visible to soong_config.mk.
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_ART_USE_READ_BARRIER
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Add reserved headroom to a system image.
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_SYSTEM_HEADROOM
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Whether to save disk space by minimizing java debug info
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_MINIMIZE_JAVA_DEBUG_INFO
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Whether any paths are excluded from sanitization when SANITIZE_TARGET=integer_overflow
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_ADB_KEYS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Whether any paths should have CFI enabled for components
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_CFI_INCLUDE_PATHS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Whether any paths are excluded from sanitization when SANITIZE_TARGET=cfi
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_CFI_EXCLUDE_PATHS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Whether the Scudo hardened allocator is disabled platform-wide
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_DISABLE_SCUDO
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# A flag to override PRODUCT_COMPATIBLE_PROPERTY
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE
|
2019-03-28 22:47:25 +08:00
|
|
|
|
2019-05-06 16:55:48 +08:00
|
|
|
# List of extra VNDK versions to be included
|
|
|
|
_product_list_vars += PRODUCT_EXTRA_VNDK_VERSIONS
|
|
|
|
|
2019-03-28 22:47:25 +08:00
|
|
|
# Whether the whitelist of actionable compatible properties should be disabled or not
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_ACTIONABLE_COMPATIBLE_PROPERTY_DISABLE
|
|
|
|
|
|
|
|
_product_single_value_vars += PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS
|
|
|
|
_product_single_value_vars += PRODUCT_ENFORCE_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT_WHITELIST
|
|
|
|
_product_list_vars += PRODUCT_ARTIFACT_PATH_REQUIREMENT_HINT
|
|
|
|
_product_list_vars += PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# List of modules that should be forcefully unmarked from being LOCAL_PRODUCT_MODULE, and hence
|
|
|
|
# installed on /system directory by default.
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# When this is true, dynamic partitions is retrofitted on a device that has
|
|
|
|
# already been launched without dynamic partitions. Otherwise, the device
|
|
|
|
# is launched with dynamic partitions.
|
|
|
|
# This flag implies PRODUCT_USE_DYNAMIC_PARTITIONS.
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# Other dynamic partition feature flags.PRODUCT_USE_DYNAMIC_PARTITION_SIZE and
|
|
|
|
# PRODUCT_BUILD_SUPER_PARTITION default to the value of PRODUCT_USE_DYNAMIC_PARTITIONS.
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += \
|
2019-03-28 22:47:25 +08:00
|
|
|
PRODUCT_USE_DYNAMIC_PARTITIONS \
|
2018-08-01 03:47:27 +08:00
|
|
|
PRODUCT_USE_DYNAMIC_PARTITION_SIZE \
|
|
|
|
PRODUCT_BUILD_SUPER_PARTITION \
|
2019-03-28 22:47:25 +08:00
|
|
|
|
|
|
|
# If set, kernel configuration requirements are present in OTA package (and will be enforced
|
|
|
|
# during OTA). Otherwise, kernel configuration requirements are enforced in VTS.
|
|
|
|
# Devices that checks the running kernel (instead of the kernel in OTA package) should not
|
|
|
|
# set this variable to prevent OTA failures.
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS
|
2019-03-28 22:47:25 +08:00
|
|
|
|
2019-04-09 12:11:59 +08:00
|
|
|
# If set to true, this product builds a generic OTA package, which installs generic system images
|
|
|
|
# onto matching devices. The product may only build a subset of system images (e.g. only
|
|
|
|
# system.img), so devices need to install the package in a system-only OTA manner.
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_BUILD_GENERIC_OTA_PACKAGE
|
2019-04-09 12:11:59 +08:00
|
|
|
|
2019-03-28 22:47:25 +08:00
|
|
|
# Whether any paths are excluded from being set XOM when ENABLE_XOM=true
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_XOM_EXCLUDE_PATHS
|
|
|
|
_product_list_vars += PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES
|
|
|
|
_product_list_vars += PRODUCT_PACKAGE_NAME_OVERRIDES
|
|
|
|
_product_list_vars += PRODUCT_CERTIFICATE_OVERRIDES
|
2019-05-06 22:09:19 +08:00
|
|
|
|
|
|
|
# Controls for whether different partitions are built for the current product.
|
|
|
|
_product_single_value_vars += PRODUCT_BUILD_SYSTEM_IMAGE
|
|
|
|
_product_single_value_vars += PRODUCT_BUILD_SYSTEM_OTHER_IMAGE
|
|
|
|
_product_single_value_vars += PRODUCT_BUILD_VENDOR_IMAGE
|
|
|
|
_product_single_value_vars += PRODUCT_BUILD_PRODUCT_IMAGE
|
2019-06-25 14:58:13 +08:00
|
|
|
_product_single_value_vars += PRODUCT_BUILD_SYSTEM_EXT_IMAGE
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_BUILD_ODM_IMAGE
|
|
|
|
_product_single_value_vars += PRODUCT_BUILD_CACHE_IMAGE
|
|
|
|
_product_single_value_vars += PRODUCT_BUILD_RAMDISK_IMAGE
|
|
|
|
_product_single_value_vars += PRODUCT_BUILD_USERDATA_IMAGE
|
2019-04-23 02:09:57 +08:00
|
|
|
_product_single_value_vars += PRODUCT_BUILD_RECOVERY_IMAGE
|
|
|
|
_product_single_value_vars += PRODUCT_BUILD_BOOT_IMAGE
|
2019-05-06 22:09:19 +08:00
|
|
|
|
2019-05-06 21:40:57 +08:00
|
|
|
_product_list_vars += PRODUCT_UPDATABLE_BOOT_MODULES
|
|
|
|
_product_list_vars += PRODUCT_UPDATABLE_BOOT_LOCATIONS
|
2019-04-23 02:09:57 +08:00
|
|
|
|
2019-03-28 22:47:25 +08:00
|
|
|
# Whether the product would like to check prebuilt ELF files.
|
2019-05-06 22:09:19 +08:00
|
|
|
_product_single_value_vars += PRODUCT_CHECK_ELF_FILES
|
2019-05-06 21:40:57 +08:00
|
|
|
|
|
|
|
.KATI_READONLY := _product_single_value_vars _product_list_vars
|
|
|
|
_product_var_list :=$= $(_product_single_value_vars) $(_product_list_vars)
|
2014-10-08 09:07:23 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
define dump-product
|
2019-02-12 05:19:54 +08:00
|
|
|
$(warning ==== $(1) ====)\
|
2009-03-04 11:28:42 +08:00
|
|
|
$(foreach v,$(_product_var_list),\
|
2019-02-12 05:19:54 +08:00
|
|
|
$(warning PRODUCTS.$(1).$(v) := $(PRODUCTS.$(1).$(v))))\
|
|
|
|
$(warning --------)
|
2009-03-04 11:28:42 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define dump-products
|
|
|
|
$(foreach p,$(PRODUCTS),$(call dump-product,$(p)))
|
|
|
|
endef
|
|
|
|
|
2019-03-28 22:47:25 +08:00
|
|
|
#
|
|
|
|
# Functions for including product makefiles
|
|
|
|
#
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
#
|
|
|
|
# $(1): product to inherit
|
|
|
|
#
|
2018-05-31 01:24:41 +08:00
|
|
|
# To be called from product makefiles, and is later evaluated during the import-nodes
|
|
|
|
# call below. It does three things:
|
2009-03-06 06:34:30 +08:00
|
|
|
# 1. Inherits all of the variables from $1.
|
|
|
|
# 2. Records the inheritance in the .INHERITS_FROM variable
|
2018-05-31 01:24:41 +08:00
|
|
|
# 3. Records the calling makefile in PARENT_PRODUCT_FILES
|
|
|
|
#
|
|
|
|
# (2) and (3) can be used together to reconstruct the include hierarchy
|
|
|
|
# See e.g. product-graph.mk for an example of this.
|
2009-03-06 06:34:30 +08:00
|
|
|
#
|
2009-03-04 11:28:42 +08:00
|
|
|
define inherit-product
|
2015-10-29 05:33:40 +08:00
|
|
|
$(if $(findstring ../,$(1)),\
|
|
|
|
$(eval np := $(call normalize-paths,$(1))),\
|
|
|
|
$(eval np := $(strip $(1))))\
|
2009-03-04 11:28:42 +08:00
|
|
|
$(foreach v,$(_product_var_list), \
|
2015-10-29 05:33:40 +08:00
|
|
|
$(eval $(v) := $($(v)) $(INHERIT_TAG)$(np))) \
|
2018-05-31 01:24:41 +08:00
|
|
|
$(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
|
|
|
|
$(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \
|
2015-10-29 05:33:40 +08:00
|
|
|
$(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \
|
2018-05-31 01:24:41 +08:00
|
|
|
$(eval PARENT_PRODUCT_FILES := $(sort $(PARENT_PRODUCT_FILES) $(current_mk)))
|
2009-03-04 11:28:42 +08:00
|
|
|
endef
|
|
|
|
|
2018-06-01 21:18:14 +08:00
|
|
|
# Specifies a number of path prefixes, relative to PRODUCT_OUT, where the
|
|
|
|
# product makefile hierarchy rooted in the current node places its artifacts.
|
|
|
|
# Creating artifacts outside the specified paths will cause a build-time error.
|
|
|
|
define require-artifacts-in-path
|
|
|
|
$(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
|
|
|
|
$(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENTS := $(strip $(1))) \
|
|
|
|
$(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_WHITELIST := $(strip $(2))) \
|
|
|
|
$(eval ARTIFACT_PATH_REQUIREMENT_PRODUCTS := \
|
|
|
|
$(sort $(ARTIFACT_PATH_REQUIREMENT_PRODUCTS) $(current_mk)))
|
|
|
|
endef
|
2010-02-23 02:33:05 +08:00
|
|
|
|
2018-07-05 00:17:23 +08:00
|
|
|
# Makes including non-existant modules in PRODUCT_PACKAGES an error.
|
|
|
|
# $(1): whitelist of non-existant modules to allow.
|
|
|
|
define enforce-product-packages-exist
|
|
|
|
$(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
|
|
|
|
$(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST := true) \
|
|
|
|
$(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_WHITELIST := $(1)) \
|
|
|
|
$(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST) \
|
|
|
|
$(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_WHITELIST)
|
|
|
|
endef
|
|
|
|
|
2010-02-23 02:33:05 +08:00
|
|
|
#
|
|
|
|
# Do inherit-product only if $(1) exists
|
|
|
|
#
|
|
|
|
define inherit-product-if-exists
|
|
|
|
$(if $(wildcard $(1)),$(call inherit-product,$(1)),)
|
|
|
|
endef
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
#
|
|
|
|
# $(1): product makefile list
|
|
|
|
#
|
|
|
|
#TODO: check to make sure that products have all the necessary vars defined
|
|
|
|
define import-products
|
2019-05-06 21:40:57 +08:00
|
|
|
$(call import-nodes,PRODUCTS,$(1),$(_product_var_list),$(_product_single_value_vars))
|
2009-03-04 11:28:42 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Does various consistency checks on all of the known products.
|
|
|
|
# Takes no parameters, so $(call ) is not necessary.
|
|
|
|
#
|
|
|
|
define check-all-products
|
|
|
|
$(if ,, \
|
|
|
|
$(eval _cap_names :=) \
|
|
|
|
$(foreach p,$(PRODUCTS), \
|
|
|
|
$(eval pn := $(strip $(PRODUCTS.$(p).PRODUCT_NAME))) \
|
|
|
|
$(if $(pn),,$(error $(p): PRODUCT_NAME must be defined.)) \
|
|
|
|
$(if $(filter $(pn),$(_cap_names)), \
|
|
|
|
$(error $(p): PRODUCT_NAME must be unique; "$(pn)" already used by $(strip \
|
|
|
|
$(foreach \
|
|
|
|
pp,$(PRODUCTS),
|
|
|
|
$(if $(filter $(pn),$(PRODUCTS.$(pp).PRODUCT_NAME)), \
|
|
|
|
$(pp) \
|
|
|
|
))) \
|
|
|
|
) \
|
|
|
|
) \
|
|
|
|
$(eval _cap_names += $(pn)) \
|
|
|
|
$(if $(call is-c-identifier,$(pn)),, \
|
|
|
|
$(error $(p): PRODUCT_NAME must be a valid C identifier, not "$(pn)") \
|
|
|
|
) \
|
|
|
|
$(eval pb := $(strip $(PRODUCTS.$(p).PRODUCT_BRAND))) \
|
|
|
|
$(if $(pb),,$(error $(p): PRODUCT_BRAND must be defined.)) \
|
|
|
|
$(foreach cf,$(strip $(PRODUCTS.$(p).PRODUCT_COPY_FILES)), \
|
2012-09-21 07:35:36 +08:00
|
|
|
$(if $(filter 2 3,$(words $(subst :,$(space),$(cf)))),, \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(error $(p): malformed COPY_FILE "$(cf)") \
|
|
|
|
) \
|
|
|
|
) \
|
|
|
|
) \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the product makefile path for the product with the provided name
|
|
|
|
#
|
|
|
|
# $(1): short product name like "generic"
|
|
|
|
#
|
|
|
|
define _resolve-short-product-name
|
|
|
|
$(eval pn := $(strip $(1)))
|
|
|
|
$(eval p := \
|
|
|
|
$(foreach p,$(PRODUCTS), \
|
|
|
|
$(if $(filter $(pn),$(PRODUCTS.$(p).PRODUCT_NAME)), \
|
|
|
|
$(p) \
|
|
|
|
)) \
|
|
|
|
)
|
|
|
|
$(eval p := $(sort $(p)))
|
|
|
|
$(if $(filter 1,$(words $(p))), \
|
|
|
|
$(p), \
|
|
|
|
$(if $(filter 0,$(words $(p))), \
|
|
|
|
$(error No matches for product "$(pn)"), \
|
|
|
|
$(error Product "$(pn)" ambiguous: matches $(p)) \
|
|
|
|
) \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
define resolve-short-product-name
|
|
|
|
$(strip $(call _resolve-short-product-name,$(1)))
|
|
|
|
endef
|
2010-09-15 01:09:48 +08:00
|
|
|
|
2019-03-28 22:47:25 +08:00
|
|
|
# BoardConfig variables that are also inherited in product mks. Should ideally
|
|
|
|
# be cleaned up to not be product variables.
|
|
|
|
_readonly_late_variables := \
|
|
|
|
DEVICE_PACKAGE_OVERLAYS \
|
|
|
|
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY \
|
|
|
|
|
|
|
|
# Modified internally in the build system
|
|
|
|
_readonly_late_variables += \
|
|
|
|
PRODUCT_COPY_FILES \
|
|
|
|
PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING \
|
|
|
|
PRODUCT_DEX_PREOPT_BOOT_FLAGS \
|
|
|
|
|
|
|
|
_readonly_early_variables := $(filter-out $(_readonly_late_variables),$(_product_var_list))
|
2018-11-28 03:37:38 +08:00
|
|
|
|
2010-09-15 01:09:48 +08:00
|
|
|
#
|
2016-10-06 07:57:27 +08:00
|
|
|
# Mark the variables in _product_stash_var_list as readonly
|
2010-09-15 01:09:48 +08:00
|
|
|
#
|
2019-03-28 22:47:25 +08:00
|
|
|
define readonly-variables
|
|
|
|
$(foreach v,$(1), \
|
2019-02-21 18:41:03 +08:00
|
|
|
$(eval $(v) ?=) \
|
|
|
|
$(eval .KATI_READONLY := $(v)) \
|
2010-09-15 01:09:48 +08:00
|
|
|
)
|
|
|
|
endef
|
2019-03-28 22:47:25 +08:00
|
|
|
define readonly-product-vars
|
|
|
|
$(call readonly-variables,$(_readonly_early_variables))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define readonly-final-product-vars
|
|
|
|
$(call readonly-variables,$(_readonly_late_variables))
|
|
|
|
endef
|
2010-09-15 01:09:48 +08:00
|
|
|
|
2018-11-28 03:37:38 +08:00
|
|
|
#
|
2019-06-26 01:57:57 +08:00
|
|
|
# Strip the variables in _product_var_list and a few build-system
|
|
|
|
# internal variables, and assign the ones for the current product
|
|
|
|
# to a shorthand that is more convenient to read from elsewhere.
|
2018-11-28 03:37:38 +08:00
|
|
|
#
|
|
|
|
define strip-product-vars
|
2019-06-26 01:57:57 +08:00
|
|
|
$(foreach v,\
|
|
|
|
$(_product_var_list) \
|
|
|
|
PRODUCT_ENFORCE_PACKAGES_EXIST \
|
|
|
|
PRODUCT_ENFORCE_PACKAGES_EXIST_WHITELIST, \
|
2019-03-28 22:47:25 +08:00
|
|
|
$(eval $(v) := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).$(v)))) \
|
|
|
|
)
|
2018-11-28 03:37:38 +08:00
|
|
|
endef
|
|
|
|
|
2012-05-31 01:22:29 +08:00
|
|
|
define add-to-product-copy-files-if-exists
|
|
|
|
$(if $(wildcard $(word 1,$(subst :, ,$(1)))),$(1))
|
|
|
|
endef
|
2014-10-08 09:07:23 +08:00
|
|
|
|
|
|
|
# whitespace placeholder when we record module's dex-preopt config.
|
|
|
|
_PDPMC_SP_PLACE_HOLDER := |@SP@|
|
|
|
|
# Set up dex-preopt config for a module.
|
|
|
|
# $(1) list of module names
|
|
|
|
# $(2) the modules' dex-preopt config
|
|
|
|
define add-product-dex-preopt-module-config
|
|
|
|
$(eval _c := $(subst $(space),$(_PDPMC_SP_PLACE_HOLDER),$(strip $(2))))\
|
|
|
|
$(eval PRODUCT_DEX_PREOPT_MODULE_CONFIGS += \
|
|
|
|
$(foreach m,$(1),$(m)=$(_c)))
|
|
|
|
endef
|
2016-06-28 06:15:31 +08:00
|
|
|
|
|
|
|
# whitespace placeholder when we record module's sanitizer config.
|
|
|
|
_PSMC_SP_PLACE_HOLDER := |@SP@|
|
|
|
|
# Set up sanitizer config for a module.
|
|
|
|
# $(1) list of module names
|
|
|
|
# $(2) the modules' sanitizer config
|
|
|
|
define add-product-sanitizer-module-config
|
|
|
|
$(eval _c := $(subst $(space),$(_PSMC_SP_PLACE_HOLDER),$(strip $(2))))\
|
|
|
|
$(eval PRODUCT_SANITIZER_MODULE_CONFIGS += \
|
|
|
|
$(foreach m,$(1),$(m)=$(_c)))
|
|
|
|
endef
|