2009-03-04 04:28:42 +01: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-27 22:26:25 +02: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 04:28:42 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the list of all AndroidProducts.mk files.
|
|
|
|
# $(call ) isn't necessary.
|
|
|
|
#
|
|
|
|
define _find-android-products-files
|
2018-05-02 07:34:03 +02:00
|
|
|
$(file <$(OUT_DIR)/.module_paths/AndroidProducts.mk.list) \
|
2009-03-04 04:28:42 +01:00
|
|
|
$(SRC_TARGET_DIR)/product/AndroidProducts.mk
|
|
|
|
endef
|
|
|
|
|
2018-04-05 00:41:41 +02: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 04:28:42 +01:00
|
|
|
#
|
2010-05-11 01:35:39 +02: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 04:28:42 +01:00
|
|
|
#
|
2018-04-05 00:41:41 +02: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 01:35:39 +02:00
|
|
|
define get-product-makefiles
|
2009-03-04 04:28:42 +01:00
|
|
|
$(sort \
|
2018-04-05 00:41:41 +02:00
|
|
|
$(eval _COMMON_LUNCH_CHOICES :=) \
|
2010-05-11 01:35:39 +02:00
|
|
|
$(foreach f,$(1), \
|
2009-03-04 04:28:42 +01:00
|
|
|
$(eval PRODUCT_MAKEFILES :=) \
|
2018-04-05 00:41:41 +02:00
|
|
|
$(eval COMMON_LUNCH_CHOICES :=) \
|
2009-03-04 04:28:42 +01:00
|
|
|
$(eval LOCAL_DIR := $(patsubst %/,%,$(dir $(f)))) \
|
|
|
|
$(eval include $(f)) \
|
2018-04-05 00:41:41 +02:00
|
|
|
$(call _validate-common-lunch-choices,$(COMMON_LUNCH_CHOICES),$(PRODUCT_MAKEFILES)) \
|
|
|
|
$(eval _COMMON_LUNCH_CHOICES += $(COMMON_LUNCH_CHOICES)) \
|
2009-03-04 04:28:42 +01:00
|
|
|
$(PRODUCT_MAKEFILES) \
|
|
|
|
) \
|
|
|
|
$(eval PRODUCT_MAKEFILES :=) \
|
|
|
|
$(eval LOCAL_DIR :=) \
|
2018-04-05 00:41:41 +02:00
|
|
|
$(eval COMMON_LUNCH_CHOICES := $(sort $(_COMMON_LUNCH_CHOICES) $(LUNCH_MENU_CHOICES))) \
|
|
|
|
$(eval _COMMON_LUNCH_CHOICES :=) \
|
2009-03-04 04:28:42 +01:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2010-05-11 01:35:39 +02: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
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
#
|
|
|
|
# Functions for including product makefiles
|
|
|
|
#
|
|
|
|
|
|
|
|
_product_var_list := \
|
|
|
|
PRODUCT_NAME \
|
|
|
|
PRODUCT_MODEL \
|
|
|
|
PRODUCT_LOCALES \
|
2011-03-15 21:19:30 +01:00
|
|
|
PRODUCT_AAPT_CONFIG \
|
2011-10-15 04:37:57 +02:00
|
|
|
PRODUCT_AAPT_PREF_CONFIG \
|
2014-12-10 21:40:09 +01:00
|
|
|
PRODUCT_AAPT_PREBUILT_DPI \
|
2009-03-04 04:28:42 +01:00
|
|
|
PRODUCT_PACKAGES \
|
2012-06-06 00:54:09 +02:00
|
|
|
PRODUCT_PACKAGES_DEBUG \
|
2018-03-26 23:17:03 +02:00
|
|
|
PRODUCT_PACKAGES_DEBUG_ASAN \
|
2012-06-06 00:54:09 +02:00
|
|
|
PRODUCT_PACKAGES_ENG \
|
|
|
|
PRODUCT_PACKAGES_TESTS \
|
2009-03-04 04:28:42 +01:00
|
|
|
PRODUCT_DEVICE \
|
|
|
|
PRODUCT_MANUFACTURER \
|
|
|
|
PRODUCT_BRAND \
|
|
|
|
PRODUCT_PROPERTY_OVERRIDES \
|
2011-06-09 23:54:40 +02:00
|
|
|
PRODUCT_DEFAULT_PROPERTY_OVERRIDES \
|
2017-11-27 09:04:47 +01:00
|
|
|
PRODUCT_PRODUCT_PROPERTIES \
|
2018-05-29 14:09:01 +02:00
|
|
|
PRODUCT_PRODUCT_SERVICES_PROPERTIES \
|
2010-10-05 23:33:58 +02:00
|
|
|
PRODUCT_CHARACTERISTICS \
|
2009-03-04 04:28:42 +01:00
|
|
|
PRODUCT_COPY_FILES \
|
|
|
|
PRODUCT_OTA_PUBLIC_KEYS \
|
2011-03-16 15:49:13 +01:00
|
|
|
PRODUCT_EXTRA_RECOVERY_KEYS \
|
2009-03-04 04:28:42 +01:00
|
|
|
PRODUCT_PACKAGE_OVERLAYS \
|
|
|
|
DEVICE_PACKAGE_OVERLAYS \
|
2017-09-01 10:23:25 +02:00
|
|
|
PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS \
|
2017-03-30 04:25:02 +02:00
|
|
|
PRODUCT_ENFORCE_RRO_TARGETS \
|
2014-01-29 22:35:55 +01:00
|
|
|
PRODUCT_SDK_ATREE_FILES \
|
2009-04-10 05:36:06 +02:00
|
|
|
PRODUCT_SDK_ADDON_NAME \
|
|
|
|
PRODUCT_SDK_ADDON_COPY_FILES \
|
|
|
|
PRODUCT_SDK_ADDON_COPY_MODULES \
|
2011-11-11 19:52:12 +01:00
|
|
|
PRODUCT_SDK_ADDON_DOC_MODULES \
|
2014-08-22 00:22:08 +02:00
|
|
|
PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP \
|
2017-11-22 00:05:07 +01:00
|
|
|
PRODUCT_SOONG_NAMESPACES \
|
2011-10-04 19:50:08 +02:00
|
|
|
PRODUCT_DEFAULT_WIFI_CHANNELS \
|
|
|
|
PRODUCT_DEFAULT_DEV_CERTIFICATE \
|
2011-12-10 00:11:57 +01:00
|
|
|
PRODUCT_RESTRICT_VENDOR_FILES \
|
2012-03-16 17:57:11 +01:00
|
|
|
PRODUCT_VENDOR_KERNEL_HEADERS \
|
2013-06-17 02:26:08 +02:00
|
|
|
PRODUCT_BOOT_JARS \
|
2015-04-07 16:08:59 +02:00
|
|
|
PRODUCT_SUPPORTS_BOOT_SIGNER \
|
2015-03-03 17:54:11 +01:00
|
|
|
PRODUCT_SUPPORTS_VBOOT \
|
2013-06-17 02:26:08 +02:00
|
|
|
PRODUCT_SUPPORTS_VERITY \
|
2015-05-20 08:30:57 +02:00
|
|
|
PRODUCT_SUPPORTS_VERITY_FEC \
|
2014-03-19 01:20:10 +01:00
|
|
|
PRODUCT_OEM_PROPERTIES \
|
2017-11-03 07:18:55 +01:00
|
|
|
PRODUCT_SYSTEM_DEFAULT_PROPERTIES \
|
2014-03-19 01:20:10 +01:00
|
|
|
PRODUCT_SYSTEM_PROPERTY_BLACKLIST \
|
2018-03-29 16:22:33 +02:00
|
|
|
PRODUCT_VENDOR_PROPERTY_BLACKLIST \
|
2017-03-22 13:36:05 +01:00
|
|
|
PRODUCT_SYSTEM_SERVER_APPS \
|
2014-08-05 15:51:08 +02:00
|
|
|
PRODUCT_SYSTEM_SERVER_JARS \
|
2017-09-15 22:40:48 +02:00
|
|
|
PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK \
|
2017-06-12 16:19:16 +02:00
|
|
|
PRODUCT_DEXPREOPT_SPEED_APPS \
|
2017-09-19 14:10:31 +02:00
|
|
|
PRODUCT_LOADED_BY_PRIVILEGED_MODULES \
|
2015-03-03 17:54:11 +01:00
|
|
|
PRODUCT_VBOOT_SIGNING_KEY \
|
2015-08-07 20:58:05 +02:00
|
|
|
PRODUCT_VBOOT_SIGNING_SUBKEY \
|
2014-05-06 07:19:37 +02:00
|
|
|
PRODUCT_VERITY_SIGNING_KEY \
|
2014-07-11 00:42:38 +02:00
|
|
|
PRODUCT_SYSTEM_VERITY_PARTITION \
|
2014-10-10 04:29:53 +02:00
|
|
|
PRODUCT_VENDOR_VERITY_PARTITION \
|
2017-11-27 09:04:47 +01:00
|
|
|
PRODUCT_PRODUCT_VERITY_PARTITION \
|
2018-05-29 14:09:01 +02:00
|
|
|
PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION \
|
2017-06-23 23:47:56 +02:00
|
|
|
PRODUCT_SYSTEM_SERVER_DEBUG_INFO \
|
2018-03-19 22:28:15 +01:00
|
|
|
PRODUCT_OTHER_JAVA_DEBUG_INFO \
|
2014-10-08 03:07:23 +02:00
|
|
|
PRODUCT_DEX_PREOPT_MODULE_CONFIGS \
|
2018-02-15 22:19:38 +01:00
|
|
|
PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER \
|
2014-10-08 03:07:23 +02:00
|
|
|
PRODUCT_DEX_PREOPT_DEFAULT_FLAGS \
|
|
|
|
PRODUCT_DEX_PREOPT_BOOT_FLAGS \
|
2017-05-06 02:22:37 +02:00
|
|
|
PRODUCT_DEX_PREOPT_PROFILE_DIR \
|
2017-06-29 03:23:37 +02:00
|
|
|
PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION \
|
2018-02-15 22:19:38 +01:00
|
|
|
PRODUCT_DEX_PREOPT_GENERATE_DM_FILES \
|
2017-06-29 03:23:37 +02:00
|
|
|
PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE \
|
2017-06-23 19:44:45 +02:00
|
|
|
PRODUCT_SYSTEM_SERVER_COMPILER_FILTER \
|
2016-06-28 00:15:31 +02:00
|
|
|
PRODUCT_SANITIZER_MODULE_CONFIGS \
|
2016-04-23 02:22:07 +02:00
|
|
|
PRODUCT_SYSTEM_BASE_FS_PATH \
|
|
|
|
PRODUCT_VENDOR_BASE_FS_PATH \
|
2017-11-27 09:04:47 +01:00
|
|
|
PRODUCT_PRODUCT_BASE_FS_PATH \
|
2018-05-29 14:09:01 +02:00
|
|
|
PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH \
|
2016-05-27 15:07:54 +02:00
|
|
|
PRODUCT_SHIPPING_API_LEVEL \
|
2016-05-20 13:08:30 +02:00
|
|
|
VENDOR_PRODUCT_RESTRICT_VENDOR_FILES \
|
|
|
|
VENDOR_EXCEPTION_MODULES \
|
|
|
|
VENDOR_EXCEPTION_PATHS \
|
2017-06-30 20:36:26 +02:00
|
|
|
PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD \
|
2016-12-16 01:00:41 +01:00
|
|
|
PRODUCT_ART_USE_READ_BARRIER \
|
2017-03-03 07:08:41 +01:00
|
|
|
PRODUCT_IOT \
|
2017-05-03 22:43:27 +02:00
|
|
|
PRODUCT_SYSTEM_HEADROOM \
|
2017-06-30 15:51:12 +02:00
|
|
|
PRODUCT_MINIMIZE_JAVA_DEBUG_INFO \
|
2017-07-13 23:49:12 +02:00
|
|
|
PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS \
|
2017-11-03 23:53:52 +01:00
|
|
|
PRODUCT_ADB_KEYS \
|
2017-10-31 10:25:16 +01:00
|
|
|
PRODUCT_CFI_INCLUDE_PATHS \
|
|
|
|
PRODUCT_CFI_EXCLUDE_PATHS \
|
2018-01-16 06:14:59 +01:00
|
|
|
PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE \
|
|
|
|
PRODUCT_ACTIONABLE_COMPATIBLE_PROPERTY_DISABLE \
|
2018-05-19 02:46:04 +02:00
|
|
|
PRODUCT_USE_LOGICAL_PARTITIONS \
|
2018-06-05 18:53:09 +02:00
|
|
|
PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS \
|
|
|
|
PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST \
|
2014-10-08 03:07:23 +02:00
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
define dump-product
|
|
|
|
$(info ==== $(1) ====)\
|
|
|
|
$(foreach v,$(_product_var_list),\
|
|
|
|
$(info PRODUCTS.$(1).$(v) := $(PRODUCTS.$(1).$(v))))\
|
|
|
|
$(info --------)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define dump-products
|
|
|
|
$(foreach p,$(PRODUCTS),$(call dump-product,$(p)))
|
|
|
|
endef
|
|
|
|
|
|
|
|
#
|
|
|
|
# $(1): product to inherit
|
|
|
|
#
|
2018-05-30 19:24:41 +02:00
|
|
|
# To be called from product makefiles, and is later evaluated during the import-nodes
|
|
|
|
# call below. It does three things:
|
2009-03-05 23:34:30 +01:00
|
|
|
# 1. Inherits all of the variables from $1.
|
|
|
|
# 2. Records the inheritance in the .INHERITS_FROM variable
|
2018-05-30 19:24:41 +02: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-05 23:34:30 +01:00
|
|
|
#
|
2009-03-04 04:28:42 +01:00
|
|
|
define inherit-product
|
2015-10-28 22:33:40 +01:00
|
|
|
$(if $(findstring ../,$(1)),\
|
|
|
|
$(eval np := $(call normalize-paths,$(1))),\
|
|
|
|
$(eval np := $(strip $(1))))\
|
2009-03-04 04:28:42 +01:00
|
|
|
$(foreach v,$(_product_var_list), \
|
2015-10-28 22:33:40 +01:00
|
|
|
$(eval $(v) := $($(v)) $(INHERIT_TAG)$(np))) \
|
2018-05-30 19:24:41 +02:00
|
|
|
$(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
|
|
|
|
$(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \
|
2015-10-28 22:33:40 +01:00
|
|
|
$(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \
|
2018-05-30 19:24:41 +02:00
|
|
|
$(eval PARENT_PRODUCT_FILES := $(sort $(PARENT_PRODUCT_FILES) $(current_mk)))
|
2009-03-04 04:28:42 +01:00
|
|
|
endef
|
|
|
|
|
2018-06-01 15:18:14 +02: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-22 19:33:05 +01:00
|
|
|
|
2018-07-04 18:17:23 +02: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-22 19:33:05 +01:00
|
|
|
#
|
|
|
|
# Do inherit-product only if $(1) exists
|
|
|
|
#
|
|
|
|
define inherit-product-if-exists
|
|
|
|
$(if $(wildcard $(1)),$(call inherit-product,$(1)),)
|
|
|
|
endef
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
#
|
|
|
|
# $(1): product makefile list
|
|
|
|
#
|
|
|
|
#TODO: check to make sure that products have all the necessary vars defined
|
|
|
|
define import-products
|
|
|
|
$(call import-nodes,PRODUCTS,$(1),$(_product_var_list))
|
|
|
|
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 01:35:36 +02:00
|
|
|
$(if $(filter 2 3,$(words $(subst :,$(space),$(cf)))),, \
|
2009-03-04 04:28:42 +01: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-14 19:09:48 +02:00
|
|
|
|
|
|
|
|
2010-12-29 23:07:38 +01:00
|
|
|
_product_stash_var_list := $(_product_var_list) \
|
2013-07-24 02:57:38 +02:00
|
|
|
PRODUCT_BOOTCLASSPATH \
|
2014-08-05 15:51:08 +02:00
|
|
|
PRODUCT_SYSTEM_SERVER_CLASSPATH \
|
2010-12-29 23:07:38 +01:00
|
|
|
TARGET_ARCH \
|
|
|
|
TARGET_ARCH_VARIANT \
|
2013-01-15 23:36:42 +01:00
|
|
|
TARGET_CPU_VARIANT \
|
2010-12-29 23:07:38 +01:00
|
|
|
TARGET_BOARD_PLATFORM \
|
|
|
|
TARGET_BOARD_PLATFORM_GPU \
|
2012-03-16 17:57:11 +01:00
|
|
|
TARGET_BOARD_KERNEL_HEADERS \
|
|
|
|
TARGET_DEVICE_KERNEL_HEADERS \
|
|
|
|
TARGET_PRODUCT_KERNEL_HEADERS \
|
2010-12-29 23:07:38 +01:00
|
|
|
TARGET_BOOTLOADER_BOARD_NAME \
|
|
|
|
TARGET_NO_BOOTLOADER \
|
|
|
|
TARGET_NO_KERNEL \
|
|
|
|
TARGET_NO_RECOVERY \
|
|
|
|
TARGET_NO_RADIOIMAGE \
|
|
|
|
TARGET_HARDWARE_3D \
|
|
|
|
TARGET_CPU_ABI \
|
|
|
|
TARGET_CPU_ABI2 \
|
|
|
|
|
|
|
|
|
|
|
|
_product_stash_var_list += \
|
|
|
|
BOARD_WPA_SUPPLICANT_DRIVER \
|
|
|
|
BOARD_WLAN_DEVICE \
|
|
|
|
BOARD_USES_GENERIC_AUDIO \
|
|
|
|
BOARD_KERNEL_CMDLINE \
|
|
|
|
BOARD_KERNEL_BASE \
|
|
|
|
BOARD_HAVE_BLUETOOTH \
|
|
|
|
BOARD_VENDOR_USE_AKMD \
|
|
|
|
BOARD_EGL_CFG \
|
|
|
|
BOARD_BOOTIMAGE_PARTITION_SIZE \
|
|
|
|
BOARD_RECOVERYIMAGE_PARTITION_SIZE \
|
|
|
|
BOARD_SYSTEMIMAGE_PARTITION_SIZE \
|
2015-03-03 21:30:37 +01:00
|
|
|
BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE \
|
2014-06-16 23:17:40 +02:00
|
|
|
BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE \
|
2010-12-29 23:07:38 +01:00
|
|
|
BOARD_USERDATAIMAGE_PARTITION_SIZE \
|
2011-11-04 19:37:01 +01:00
|
|
|
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE \
|
|
|
|
BOARD_CACHEIMAGE_PARTITION_SIZE \
|
2010-12-29 23:07:38 +01:00
|
|
|
BOARD_FLASH_BLOCK_SIZE \
|
2014-05-28 22:51:53 +02:00
|
|
|
BOARD_VENDORIMAGE_PARTITION_SIZE \
|
|
|
|
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE \
|
2017-11-27 09:04:47 +01:00
|
|
|
BOARD_PRODUCTIMAGE_PARTITION_SIZE \
|
|
|
|
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE \
|
2018-05-29 14:09:01 +02:00
|
|
|
BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE \
|
|
|
|
BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE \
|
2010-12-29 23:07:38 +01:00
|
|
|
BOARD_INSTALLER_CMDLINE \
|
|
|
|
|
|
|
|
|
2011-10-04 19:50:08 +02:00
|
|
|
_product_stash_var_list += \
|
2014-05-02 05:55:30 +02:00
|
|
|
DEFAULT_SYSTEM_DEV_CERTIFICATE \
|
2014-08-05 02:09:41 +02:00
|
|
|
WITH_DEXPREOPT \
|
2018-03-06 22:09:01 +01:00
|
|
|
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY
|
2011-10-04 19:50:08 +02:00
|
|
|
|
2018-06-19 01:32:35 +02:00
|
|
|
# Logical partitions related variables.
|
|
|
|
_product_stash_var_list += \
|
|
|
|
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE \
|
2018-06-20 01:23:16 +02:00
|
|
|
BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE \
|
2018-07-21 00:19:34 +02:00
|
|
|
BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE \
|
2018-07-21 00:33:47 +02:00
|
|
|
BOARD_PRODUCT_SERVICESIMAGE_PARTITION_RESERVED_SIZE \
|
2018-06-14 22:26:28 +02:00
|
|
|
BOARD_SUPER_PARTITION_SIZE \
|
|
|
|
BOARD_SUPER_PARTITION_PARTITION_LIST \
|
2018-06-19 01:32:35 +02:00
|
|
|
|
2010-09-14 19:09:48 +02:00
|
|
|
#
|
2016-10-06 01:57:27 +02:00
|
|
|
# Mark the variables in _product_stash_var_list as readonly
|
2010-09-14 19:09:48 +02:00
|
|
|
#
|
2016-10-06 01:57:27 +02:00
|
|
|
define readonly-product-vars
|
2010-12-29 23:07:38 +01:00
|
|
|
$(foreach v,$(_product_stash_var_list), \
|
2016-10-06 01:57:27 +02:00
|
|
|
$(eval $(v) ?=) \
|
|
|
|
$(eval .KATI_READONLY := $(v)) \
|
2010-09-14 19:09:48 +02:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2012-05-30 19:22:29 +02:00
|
|
|
define add-to-product-copy-files-if-exists
|
|
|
|
$(if $(wildcard $(word 1,$(subst :, ,$(1)))),$(1))
|
|
|
|
endef
|
2014-10-08 03:07:23 +02: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 00:15:31 +02: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
|