blob: 9a49927598cc05968c8520c7877f2b13e2f692ec [file] [log] [blame]
The Android Open Source Project88b60792009-03-03 19:28:42 -08001#
2# Copyright (C) 2007 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
Anton Hanssond26c6472019-05-06 14:40:57 +010017# Variables that are meant to hold only a single value.
18# - The value set in the current makefile takes precedence over inherited values
19# - If multiple inherited makefiles set the var, the first-inherited value wins
20_product_single_value_vars :=
21
22# Variables that are lists of values.
23_product_list_vars :=
24
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +010025_product_single_value_vars += PRODUCT_NAME
26_product_single_value_vars += PRODUCT_MODEL
Prashant Patil7d9cda12022-09-28 15:52:08 +010027_product_single_value_vars += PRODUCT_NAME_FOR_ATTESTATION
28_product_single_value_vars += PRODUCT_MODEL_FOR_ATTESTATION
The Android Open Source Project88b60792009-03-03 19:28:42 -080029
Juan Yescase5c0c172023-04-07 23:46:43 -070030# Defines the ELF segment alignment for binaries (executables and shared libraries).
31# The ELF segment alignment has to be a PAGE_SIZE multiple. For example, if
32# PRODUCT_MAX_PAGE_SIZE_SUPPORTED=65536, the possible values for PAGE_SIZE could be
33# 4096, 16384 and 65536.
34_product_single_value_vars += PRODUCT_MAX_PAGE_SIZE_SUPPORTED
35
Vilas Bhatd3ad9622024-03-26 04:09:17 +000036# Boolean variable determining if AOSP relies on bionic's PAGE_SIZE macro.
Vilas Bhat01e2b982023-12-04 22:34:42 +000037_product_single_value_vars += PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO
Juan Yescas1083f362023-07-14 10:42:31 -070038
Juan Yescase5c0c172023-04-07 23:46:43 -070039# The resource configuration options to use for this product.
Anton Hanssond26c6472019-05-06 14:40:57 +010040_product_list_vars += PRODUCT_LOCALES
41_product_list_vars += PRODUCT_AAPT_CONFIG
Sasha Smundak0301d642020-11-11 14:41:08 -080042_product_single_value_vars += PRODUCT_AAPT_PREF_CONFIG
Anton Hanssond26c6472019-05-06 14:40:57 +010043_product_list_vars += PRODUCT_AAPT_PREBUILT_DPI
44_product_list_vars += PRODUCT_HOST_PACKAGES
45_product_list_vars += PRODUCT_PACKAGES
46_product_list_vars += PRODUCT_PACKAGES_DEBUG
47_product_list_vars += PRODUCT_PACKAGES_DEBUG_ASAN
Florian Mayer201eb3b2023-03-22 16:14:17 -070048_product_list_vars += PRODUCT_PACKAGES_ARM64
Devin Moore64c25592023-05-31 21:45:09 +000049
50# packages that are added to PRODUCT_PACKAGES based on the PRODUCT_SHIPPING_API_LEVEL
51# These are only added if the shipping API level is that level or lower
52_product_list_vars += PRODUCT_PACKAGES_SHIPPING_API_LEVEL_29
53_product_list_vars += PRODUCT_PACKAGES_SHIPPING_API_LEVEL_33
54_product_list_vars += PRODUCT_PACKAGES_SHIPPING_API_LEVEL_34
55
Kavi Gupta7185f8c2019-06-11 10:27:47 -070056# Packages included only for eng/userdebug builds, when building with EMMA_INSTRUMENT=true
57_product_list_vars += PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE
Anton Hanssond26c6472019-05-06 14:40:57 +010058_product_list_vars += PRODUCT_PACKAGES_ENG
59_product_list_vars += PRODUCT_PACKAGES_TESTS
Anton Hansson13ea2a62019-03-28 14:47:25 +000060
61# The device that this product maps to.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +010062_product_single_value_vars += PRODUCT_DEVICE
63_product_single_value_vars += PRODUCT_MANUFACTURER
64_product_single_value_vars += PRODUCT_BRAND
Prashant Patil7d9cda12022-09-28 15:52:08 +010065_product_single_value_vars += PRODUCT_BRAND_FOR_ATTESTATION
Anton Hansson13ea2a62019-03-28 14:47:25 +000066
67# These PRODUCT_SYSTEM_* flags, if defined, are used in place of the
68# corresponding PRODUCT_* flags for the sysprops on /system.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +010069_product_single_value_vars += \
Anton Hanssonee4c9702018-12-21 15:36:00 +000070 PRODUCT_SYSTEM_NAME \
71 PRODUCT_SYSTEM_MODEL \
72 PRODUCT_SYSTEM_DEVICE \
73 PRODUCT_SYSTEM_BRAND \
74 PRODUCT_SYSTEM_MANUFACTURER \
Anton Hansson13ea2a62019-03-28 14:47:25 +000075
Jiyong Parkeb49b342020-05-29 17:50:03 +090076# PRODUCT_<PARTITION>_PROPERTIES are lists of property assignments
77# that go to <partition>/build.prop. Each property assignment is
78# "key = value" with zero or more whitespace characters on either
79# side of the '='.
80_product_list_vars += \
81 PRODUCT_SYSTEM_PROPERTIES \
82 PRODUCT_SYSTEM_EXT_PROPERTIES \
83 PRODUCT_VENDOR_PROPERTIES \
84 PRODUCT_ODM_PROPERTIES \
85 PRODUCT_PRODUCT_PROPERTIES
Anton Hansson13ea2a62019-03-28 14:47:25 +000086
Jiyong Parkeb49b342020-05-29 17:50:03 +090087# TODO(b/117892318) deprecate these:
88# ... in favor or PRODUCT_SYSTEM_PROPERTIES
89_product_list_vars += PRODUCT_SYSTEM_DEFAULT_PROPERTIES
90# ... in favor of PRODUCT_VENDOR_PROPERTIES
91_product_list_vars += PRODUCT_PROPERTY_OVERRIDES
Anton Hanssond26c6472019-05-06 14:40:57 +010092_product_list_vars += PRODUCT_DEFAULT_PROPERTY_OVERRIDES
Anton Hansson13ea2a62019-03-28 14:47:25 +000093
Jiyong Parkeb49b342020-05-29 17:50:03 +090094# TODO(b/117892318) consider deprecating these too
95_product_list_vars += PRODUCT_SYSTEM_PROPERTY_BLACKLIST
96_product_list_vars += PRODUCT_VENDOR_PROPERTY_BLACKLIST
Anton Hansson879b0072019-05-13 18:06:45 +010097
98# The characteristics of the product, which among other things is passed to aapt
99_product_single_value_vars += PRODUCT_CHARACTERISTICS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000100
101# A list of words like <source path>:<destination path>[:<owner>].
102# The file at the source path should be copied to the destination path
103# when building this product. <destination path> is relative to
104# $(PRODUCT_OUT), so it should look like, e.g., "system/etc/file.xml".
105# The rules for these copy steps are defined in build/make/core/Makefile.
106# The optional :<owner> is used to indicate the owner of a vendor file.
Anton Hanssond26c6472019-05-06 14:40:57 +0100107_product_list_vars += PRODUCT_COPY_FILES
Anton Hansson13ea2a62019-03-28 14:47:25 +0000108
109# The OTA key(s) specified by the product config, if any. The names
110# of these keys are stored in the target-files zip so that post-build
111# signing tools can substitute them for the test key embedded by
112# default.
Anton Hanssond26c6472019-05-06 14:40:57 +0100113_product_list_vars += PRODUCT_OTA_PUBLIC_KEYS
Jacky Liubeb0b692021-12-29 16:29:05 +0800114_product_list_vars += PRODUCT_EXTRA_OTA_KEYS
Anton Hanssond26c6472019-05-06 14:40:57 +0100115_product_list_vars += PRODUCT_EXTRA_RECOVERY_KEYS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000116
117# Should we use the default resources or add any product specific overlays
Anton Hanssond26c6472019-05-06 14:40:57 +0100118_product_list_vars += PRODUCT_PACKAGE_OVERLAYS
119_product_list_vars += DEVICE_PACKAGE_OVERLAYS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000120
121# Resource overlay list which must be excluded from enforcing RRO.
Anton Hanssond26c6472019-05-06 14:40:57 +0100122_product_list_vars += PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000123
124# Package list to apply enforcing RRO.
Anton Hanssond26c6472019-05-06 14:40:57 +0100125_product_list_vars += PRODUCT_ENFORCE_RRO_TARGETS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000126
Anton Hanssond26c6472019-05-06 14:40:57 +0100127_product_list_vars += PRODUCT_SDK_ATREE_FILES
128_product_list_vars += PRODUCT_SDK_ADDON_NAME
129_product_list_vars += PRODUCT_SDK_ADDON_COPY_FILES
130_product_list_vars += PRODUCT_SDK_ADDON_COPY_MODULES
131_product_list_vars += PRODUCT_SDK_ADDON_DOC_MODULES
132_product_list_vars += PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP
Anton Hansson13ea2a62019-03-28 14:47:25 +0000133
134# which Soong namespaces to export to Make
Anton Hanssond26c6472019-05-06 14:40:57 +0100135_product_list_vars += PRODUCT_SOONG_NAMESPACES
Anton Hansson13ea2a62019-03-28 14:47:25 +0000136
Anton Hanssond26c6472019-05-06 14:40:57 +0100137_product_list_vars += PRODUCT_DEFAULT_WIFI_CHANNELS
Sasha Smundak0301d642020-11-11 14:41:08 -0800138_product_single_value_vars += PRODUCT_DEFAULT_DEV_CERTIFICATE
Remi NGUYEN VAN87d0f272019-08-07 18:13:33 +0900139_product_list_vars += PRODUCT_MAINLINE_SEPOLICY_DEV_CERTIFICATES
Anton Hanssond26c6472019-05-06 14:40:57 +0100140_product_list_vars += PRODUCT_RESTRICT_VENDOR_FILES
Anton Hansson13ea2a62019-03-28 14:47:25 +0000141
142# The list of product-specific kernel header dirs
Anton Hanssond26c6472019-05-06 14:40:57 +0100143_product_list_vars += PRODUCT_VENDOR_KERNEL_HEADERS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000144
Martin Stjernholm743513c2021-07-05 20:53:57 +0100145# A list of module names in BOOTCLASSPATH (jar files). Each module may be
146# prefixed with "<apex>:", which identifies the APEX that provides it. APEXes
147# are identified by their "variant" names, i.e. their `apex_name` values in
148# Soong, which default to the `name` values. The prefix can also be "platform:"
149# or "system_ext:", and defaults to "platform:" if left out. See the long
150# comment in build/soong/java/dexprepopt_bootjars.go for details.
Anton Hanssond26c6472019-05-06 14:40:57 +0100151_product_list_vars += PRODUCT_BOOT_JARS
Po Hu012118d2020-03-13 14:14:27 +0800152
Martin Stjernholm743513c2021-07-05 20:53:57 +0100153# A list of extra BOOTCLASSPATH jars (to be appended after common jars),
154# following the same format as PRODUCT_BOOT_JARS. Products that include
155# device-specific makefiles before AOSP makefiles should use this instead of
156# PRODUCT_BOOT_JARS, so that device-specific jars go after common jars.
Po Hu012118d2020-03-13 14:14:27 +0800157_product_list_vars += PRODUCT_BOOT_JARS_EXTRA
158
Jiakai Zhang7bdb2b32023-07-12 16:55:10 +0100159# List of jars to be included in the ART boot image for testing.
160_product_list_vars += PRODUCT_TEST_ONLY_ART_BOOT_IMAGE_JARS
161
Sasha Smundak94da1402021-02-10 22:27:36 -0800162_product_single_value_vars += PRODUCT_SUPPORTS_VBOOT
Anton Hanssond26c6472019-05-06 14:40:57 +0100163_product_list_vars += PRODUCT_SYSTEM_SERVER_APPS
Jiakai Zhang44ffb212021-10-28 14:37:20 +0000164# List of system_server classpath jars on the platform.
Anton Hanssond26c6472019-05-06 14:40:57 +0100165_product_list_vars += PRODUCT_SYSTEM_SERVER_JARS
Jiakai Zhang44ffb212021-10-28 14:37:20 +0000166# List of system_server classpath jars delivered via apex. Format = <apex name>:<jar name>.
satayeva85d5222021-07-27 12:32:40 +0100167_product_list_vars += PRODUCT_APEX_SYSTEM_SERVER_JARS
Jiakai Zhang44ffb212021-10-28 14:37:20 +0000168# List of jars on the platform that system_server loads dynamically using separate classloaders.
169_product_list_vars += PRODUCT_STANDALONE_SYSTEM_SERVER_JARS
170# List of jars delivered via apex that system_server loads dynamically using separate classloaders.
171# Format = <apex name>:<jar name>
172_product_list_vars += PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS
Ulya Trafimovich40e55c22020-03-27 12:12:59 +0000173# If true, then suboptimal order of system server jars does not cause an error.
Sasha Smundak0301d642020-11-11 14:41:08 -0800174_product_single_value_vars += PRODUCT_BROKEN_SUBOPTIMAL_ORDER_OF_SYSTEM_SERVER_JARS
Ulya Trafimovich7693ec72021-10-26 12:50:27 +0100175# If true, then system server jars defined in Android.mk are supported.
176_product_single_value_vars += PRODUCT_BROKEN_DEPRECATED_MK_SYSTEM_SERVER_JARS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000177
Rock.Yeh2a703ce2020-04-22 17:01:10 +0800178# Additional system server jars to be appended at the end of the common list.
179# This is necessary to avoid jars reordering due to makefile inheritance order.
180_product_list_vars += PRODUCT_SYSTEM_SERVER_JARS_EXTRA
181
Ulya Trafimovich1a3b1452021-03-22 17:24:18 +0000182# Set to true to disable <uses-library> checks for a product.
183_product_list_vars += PRODUCT_BROKEN_VERIFY_USES_LIBRARIES
184
Anton Hanssond26c6472019-05-06 14:40:57 +0100185_product_list_vars += PRODUCT_DEXPREOPT_SPEED_APPS
186_product_list_vars += PRODUCT_LOADED_BY_PRIVILEGED_MODULES
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100187_product_single_value_vars += PRODUCT_VBOOT_SIGNING_KEY
188_product_single_value_vars += PRODUCT_VBOOT_SIGNING_SUBKEY
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100189_product_single_value_vars += PRODUCT_SYSTEM_VERITY_PARTITION
190_product_single_value_vars += PRODUCT_VENDOR_VERITY_PARTITION
191_product_single_value_vars += PRODUCT_PRODUCT_VERITY_PARTITION
Justin Yun6151e3f2019-06-25 15:58:13 +0900192_product_single_value_vars += PRODUCT_SYSTEM_EXT_VERITY_PARTITION
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100193_product_single_value_vars += PRODUCT_ODM_VERITY_PARTITION
Yifan Hongcfb917a2020-05-07 14:58:20 -0700194_product_single_value_vars += PRODUCT_VENDOR_DLKM_VERITY_PARTITION
Yifan Hongf496f1b2020-07-15 16:52:59 -0700195_product_single_value_vars += PRODUCT_ODM_DLKM_VERITY_PARTITION
Ramji Jiyani13a41372022-01-27 07:05:08 +0000196_product_single_value_vars += PRODUCT_SYSTEM_DLKM_VERITY_PARTITION
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100197_product_single_value_vars += PRODUCT_SYSTEM_SERVER_DEBUG_INFO
198_product_single_value_vars += PRODUCT_OTHER_JAVA_DEBUG_INFO
Anton Hansson13ea2a62019-03-28 14:47:25 +0000199
200# Per-module dex-preopt configs.
Anton Hanssond26c6472019-05-06 14:40:57 +0100201_product_list_vars += PRODUCT_DEX_PREOPT_MODULE_CONFIGS
Sasha Smundak0301d642020-11-11 14:41:08 -0800202_product_single_value_vars += PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER
Anton Hanssond26c6472019-05-06 14:40:57 +0100203_product_list_vars += PRODUCT_DEX_PREOPT_DEFAULT_FLAGS
Sasha Smundak0301d642020-11-11 14:41:08 -0800204_product_single_value_vars += PRODUCT_DEX_PREOPT_BOOT_FLAGS
205_product_single_value_vars += PRODUCT_DEX_PREOPT_PROFILE_DIR
206_product_single_value_vars += PRODUCT_DEX_PREOPT_GENERATE_DM_FILES
207_product_single_value_vars += PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING
208_product_single_value_vars += PRODUCT_DEX_PREOPT_RESOLVE_STARTUP_STRINGS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000209
210# Boot image options.
Martin Stjernholm91964c82021-11-05 18:00:22 +0000211_product_list_vars += PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100212_product_single_value_vars += \
Howard Chen95339b02021-09-29 17:28:48 +0800213 PRODUCT_EXPORT_BOOT_IMAGE_TO_DIST \
Mathieu Chartiera61acf62017-06-28 18:23:37 -0700214 PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE \
Calin Juravlecdff6b12019-05-01 15:34:47 -0700215 PRODUCT_USES_DEFAULT_ART_CONFIG \
Anton Hansson13ea2a62019-03-28 14:47:25 +0000216
Sasha Smundak0301d642020-11-11 14:41:08 -0800217_product_single_value_vars += PRODUCT_SYSTEM_SERVER_COMPILER_FILTER
Anton Hansson13ea2a62019-03-28 14:47:25 +0000218# Per-module sanitizer configs
Anton Hanssond26c6472019-05-06 14:40:57 +0100219_product_list_vars += PRODUCT_SANITIZER_MODULE_CONFIGS
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100220_product_single_value_vars += PRODUCT_SYSTEM_BASE_FS_PATH
221_product_single_value_vars += PRODUCT_VENDOR_BASE_FS_PATH
222_product_single_value_vars += PRODUCT_PRODUCT_BASE_FS_PATH
Justin Yun6151e3f2019-06-25 15:58:13 +0900223_product_single_value_vars += PRODUCT_SYSTEM_EXT_BASE_FS_PATH
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100224_product_single_value_vars += PRODUCT_ODM_BASE_FS_PATH
Yifan Hongcfb917a2020-05-07 14:58:20 -0700225_product_single_value_vars += PRODUCT_VENDOR_DLKM_BASE_FS_PATH
Yifan Hongf496f1b2020-07-15 16:52:59 -0700226_product_single_value_vars += PRODUCT_ODM_DLKM_BASE_FS_PATH
Ramji Jiyani13a41372022-01-27 07:05:08 +0000227_product_single_value_vars += PRODUCT_SYSTEM_DLKM_BASE_FS_PATH
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100228
229# The first API level this product shipped with
230_product_single_value_vars += PRODUCT_SHIPPING_API_LEVEL
231
Justin Yun000e31c2024-02-28 20:54:14 +0900232# The first vendor API level this product shipped with
233_product_single_value_vars += PRODUCT_SHIPPING_VENDOR_API_LEVEL
234
Anton Hanssond26c6472019-05-06 14:40:57 +0100235_product_list_vars += VENDOR_PRODUCT_RESTRICT_VENDOR_FILES
236_product_list_vars += VENDOR_EXCEPTION_MODULES
237_product_list_vars += VENDOR_EXCEPTION_PATHS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000238# Whether the product wants to ship libartd. For rules and meaning, see art/Android.mk.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100239_product_single_value_vars += PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD
Anton Hansson13ea2a62019-03-28 14:47:25 +0000240
241# Make this art variable visible to soong_config.mk.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100242_product_single_value_vars += PRODUCT_ART_USE_READ_BARRIER
Anton Hansson13ea2a62019-03-28 14:47:25 +0000243
Anton Hansson13ea2a62019-03-28 14:47:25 +0000244# Add reserved headroom to a system image.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100245_product_single_value_vars += PRODUCT_SYSTEM_HEADROOM
Anton Hansson13ea2a62019-03-28 14:47:25 +0000246
247# Whether to save disk space by minimizing java debug info
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100248_product_single_value_vars += PRODUCT_MINIMIZE_JAVA_DEBUG_INFO
Anton Hansson13ea2a62019-03-28 14:47:25 +0000249
250# Whether any paths are excluded from sanitization when SANITIZE_TARGET=integer_overflow
Anton Hanssond26c6472019-05-06 14:40:57 +0100251_product_list_vars += PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000252
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100253_product_single_value_vars += PRODUCT_ADB_KEYS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000254
255# Whether any paths should have CFI enabled for components
Anton Hanssond26c6472019-05-06 14:40:57 +0100256_product_list_vars += PRODUCT_CFI_INCLUDE_PATHS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000257
258# Whether any paths are excluded from sanitization when SANITIZE_TARGET=cfi
Anton Hanssond26c6472019-05-06 14:40:57 +0100259_product_list_vars += PRODUCT_CFI_EXCLUDE_PATHS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000260
Hang Lue235ded2022-08-29 14:42:34 +0800261# Whether any paths should have HWASan enabled for components
262_product_list_vars += PRODUCT_HWASAN_INCLUDE_PATHS
263
Tomislav Novakd8febc92023-08-22 10:51:36 -0700264# Whether any paths are excluded from sanitization when SANITIZE_TARGET=hwaddress
265_product_list_vars += PRODUCT_HWASAN_EXCLUDE_PATHS
266
Evgenii Stepanov80b53b82023-06-08 15:40:39 -0700267# Whether any paths should have Memtag_heap enabled for components
268_product_list_vars += PRODUCT_MEMTAG_HEAP_ASYNC_INCLUDE_PATHS
269_product_list_vars += PRODUCT_MEMTAG_HEAP_ASYNC_DEFAULT_INCLUDE_PATHS
270_product_list_vars += PRODUCT_MEMTAG_HEAP_SYNC_INCLUDE_PATHS
271_product_list_vars += PRODUCT_MEMTAG_HEAP_SYNC_DEFAULT_INCLUDE_PATHS
272_product_list_vars += PRODUCT_MEMTAG_HEAP_EXCLUDE_PATHS
273
274# Whether this product wants to start with an empty list of default memtag_heap include paths
275_product_single_value_vars += PRODUCT_MEMTAG_HEAP_SKIP_DEFAULT_PATHS
276
Anton Hansson13ea2a62019-03-28 14:47:25 +0000277# Whether the Scudo hardened allocator is disabled platform-wide
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100278_product_single_value_vars += PRODUCT_DISABLE_SCUDO
Anton Hansson13ea2a62019-03-28 14:47:25 +0000279
Isaac Chene9723502019-05-06 16:55:48 +0800280# List of extra VNDK versions to be included
281_product_list_vars += PRODUCT_EXTRA_VNDK_VERSIONS
282
Mohammad Samiul Islamc87781a2020-11-25 16:00:38 +0000283# Whether APEX should be compressed or not
284_product_single_value_vars += PRODUCT_COMPRESSED_APEX
285
Justin Yunf19d8402019-11-18 19:43:41 +0900286# VNDK version of product partition. It can be 'current' if the product
287# partitions uses PLATFORM_VNDK_VERSION.
GeQi6e44e3d2020-09-04 13:44:09 +0800288_product_single_value_vars += PRODUCT_PRODUCT_VNDK_VERSION
Justin Yunf19d8402019-11-18 19:43:41 +0900289
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100290_product_single_value_vars += PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS
291_product_single_value_vars += PRODUCT_ENFORCE_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT
Colin Crossc3ad8042020-06-11 11:25:05 -0700292_product_list_vars += PRODUCT_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT_ALLOW_LIST
Anton Hanssond26c6472019-05-06 14:40:57 +0100293_product_list_vars += PRODUCT_ARTIFACT_PATH_REQUIREMENT_HINT
Colin Crossc3ad8042020-06-11 11:25:05 -0700294_product_list_vars += PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST
Anton Hansson13ea2a62019-03-28 14:47:25 +0000295
296# List of modules that should be forcefully unmarked from being LOCAL_PRODUCT_MODULE, and hence
297# installed on /system directory by default.
Anton Hanssond26c6472019-05-06 14:40:57 +0100298_product_list_vars += PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION
Anton Hansson13ea2a62019-03-28 14:47:25 +0000299
300# When this is true, dynamic partitions is retrofitted on a device that has
301# already been launched without dynamic partitions. Otherwise, the device
302# is launched with dynamic partitions.
303# This flag implies PRODUCT_USE_DYNAMIC_PARTITIONS.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100304_product_single_value_vars += PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000305
Spandan Das00114d42022-11-10 03:02:13 +0000306# List of tags that will be used to gate blueprint modules from the build graph
307_product_list_vars += PRODUCT_INCLUDE_TAGS
308
Sam Delmerico4c3b83f2023-02-21 13:54:27 -0500309# List of directories that will be used to gate blueprint modules from the build graph
310_product_list_vars += PRODUCT_SOURCE_ROOT_DIRS
311
Hridya Valsarajub39ec702021-03-31 21:28:02 -0700312# When this is true, various build time as well as runtime debugfs restrictions are enabled.
313_product_single_value_vars += PRODUCT_SET_DEBUGFS_RESTRICTIONS
314
Anton Hansson13ea2a62019-03-28 14:47:25 +0000315# Other dynamic partition feature flags.PRODUCT_USE_DYNAMIC_PARTITION_SIZE and
316# PRODUCT_BUILD_SUPER_PARTITION default to the value of PRODUCT_USE_DYNAMIC_PARTITIONS.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100317_product_single_value_vars += \
Anton Hansson13ea2a62019-03-28 14:47:25 +0000318 PRODUCT_USE_DYNAMIC_PARTITIONS \
Yifan Hong2dae5722018-07-31 12:47:27 -0700319 PRODUCT_USE_DYNAMIC_PARTITION_SIZE \
320 PRODUCT_BUILD_SUPER_PARTITION \
Anton Hansson13ea2a62019-03-28 14:47:25 +0000321
322# If set, kernel configuration requirements are present in OTA package (and will be enforced
323# during OTA). Otherwise, kernel configuration requirements are enforced in VTS.
324# Devices that checks the running kernel (instead of the kernel in OTA package) should not
325# set this variable to prevent OTA failures.
Anton Hanssond26c6472019-05-06 14:40:57 +0100326_product_list_vars += PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000327
Devin Moore6c5aedf2024-04-03 15:38:46 +0000328# If set to true, this product forces HIDL to be enabled by declaring android.hidl.manager
329# and android.hidl.token in the framework manifest. The product will also need to add the
330# 'hwservicemanager' service to PRODUCT_PACKAGES if its SHIPPING_API_LEVEL is greater than 34.
331# This should only be used during bringup for devices that are targeting FCM 202404 and still
332# have partner-owned HIDL interfaces that are being converted to AIDL.
333_product_single_value_vars += PRODUCT_HIDL_ENABLED
334
Tao Bao9be20c72019-04-08 21:11:59 -0700335# If set to true, this product builds a generic OTA package, which installs generic system images
336# onto matching devices. The product may only build a subset of system images (e.g. only
337# system.img), so devices need to install the package in a system-only OTA manner.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100338_product_single_value_vars += PRODUCT_BUILD_GENERIC_OTA_PACKAGE
Tao Bao9be20c72019-04-08 21:11:59 -0700339
Anton Hanssond26c6472019-05-06 14:40:57 +0100340_product_list_vars += PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES
341_product_list_vars += PRODUCT_PACKAGE_NAME_OVERRIDES
342_product_list_vars += PRODUCT_CERTIFICATE_OVERRIDES
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100343
Jiakai Zhang17c6af42023-07-12 16:54:56 +0100344# Overrides the (apex, jar) pairs above when determining the on-device location. The format is:
345# <old_apex>:<old_jar>:<new_apex>:<new_jar>
346_product_list_vars += PRODUCT_CONFIGURED_JAR_LOCATION_OVERRIDES
347
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100348# Controls for whether different partitions are built for the current product.
349_product_single_value_vars += PRODUCT_BUILD_SYSTEM_IMAGE
350_product_single_value_vars += PRODUCT_BUILD_SYSTEM_OTHER_IMAGE
351_product_single_value_vars += PRODUCT_BUILD_VENDOR_IMAGE
352_product_single_value_vars += PRODUCT_BUILD_PRODUCT_IMAGE
Justin Yun6151e3f2019-06-25 15:58:13 +0900353_product_single_value_vars += PRODUCT_BUILD_SYSTEM_EXT_IMAGE
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100354_product_single_value_vars += PRODUCT_BUILD_ODM_IMAGE
Yifan Hongcfb917a2020-05-07 14:58:20 -0700355_product_single_value_vars += PRODUCT_BUILD_VENDOR_DLKM_IMAGE
Yifan Hongf496f1b2020-07-15 16:52:59 -0700356_product_single_value_vars += PRODUCT_BUILD_ODM_DLKM_IMAGE
Ramji Jiyani13a41372022-01-27 07:05:08 +0000357_product_single_value_vars += PRODUCT_BUILD_SYSTEM_DLKM_IMAGE
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100358_product_single_value_vars += PRODUCT_BUILD_CACHE_IMAGE
359_product_single_value_vars += PRODUCT_BUILD_RAMDISK_IMAGE
360_product_single_value_vars += PRODUCT_BUILD_USERDATA_IMAGE
Chris Grossa784ef12019-04-22 11:09:57 -0700361_product_single_value_vars += PRODUCT_BUILD_RECOVERY_IMAGE
362_product_single_value_vars += PRODUCT_BUILD_BOOT_IMAGE
Devin Moore380d9e42021-11-04 19:01:19 +0000363_product_single_value_vars += PRODUCT_BUILD_INIT_BOOT_IMAGE
Yi-Yo Chiang4d7c6132021-09-29 19:41:11 +0800364_product_single_value_vars += PRODUCT_BUILD_DEBUG_BOOT_IMAGE
Daniel Norman42879ff2020-10-06 11:09:56 -0700365_product_single_value_vars += PRODUCT_BUILD_VENDOR_BOOT_IMAGE
Lucas Weif57333f2022-02-24 10:30:15 +0800366_product_single_value_vars += PRODUCT_BUILD_VENDOR_KERNEL_BOOT_IMAGE
Yi-Yo Chiang4d7c6132021-09-29 19:41:11 +0800367_product_single_value_vars += PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE
Paul Trautrim4e143232019-08-13 16:30:57 +0900368_product_single_value_vars += PRODUCT_BUILD_VBMETA_IMAGE
Yo Chiange86bab42021-03-25 10:12:28 +0000369_product_single_value_vars += PRODUCT_BUILD_SUPER_EMPTY_IMAGE
Pierre-Clément Tosifa8193c2021-09-24 15:49:00 +0200370_product_single_value_vars += PRODUCT_BUILD_PVMFW_IMAGE
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100371
Martin Stjernholm743513c2021-07-05 20:53:57 +0100372# List of boot jars delivered via updatable APEXes, following the same format as
373# PRODUCT_BOOT_JARS.
satayev65e68bb2021-07-15 18:19:56 +0100374_product_list_vars += PRODUCT_APEX_BOOT_JARS
Chris Grossa784ef12019-04-22 11:09:57 -0700375
Yifan Hong7d37b402019-07-23 14:20:29 -0700376# If set, device uses virtual A/B.
377_product_single_value_vars += PRODUCT_VIRTUAL_AB_OTA
378
Kelvin Zhang239a79a2021-01-15 13:47:52 -0500379# If set, device uses virtual A/B Compression.
380_product_single_value_vars += PRODUCT_VIRTUAL_AB_COMPRESSION
381
Yifan Hong7d37b402019-07-23 14:20:29 -0700382# If set, device retrofits virtual A/B.
383_product_single_value_vars += PRODUCT_VIRTUAL_AB_OTA_RETROFIT
384
Yifan Hong65afc072020-04-17 10:08:10 -0700385# If set, forcefully generate a non-A/B update package.
386# Note: A device configuration should inherit from virtual_ab_ota_plus_non_ab.mk
387# instead of setting this variable directly.
388# Note: Use TARGET_OTA_ALLOW_NON_AB in the build system because
389# TARGET_OTA_ALLOW_NON_AB takes the value of AB_OTA_UPDATER into account.
390_product_single_value_vars += PRODUCT_OTA_FORCE_NON_AB_PACKAGE
391
Jeongik Cha74529792019-07-19 13:40:18 +0900392# If set, Java module in product partition cannot use hidden APIs.
393_product_single_value_vars += PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE
394
JaeMan Park33d9aad2020-12-02 16:34:12 +0900395# If set, only java_sdk_library can be used at inter-partition dependency.
396# Note: Build error if BOARD_VNDK_VERSION is not set while
397# PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY is true, because
398# PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY has no meaning if
399# BOARD_VNDK_VERSION is not set.
400# Note: When PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE is not set, there are
401# no restrictions at dependency between system and product partition.
402_product_single_value_vars += PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY
403
404# Allowlist for PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY option.
405# Listed modules are allowed at inter-partition dependency even if it isn't
406# a java_sdk_library module.
407_product_list_vars += PRODUCT_INTER_PARTITION_JAVA_LIBRARY_ALLOWLIST
408
Yi-Yo Chiangf63bd5d2021-09-23 14:14:16 +0000409# Install a copy of the debug policy to the system_ext partition, and allow
410# init-second-stage to load debug policy from system_ext.
Yi-Yo Chiangb225d8c2021-10-18 18:32:46 +0800411# This option is only meant to be set by compliance GSI targets.
Yi-Yo Chiangf63bd5d2021-09-23 14:14:16 +0000412_product_single_value_vars += PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT
413
Victor Hsieh89415a82022-09-09 14:16:33 -0700414# If set, fsverity metadata files will be generated for each files in the
415# allowlist, plus an manifest APK per partition. For example,
416# /system/framework/service.jar will come with service.jar.fsv_meta in the same
417# directory; the file information will also be included in
418# /system/etc/security/fsverity/BuildManifest.apk
419_product_single_value_vars += PRODUCT_FSVERITY_GENERATE_METADATA
Inseob Kim9cda3972021-10-12 22:59:12 +0900420
Spandan Dase4a3e9e2024-05-07 22:52:17 +0000421# If true, this builds the mainline modules from source. This overrides any
422# prebuilts selected via RELEASE_APEX_CONTRIBUTIONS_* build flags for the
423# current release config.
Martin Stjernholm47dcbea2022-03-10 17:51:13 +0000424_product_single_value_vars += PRODUCT_MODULE_BUILD_FROM_SOURCE
425
Nikita Ioffebb9d6db2022-10-24 17:21:58 +0100426# If true, installs a full version of com.android.virt APEX.
427_product_single_value_vars += PRODUCT_AVF_ENABLED
428
Alice Wang28a57dc2024-05-16 15:41:34 +0000429# If false, disable the AVF remote attestaton feature.
430_product_single_value_vars += PRODUCT_AVF_REMOTE_ATTESTATION_DISABLED
431
Nikita Ioffecae3ef92023-06-07 14:36:56 +0100432# If true, kernel with modules will be used for Microdroid VMs.
433_product_single_value_vars += PRODUCT_AVF_KERNEL_MODULES_ENABLED
434
T.J. Mercier18a5d392024-03-27 21:53:52 +0000435# If true, the memory controller will be force-enabled in the cgroup v2 hierarchy
436_product_single_value_vars += PRODUCT_MEMCG_V2_FORCE_ENABLED
437
438# If true, the cgroup v2 hierarchy will be split into apps/system subtrees
439_product_single_value_vars += PRODUCT_CGROUP_V2_SYS_APP_ISOLATION_ENABLED
440
Jooyung Handa2d4a22023-01-09 16:26:23 +0900441# List of .json files to be merged/compiled into vendor/etc/linker.config.pb
442_product_list_vars += PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS
443
Jiakai Zhangd6c6e3a2022-11-16 11:52:00 +0000444# Whether to use userfaultfd GC.
445# Possible values are:
446# - "default" or empty: both the build system and the runtime determine whether to use userfaultfd
447# GC based on the vendor API level
448# - "true": forces the build system to use userfaultfd GC regardless of the vendor API level; the
449# runtime determines whether to use userfaultfd GC based on the kernel support. Note that the
450# device may have to re-compile everything on the first boot if the kernel doesn't support
451# userfaultfd
452# - "false": disallows the build system and the runtime to use userfaultfd GC even if the device
Martin Stjernholma8c687f2024-05-15 16:42:02 +0100453# supports it. This option is temporary - the plan is to remove it by Aug 2025, at which time
454# Mainline updates of the ART module will ignore it as well.
Jiakai Zhangd6c6e3a2022-11-16 11:52:00 +0000455_product_single_value_vars += PRODUCT_ENABLE_UFFD_GC
456
Daniel Zheng025099c2023-05-02 13:50:27 -0700457# Specifies COW version to be used by update_engine and libsnapshot. If this value is not
458# specified we default to COW version 2 in update_engine for backwards compatibility
459_product_single_value_vars += PRODUCT_VIRTUAL_AB_COW_VERSION
460
Daniel Zheng270130a2024-01-09 15:56:10 -0800461# Specifies maximum bytes to be compressed at once during ota. Options: 4096, 8192, 16384, 32768, 65536, 131072, 262144.
462_product_single_value_vars += PRODUCT_VIRTUAL_AB_COMPRESSION_FACTOR
463
Inseob Kim3c7b91b2023-08-25 21:28:49 +0900464# If set, determines whether the build system checks vendor seapp contexts violations.
465_product_single_value_vars += PRODUCT_CHECK_VENDOR_SEAPP_VIOLATIONS
466
Inseob Kimaa9a4a42023-11-21 16:47:42 +0900467# If set, determines whether the build system checks dev type violations.
468_product_single_value_vars += PRODUCT_CHECK_DEV_TYPE_VIOLATIONS
469
Vinh Tran424539f2023-04-12 17:48:34 -0400470_product_list_vars += PRODUCT_AFDO_PROFILES
471
Florian Mayerbeb5bed2023-11-07 10:12:26 -0800472_product_single_value_vars += PRODUCT_SCUDO_ALLOCATION_RING_BUFFER_SIZE
Jihoon Kange06e4c52023-09-19 19:12:48 +0000473
LaMont Jones38b195e2023-11-06 22:14:51 +0000474_product_list_vars += PRODUCT_RELEASE_CONFIG_MAPS
475
Cole Faust7aa649a2023-11-03 12:27:43 -0700476_product_list_vars += PRODUCT_VALIDATION_CHECKS
477
Jihoon Kang9e0998b2023-11-16 19:04:44 +0000478_product_single_value_vars += PRODUCT_BUILD_FROM_SOURCE_STUB
479
Spandan Das7f52f2a2024-02-20 07:48:22 +0000480_product_single_value_vars += PRODUCT_BUILD_IGNORE_APEX_CONTRIBUTION_CONTENTS
Spandan Das74163602024-02-17 03:31:45 +0000481
Jihoon Kangc974a272024-02-22 19:29:13 +0000482_product_single_value_vars += PRODUCT_HIDDEN_API_EXPORTABLE_STUBS
483
Jihoon Kang49f08d92024-02-22 20:04:44 +0000484_product_single_value_vars += PRODUCT_EXPORT_RUNTIME_APIS
485
Nikita Ioffeed8bd8a2024-04-23 18:34:52 +0000486# If set, determines which version of the GKI is used as guest kernel for Microdroid VMs.
487# TODO(b/325991735): link to documentation once it is done.
488_product_single_value_vars += PRODUCT_AVF_MICRODROID_GUEST_GKI_VERSION
489
Pawan Waghea2121d2024-05-17 21:41:32 +0000490# Enables 16KB developer option for device if set.
491_product_single_value_vars += PRODUCT_16K_DEVELOPER_OPTION
492
Anton Hanssond26c6472019-05-06 14:40:57 +0100493.KATI_READONLY := _product_single_value_vars _product_list_vars
494_product_var_list :=$= $(_product_single_value_vars) $(_product_list_vars)
Ying Wang20ebd2e2014-10-07 18:07:23 -0700495
The Android Open Source Project88b60792009-03-03 19:28:42 -0800496#
Anton Hansson13ea2a62019-03-28 14:47:25 +0000497# Functions for including product makefiles
498#
499
500#
The Android Open Source Project88b60792009-03-03 19:28:42 -0800501# $(1): product to inherit
502#
Anton Hansson061cbcf2018-05-30 18:24:41 +0100503# To be called from product makefiles, and is later evaluated during the import-nodes
Cole Faust04727302022-02-28 10:49:33 -0800504# call below. It does the following:
The Android Open Source Project6a5f7f02009-03-05 14:34:30 -0800505# 1. Inherits all of the variables from $1.
506# 2. Records the inheritance in the .INHERITS_FROM variable
Anton Hansson061cbcf2018-05-30 18:24:41 +0100507#
Cole Faust04727302022-02-28 10:49:33 -0800508# (2) and the PRODUCTS variable can be used together to reconstruct the include hierarchy
Anton Hansson061cbcf2018-05-30 18:24:41 +0100509# See e.g. product-graph.mk for an example of this.
The Android Open Source Project6a5f7f02009-03-05 14:34:30 -0800510#
The Android Open Source Project88b60792009-03-03 19:28:42 -0800511define inherit-product
Cole Faust725aab22022-03-08 18:29:17 -0800512 $(eval _inherit_product_wildcard := $(wildcard $(1)))\
513 $(if $(_inherit_product_wildcard),,$(error $(1) does not exist.))\
514 $(foreach part,$(_inherit_product_wildcard),\
515 $(if $(findstring ../,$(part)),\
516 $(eval np := $(call normalize-paths,$(part))),\
517 $(eval np := $(strip $(part))))\
518 $(foreach v,$(_product_var_list), \
519 $(eval $(v) := $($(v)) $(INHERIT_TAG)$(np))) \
520 $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
521 $(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \
522 $(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \
Cole Faust7162b952022-06-24 14:37:33 -0700523 $(call dump-inherit,$(current_mk),$(1)) \
Cole Faust725aab22022-03-08 18:29:17 -0800524 $(call dump-config-vals,$(current_mk),inherit))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800525endef
526
Anton Hansson837425b2018-06-01 14:18:14 +0100527# Specifies a number of path prefixes, relative to PRODUCT_OUT, where the
528# product makefile hierarchy rooted in the current node places its artifacts.
529# Creating artifacts outside the specified paths will cause a build-time error.
530define require-artifacts-in-path
531 $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
532 $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENTS := $(strip $(1))) \
Colin Crossc3ad8042020-06-11 11:25:05 -0700533 $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_ALLOWED_LIST := $(strip $(2))) \
Anton Hansson837425b2018-06-01 14:18:14 +0100534 $(eval ARTIFACT_PATH_REQUIREMENT_PRODUCTS := \
535 $(sort $(ARTIFACT_PATH_REQUIREMENT_PRODUCTS) $(current_mk)))
536endef
Joe Onorato28a846d2010-02-22 10:33:05 -0800537
Anton Hanssond1258eb2020-12-08 12:13:50 +0000538# Like require-artifacts-in-path, but does not require all allow-list entries to
539# have an effect.
540define require-artifacts-in-path-relaxed
541 $(require-artifacts-in-path) \
542 $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENT_IS_RELAXED := true)
543endef
544
Yo Chiang1db657a2020-05-10 20:33:35 +0800545# Makes including non-existent modules in PRODUCT_PACKAGES an error.
Colin Crossc3ad8042020-06-11 11:25:05 -0700546# $(1): list of non-existent modules to allow.
Anton Hansson1ebcbd52018-07-04 17:17:23 +0100547define enforce-product-packages-exist
548 $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
549 $(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST := true) \
Colin Crossc3ad8042020-06-11 11:25:05 -0700550 $(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST := $(1)) \
Anton Hansson1ebcbd52018-07-04 17:17:23 +0100551 $(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST) \
Colin Crossc3ad8042020-06-11 11:25:05 -0700552 $(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST)
Anton Hansson1ebcbd52018-07-04 17:17:23 +0100553endef
554
Joe Onorato28a846d2010-02-22 10:33:05 -0800555#
556# Do inherit-product only if $(1) exists
557#
558define inherit-product-if-exists
559 $(if $(wildcard $(1)),$(call inherit-product,$(1)),)
560endef
561
The Android Open Source Project88b60792009-03-03 19:28:42 -0800562#
563# $(1): product makefile list
564#
565#TODO: check to make sure that products have all the necessary vars defined
566define import-products
Anton Hanssond26c6472019-05-06 14:40:57 +0100567$(call import-nodes,PRODUCTS,$(1),$(_product_var_list),$(_product_single_value_vars))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800568endef
569
570
571#
Cole Faust81f1e922022-04-08 11:12:10 -0700572# Does various consistency checks on the current product.
The Android Open Source Project88b60792009-03-03 19:28:42 -0800573# Takes no parameters, so $(call ) is not necessary.
574#
Cole Faust81f1e922022-04-08 11:12:10 -0700575define check-current-product
The Android Open Source Project88b60792009-03-03 19:28:42 -0800576$(if ,, \
Cole Faust81f1e922022-04-08 11:12:10 -0700577 $(if $(call is-c-identifier,$(PRODUCT_NAME)),, \
578 $(error $(INTERNAL_PRODUCT): PRODUCT_NAME must be a valid C identifier, not "$(pn)")) \
579 $(if $(PRODUCT_BRAND),, \
580 $(error $(INTERNAL_PRODUCT): PRODUCT_BRAND must be defined.)) \
581 $(foreach cf,$(strip $(PRODUCT_COPY_FILES)), \
582 $(if $(filter 2 3,$(words $(subst :,$(space),$(cf)))),, \
583 $(error $(p): malformed COPY_FILE "$(cf)"))))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800584endef
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400585
Anton Hansson13ea2a62019-03-28 14:47:25 +0000586# BoardConfig variables that are also inherited in product mks. Should ideally
587# be cleaned up to not be product variables.
588_readonly_late_variables := \
589 DEVICE_PACKAGE_OVERLAYS \
Jiakai Zhangbf0c0e62023-11-06 17:55:59 +0000590 WITH_DEXPREOPT_ART_BOOT_IMG_ONLY \
Anton Hansson13ea2a62019-03-28 14:47:25 +0000591
592# Modified internally in the build system
593_readonly_late_variables += \
594 PRODUCT_COPY_FILES \
595 PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING \
596 PRODUCT_DEX_PREOPT_BOOT_FLAGS \
597
598_readonly_early_variables := $(filter-out $(_readonly_late_variables),$(_product_var_list))
Yifan Honge5d879a2018-11-27 11:37:38 -0800599
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400600#
Dan Willemsenc1f17ff2016-10-05 16:57:27 -0700601# Mark the variables in _product_stash_var_list as readonly
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400602#
Anton Hansson13ea2a62019-03-28 14:47:25 +0000603define readonly-variables
604$(foreach v,$(1), \
Anton Hansson70222b22019-02-21 10:41:03 +0000605 $(eval $(v) ?=) \
606 $(eval .KATI_READONLY := $(v)) \
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400607 )
608endef
Anton Hansson13ea2a62019-03-28 14:47:25 +0000609define readonly-product-vars
610$(call readonly-variables,$(_readonly_early_variables))
611endef
612
613define readonly-final-product-vars
614$(call readonly-variables,$(_readonly_late_variables))
615endef
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400616
Anton Hanssoncca8cdb2019-10-28 11:30:40 +0000617# Macro re-defined inside strip-product-vars.
618get-product-var = $(PRODUCTS.$(strip $(1)).$(2))
Yifan Honge5d879a2018-11-27 11:37:38 -0800619#
Anton Hansson528fdc02019-06-25 18:57:57 +0100620# Strip the variables in _product_var_list and a few build-system
621# internal variables, and assign the ones for the current product
622# to a shorthand that is more convenient to read from elsewhere.
Yifan Honge5d879a2018-11-27 11:37:38 -0800623#
624define strip-product-vars
Joe Onorato38a57bf2021-02-08 13:38:01 -0800625$(call dump-phase-start,PRODUCT-EXPAND,,$(_product_var_list),$(_product_single_value_vars), \
626 build/make/core/product.mk) \
Anton Hansson528fdc02019-06-25 18:57:57 +0100627$(foreach v,\
628 $(_product_var_list) \
629 PRODUCT_ENFORCE_PACKAGES_EXIST \
Colin Crossc3ad8042020-06-11 11:25:05 -0700630 PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST, \
Anton Hansson13ea2a62019-03-28 14:47:25 +0000631 $(eval $(v) := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).$(v)))) \
Anton Hanssoncca8cdb2019-10-28 11:30:40 +0000632 $(eval get-product-var = $$(if $$(filter $$(1),$$(INTERNAL_PRODUCT)),$$($$(2)),$$(PRODUCTS.$$(strip $$(1)).$$(2)))) \
633 $(KATI_obsolete_var PRODUCTS.$(INTERNAL_PRODUCT).$(v),Use $(v) instead) \
Joe Onorato38a57bf2021-02-08 13:38:01 -0800634) \
635$(call dump-phase-end,build/make/core/product.mk)
Yifan Honge5d879a2018-11-27 11:37:38 -0800636endef
637
Keun young Parkc41c5f42012-05-30 10:22:29 -0700638define add-to-product-copy-files-if-exists
639$(if $(wildcard $(word 1,$(subst :, ,$(1)))),$(1))
640endef
Ying Wang20ebd2e2014-10-07 18:07:23 -0700641
642# whitespace placeholder when we record module's dex-preopt config.
643_PDPMC_SP_PLACE_HOLDER := |@SP@|
644# Set up dex-preopt config for a module.
645# $(1) list of module names
646# $(2) the modules' dex-preopt config
647define add-product-dex-preopt-module-config
648$(eval _c := $(subst $(space),$(_PDPMC_SP_PLACE_HOLDER),$(strip $(2))))\
649$(eval PRODUCT_DEX_PREOPT_MODULE_CONFIGS += \
650 $(foreach m,$(1),$(m)=$(_c)))
651endef
Andreas Gampe6b30d772016-06-27 15:15:31 -0700652
653# whitespace placeholder when we record module's sanitizer config.
654_PSMC_SP_PLACE_HOLDER := |@SP@|
655# Set up sanitizer config for a module.
656# $(1) list of module names
657# $(2) the modules' sanitizer config
658define add-product-sanitizer-module-config
659$(eval _c := $(subst $(space),$(_PSMC_SP_PLACE_HOLDER),$(strip $(2))))\
660$(eval PRODUCT_SANITIZER_MODULE_CONFIGS += \
661 $(foreach m,$(1),$(m)=$(_c)))
662endef