blob: 7621c71314502c729bb9b24e126cf0f1e5b1d73e [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
The Android Open Source Project88b60792009-03-03 19:28:42 -080027
Anton Hansson13ea2a62019-03-28 14:47:25 +000028# The resoure configuration options to use for this product.
Anton Hanssond26c6472019-05-06 14:40:57 +010029_product_list_vars += PRODUCT_LOCALES
30_product_list_vars += PRODUCT_AAPT_CONFIG
Sasha Smundak0301d642020-11-11 14:41:08 -080031_product_single_value_vars += PRODUCT_AAPT_PREF_CONFIG
Anton Hanssond26c6472019-05-06 14:40:57 +010032_product_list_vars += PRODUCT_AAPT_PREBUILT_DPI
33_product_list_vars += PRODUCT_HOST_PACKAGES
34_product_list_vars += PRODUCT_PACKAGES
35_product_list_vars += PRODUCT_PACKAGES_DEBUG
36_product_list_vars += PRODUCT_PACKAGES_DEBUG_ASAN
Kavi Gupta7185f8c2019-06-11 10:27:47 -070037# Packages included only for eng/userdebug builds, when building with EMMA_INSTRUMENT=true
38_product_list_vars += PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE
Anton Hanssond26c6472019-05-06 14:40:57 +010039_product_list_vars += PRODUCT_PACKAGES_ENG
40_product_list_vars += PRODUCT_PACKAGES_TESTS
Anton Hansson13ea2a62019-03-28 14:47:25 +000041
42# The device that this product maps to.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +010043_product_single_value_vars += PRODUCT_DEVICE
44_product_single_value_vars += PRODUCT_MANUFACTURER
45_product_single_value_vars += PRODUCT_BRAND
Anton Hansson13ea2a62019-03-28 14:47:25 +000046
47# These PRODUCT_SYSTEM_* flags, if defined, are used in place of the
48# corresponding PRODUCT_* flags for the sysprops on /system.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +010049_product_single_value_vars += \
Anton Hanssonee4c9702018-12-21 15:36:00 +000050 PRODUCT_SYSTEM_NAME \
51 PRODUCT_SYSTEM_MODEL \
52 PRODUCT_SYSTEM_DEVICE \
53 PRODUCT_SYSTEM_BRAND \
54 PRODUCT_SYSTEM_MANUFACTURER \
Anton Hansson13ea2a62019-03-28 14:47:25 +000055
Jiyong Parkeb49b342020-05-29 17:50:03 +090056# PRODUCT_<PARTITION>_PROPERTIES are lists of property assignments
57# that go to <partition>/build.prop. Each property assignment is
58# "key = value" with zero or more whitespace characters on either
59# side of the '='.
60_product_list_vars += \
61 PRODUCT_SYSTEM_PROPERTIES \
62 PRODUCT_SYSTEM_EXT_PROPERTIES \
63 PRODUCT_VENDOR_PROPERTIES \
64 PRODUCT_ODM_PROPERTIES \
65 PRODUCT_PRODUCT_PROPERTIES
Anton Hansson13ea2a62019-03-28 14:47:25 +000066
Jiyong Parkeb49b342020-05-29 17:50:03 +090067# TODO(b/117892318) deprecate these:
68# ... in favor or PRODUCT_SYSTEM_PROPERTIES
69_product_list_vars += PRODUCT_SYSTEM_DEFAULT_PROPERTIES
70# ... in favor of PRODUCT_VENDOR_PROPERTIES
71_product_list_vars += PRODUCT_PROPERTY_OVERRIDES
Anton Hanssond26c6472019-05-06 14:40:57 +010072_product_list_vars += PRODUCT_DEFAULT_PROPERTY_OVERRIDES
Anton Hansson13ea2a62019-03-28 14:47:25 +000073
Jiyong Parkeb49b342020-05-29 17:50:03 +090074# TODO(b/117892318) consider deprecating these too
75_product_list_vars += PRODUCT_SYSTEM_PROPERTY_BLACKLIST
76_product_list_vars += PRODUCT_VENDOR_PROPERTY_BLACKLIST
Anton Hansson879b0072019-05-13 18:06:45 +010077
78# The characteristics of the product, which among other things is passed to aapt
79_product_single_value_vars += PRODUCT_CHARACTERISTICS
Anton Hansson13ea2a62019-03-28 14:47:25 +000080
81# A list of words like <source path>:<destination path>[:<owner>].
82# The file at the source path should be copied to the destination path
83# when building this product. <destination path> is relative to
84# $(PRODUCT_OUT), so it should look like, e.g., "system/etc/file.xml".
85# The rules for these copy steps are defined in build/make/core/Makefile.
86# The optional :<owner> is used to indicate the owner of a vendor file.
Anton Hanssond26c6472019-05-06 14:40:57 +010087_product_list_vars += PRODUCT_COPY_FILES
Anton Hansson13ea2a62019-03-28 14:47:25 +000088
89# The OTA key(s) specified by the product config, if any. The names
90# of these keys are stored in the target-files zip so that post-build
91# signing tools can substitute them for the test key embedded by
92# default.
Anton Hanssond26c6472019-05-06 14:40:57 +010093_product_list_vars += PRODUCT_OTA_PUBLIC_KEYS
Jacky Liubeb0b692021-12-29 16:29:05 +080094_product_list_vars += PRODUCT_EXTRA_OTA_KEYS
Anton Hanssond26c6472019-05-06 14:40:57 +010095_product_list_vars += PRODUCT_EXTRA_RECOVERY_KEYS
Anton Hansson13ea2a62019-03-28 14:47:25 +000096
97# Should we use the default resources or add any product specific overlays
Anton Hanssond26c6472019-05-06 14:40:57 +010098_product_list_vars += PRODUCT_PACKAGE_OVERLAYS
99_product_list_vars += DEVICE_PACKAGE_OVERLAYS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000100
101# Resource overlay list which must be excluded from enforcing RRO.
Anton Hanssond26c6472019-05-06 14:40:57 +0100102_product_list_vars += PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000103
104# Package list to apply enforcing RRO.
Anton Hanssond26c6472019-05-06 14:40:57 +0100105_product_list_vars += PRODUCT_ENFORCE_RRO_TARGETS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000106
Anton Hanssond26c6472019-05-06 14:40:57 +0100107_product_list_vars += PRODUCT_SDK_ATREE_FILES
108_product_list_vars += PRODUCT_SDK_ADDON_NAME
109_product_list_vars += PRODUCT_SDK_ADDON_COPY_FILES
110_product_list_vars += PRODUCT_SDK_ADDON_COPY_MODULES
111_product_list_vars += PRODUCT_SDK_ADDON_DOC_MODULES
112_product_list_vars += PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP
Anton Hansson13ea2a62019-03-28 14:47:25 +0000113
114# which Soong namespaces to export to Make
Anton Hanssond26c6472019-05-06 14:40:57 +0100115_product_list_vars += PRODUCT_SOONG_NAMESPACES
Anton Hansson13ea2a62019-03-28 14:47:25 +0000116
Anton Hanssond26c6472019-05-06 14:40:57 +0100117_product_list_vars += PRODUCT_DEFAULT_WIFI_CHANNELS
Sasha Smundak0301d642020-11-11 14:41:08 -0800118_product_single_value_vars += PRODUCT_DEFAULT_DEV_CERTIFICATE
Remi NGUYEN VAN87d0f272019-08-07 18:13:33 +0900119_product_list_vars += PRODUCT_MAINLINE_SEPOLICY_DEV_CERTIFICATES
Anton Hanssond26c6472019-05-06 14:40:57 +0100120_product_list_vars += PRODUCT_RESTRICT_VENDOR_FILES
Anton Hansson13ea2a62019-03-28 14:47:25 +0000121
122# The list of product-specific kernel header dirs
Anton Hanssond26c6472019-05-06 14:40:57 +0100123_product_list_vars += PRODUCT_VENDOR_KERNEL_HEADERS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000124
Martin Stjernholm743513c2021-07-05 20:53:57 +0100125# A list of module names in BOOTCLASSPATH (jar files). Each module may be
126# prefixed with "<apex>:", which identifies the APEX that provides it. APEXes
127# are identified by their "variant" names, i.e. their `apex_name` values in
128# Soong, which default to the `name` values. The prefix can also be "platform:"
129# or "system_ext:", and defaults to "platform:" if left out. See the long
130# comment in build/soong/java/dexprepopt_bootjars.go for details.
Anton Hanssond26c6472019-05-06 14:40:57 +0100131_product_list_vars += PRODUCT_BOOT_JARS
Po Hu012118d2020-03-13 14:14:27 +0800132
Martin Stjernholm743513c2021-07-05 20:53:57 +0100133# A list of extra BOOTCLASSPATH jars (to be appended after common jars),
134# following the same format as PRODUCT_BOOT_JARS. Products that include
135# device-specific makefiles before AOSP makefiles should use this instead of
136# PRODUCT_BOOT_JARS, so that device-specific jars go after common jars.
Po Hu012118d2020-03-13 14:14:27 +0800137_product_list_vars += PRODUCT_BOOT_JARS_EXTRA
138
Sasha Smundak94da1402021-02-10 22:27:36 -0800139_product_single_value_vars += PRODUCT_SUPPORTS_VBOOT
Anton Hanssond26c6472019-05-06 14:40:57 +0100140_product_list_vars += PRODUCT_SYSTEM_SERVER_APPS
Jiakai Zhang44ffb212021-10-28 14:37:20 +0000141# List of system_server classpath jars on the platform.
Anton Hanssond26c6472019-05-06 14:40:57 +0100142_product_list_vars += PRODUCT_SYSTEM_SERVER_JARS
Jiakai Zhang44ffb212021-10-28 14:37:20 +0000143# List of system_server classpath jars delivered via apex. Format = <apex name>:<jar name>.
satayeva85d5222021-07-27 12:32:40 +0100144_product_list_vars += PRODUCT_APEX_SYSTEM_SERVER_JARS
Jiakai Zhang44ffb212021-10-28 14:37:20 +0000145# List of jars on the platform that system_server loads dynamically using separate classloaders.
146_product_list_vars += PRODUCT_STANDALONE_SYSTEM_SERVER_JARS
147# List of jars delivered via apex that system_server loads dynamically using separate classloaders.
148# Format = <apex name>:<jar name>
149_product_list_vars += PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS
Ulya Trafimovich40e55c22020-03-27 12:12:59 +0000150# If true, then suboptimal order of system server jars does not cause an error.
Sasha Smundak0301d642020-11-11 14:41:08 -0800151_product_single_value_vars += PRODUCT_BROKEN_SUBOPTIMAL_ORDER_OF_SYSTEM_SERVER_JARS
Ulya Trafimovich7693ec72021-10-26 12:50:27 +0100152# If true, then system server jars defined in Android.mk are supported.
153_product_single_value_vars += PRODUCT_BROKEN_DEPRECATED_MK_SYSTEM_SERVER_JARS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000154
Rock.Yeh2a703ce2020-04-22 17:01:10 +0800155# Additional system server jars to be appended at the end of the common list.
156# This is necessary to avoid jars reordering due to makefile inheritance order.
157_product_list_vars += PRODUCT_SYSTEM_SERVER_JARS_EXTRA
158
Ulya Trafimovich1a3b1452021-03-22 17:24:18 +0000159# Set to true to disable <uses-library> checks for a product.
160_product_list_vars += PRODUCT_BROKEN_VERIFY_USES_LIBRARIES
161
Anton Hansson13ea2a62019-03-28 14:47:25 +0000162# All of the apps that we force preopt, this overrides WITH_DEXPREOPT.
Anton Hanssond26c6472019-05-06 14:40:57 +0100163_product_list_vars += PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK
164_product_list_vars += PRODUCT_DEXPREOPT_SPEED_APPS
165_product_list_vars += PRODUCT_LOADED_BY_PRIVILEGED_MODULES
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100166_product_single_value_vars += PRODUCT_VBOOT_SIGNING_KEY
167_product_single_value_vars += PRODUCT_VBOOT_SIGNING_SUBKEY
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100168_product_single_value_vars += PRODUCT_SYSTEM_VERITY_PARTITION
169_product_single_value_vars += PRODUCT_VENDOR_VERITY_PARTITION
170_product_single_value_vars += PRODUCT_PRODUCT_VERITY_PARTITION
Justin Yun6151e3f2019-06-25 15:58:13 +0900171_product_single_value_vars += PRODUCT_SYSTEM_EXT_VERITY_PARTITION
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100172_product_single_value_vars += PRODUCT_ODM_VERITY_PARTITION
Yifan Hongcfb917a2020-05-07 14:58:20 -0700173_product_single_value_vars += PRODUCT_VENDOR_DLKM_VERITY_PARTITION
Yifan Hongf496f1b2020-07-15 16:52:59 -0700174_product_single_value_vars += PRODUCT_ODM_DLKM_VERITY_PARTITION
Ramji Jiyani13a41372022-01-27 07:05:08 +0000175_product_single_value_vars += PRODUCT_SYSTEM_DLKM_VERITY_PARTITION
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100176_product_single_value_vars += PRODUCT_SYSTEM_SERVER_DEBUG_INFO
177_product_single_value_vars += PRODUCT_OTHER_JAVA_DEBUG_INFO
Anton Hansson13ea2a62019-03-28 14:47:25 +0000178
179# Per-module dex-preopt configs.
Anton Hanssond26c6472019-05-06 14:40:57 +0100180_product_list_vars += PRODUCT_DEX_PREOPT_MODULE_CONFIGS
Sasha Smundak0301d642020-11-11 14:41:08 -0800181_product_single_value_vars += PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER
Anton Hanssond26c6472019-05-06 14:40:57 +0100182_product_list_vars += PRODUCT_DEX_PREOPT_DEFAULT_FLAGS
Sasha Smundak0301d642020-11-11 14:41:08 -0800183_product_single_value_vars += PRODUCT_DEX_PREOPT_BOOT_FLAGS
184_product_single_value_vars += PRODUCT_DEX_PREOPT_PROFILE_DIR
185_product_single_value_vars += PRODUCT_DEX_PREOPT_GENERATE_DM_FILES
186_product_single_value_vars += PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING
187_product_single_value_vars += PRODUCT_DEX_PREOPT_RESOLVE_STARTUP_STRINGS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000188
189# Boot image options.
Martin Stjernholm91964c82021-11-05 18:00:22 +0000190_product_list_vars += PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100191_product_single_value_vars += \
Howard Chen95339b02021-09-29 17:28:48 +0800192 PRODUCT_EXPORT_BOOT_IMAGE_TO_DIST \
Mathieu Chartiera61acf62017-06-28 18:23:37 -0700193 PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE \
Calin Juravlecdff6b12019-05-01 15:34:47 -0700194 PRODUCT_USES_DEFAULT_ART_CONFIG \
Anton Hansson13ea2a62019-03-28 14:47:25 +0000195
Sasha Smundak0301d642020-11-11 14:41:08 -0800196_product_single_value_vars += PRODUCT_SYSTEM_SERVER_COMPILER_FILTER
Anton Hansson13ea2a62019-03-28 14:47:25 +0000197# Per-module sanitizer configs
Anton Hanssond26c6472019-05-06 14:40:57 +0100198_product_list_vars += PRODUCT_SANITIZER_MODULE_CONFIGS
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100199_product_single_value_vars += PRODUCT_SYSTEM_BASE_FS_PATH
200_product_single_value_vars += PRODUCT_VENDOR_BASE_FS_PATH
201_product_single_value_vars += PRODUCT_PRODUCT_BASE_FS_PATH
Justin Yun6151e3f2019-06-25 15:58:13 +0900202_product_single_value_vars += PRODUCT_SYSTEM_EXT_BASE_FS_PATH
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100203_product_single_value_vars += PRODUCT_ODM_BASE_FS_PATH
Yifan Hongcfb917a2020-05-07 14:58:20 -0700204_product_single_value_vars += PRODUCT_VENDOR_DLKM_BASE_FS_PATH
Yifan Hongf496f1b2020-07-15 16:52:59 -0700205_product_single_value_vars += PRODUCT_ODM_DLKM_BASE_FS_PATH
Ramji Jiyani13a41372022-01-27 07:05:08 +0000206_product_single_value_vars += PRODUCT_SYSTEM_DLKM_BASE_FS_PATH
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100207
208# The first API level this product shipped with
209_product_single_value_vars += PRODUCT_SHIPPING_API_LEVEL
210
Anton Hanssond26c6472019-05-06 14:40:57 +0100211_product_list_vars += VENDOR_PRODUCT_RESTRICT_VENDOR_FILES
212_product_list_vars += VENDOR_EXCEPTION_MODULES
213_product_list_vars += VENDOR_EXCEPTION_PATHS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000214# Whether the product wants to ship libartd. For rules and meaning, see art/Android.mk.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100215_product_single_value_vars += PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD
Anton Hansson13ea2a62019-03-28 14:47:25 +0000216
217# Make this art variable visible to soong_config.mk.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100218_product_single_value_vars += PRODUCT_ART_USE_READ_BARRIER
Anton Hansson13ea2a62019-03-28 14:47:25 +0000219
Anton Hansson13ea2a62019-03-28 14:47:25 +0000220# Add reserved headroom to a system image.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100221_product_single_value_vars += PRODUCT_SYSTEM_HEADROOM
Anton Hansson13ea2a62019-03-28 14:47:25 +0000222
223# Whether to save disk space by minimizing java debug info
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100224_product_single_value_vars += PRODUCT_MINIMIZE_JAVA_DEBUG_INFO
Anton Hansson13ea2a62019-03-28 14:47:25 +0000225
226# Whether any paths are excluded from sanitization when SANITIZE_TARGET=integer_overflow
Anton Hanssond26c6472019-05-06 14:40:57 +0100227_product_list_vars += PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000228
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100229_product_single_value_vars += PRODUCT_ADB_KEYS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000230
231# Whether any paths should have CFI enabled for components
Anton Hanssond26c6472019-05-06 14:40:57 +0100232_product_list_vars += PRODUCT_CFI_INCLUDE_PATHS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000233
234# Whether any paths are excluded from sanitization when SANITIZE_TARGET=cfi
Anton Hanssond26c6472019-05-06 14:40:57 +0100235_product_list_vars += PRODUCT_CFI_EXCLUDE_PATHS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000236
237# Whether the Scudo hardened allocator is disabled platform-wide
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100238_product_single_value_vars += PRODUCT_DISABLE_SCUDO
Anton Hansson13ea2a62019-03-28 14:47:25 +0000239
Isaac Chene9723502019-05-06 16:55:48 +0800240# List of extra VNDK versions to be included
241_product_list_vars += PRODUCT_EXTRA_VNDK_VERSIONS
242
Mohammad Samiul Islamc87781a2020-11-25 16:00:38 +0000243# Whether APEX should be compressed or not
244_product_single_value_vars += PRODUCT_COMPRESSED_APEX
245
Justin Yunf19d8402019-11-18 19:43:41 +0900246# VNDK version of product partition. It can be 'current' if the product
247# partitions uses PLATFORM_VNDK_VERSION.
GeQi6e44e3d2020-09-04 13:44:09 +0800248_product_single_value_vars += PRODUCT_PRODUCT_VNDK_VERSION
Justin Yunf19d8402019-11-18 19:43:41 +0900249
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100250_product_single_value_vars += PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS
251_product_single_value_vars += PRODUCT_ENFORCE_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT
Colin Crossc3ad8042020-06-11 11:25:05 -0700252_product_list_vars += PRODUCT_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT_ALLOW_LIST
Anton Hanssond26c6472019-05-06 14:40:57 +0100253_product_list_vars += PRODUCT_ARTIFACT_PATH_REQUIREMENT_HINT
Colin Crossc3ad8042020-06-11 11:25:05 -0700254_product_list_vars += PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST
Anton Hansson13ea2a62019-03-28 14:47:25 +0000255
256# List of modules that should be forcefully unmarked from being LOCAL_PRODUCT_MODULE, and hence
257# installed on /system directory by default.
Anton Hanssond26c6472019-05-06 14:40:57 +0100258_product_list_vars += PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION
Anton Hansson13ea2a62019-03-28 14:47:25 +0000259
260# When this is true, dynamic partitions is retrofitted on a device that has
261# already been launched without dynamic partitions. Otherwise, the device
262# is launched with dynamic partitions.
263# This flag implies PRODUCT_USE_DYNAMIC_PARTITIONS.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100264_product_single_value_vars += PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000265
Spandan Das00114d42022-11-10 03:02:13 +0000266# List of tags that will be used to gate blueprint modules from the build graph
267_product_list_vars += PRODUCT_INCLUDE_TAGS
268
Hridya Valsarajub39ec702021-03-31 21:28:02 -0700269# When this is true, various build time as well as runtime debugfs restrictions are enabled.
270_product_single_value_vars += PRODUCT_SET_DEBUGFS_RESTRICTIONS
271
Anton Hansson13ea2a62019-03-28 14:47:25 +0000272# Other dynamic partition feature flags.PRODUCT_USE_DYNAMIC_PARTITION_SIZE and
273# PRODUCT_BUILD_SUPER_PARTITION default to the value of PRODUCT_USE_DYNAMIC_PARTITIONS.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100274_product_single_value_vars += \
Anton Hansson13ea2a62019-03-28 14:47:25 +0000275 PRODUCT_USE_DYNAMIC_PARTITIONS \
Yifan Hong2dae5722018-07-31 12:47:27 -0700276 PRODUCT_USE_DYNAMIC_PARTITION_SIZE \
277 PRODUCT_BUILD_SUPER_PARTITION \
Anton Hansson13ea2a62019-03-28 14:47:25 +0000278
279# If set, kernel configuration requirements are present in OTA package (and will be enforced
280# during OTA). Otherwise, kernel configuration requirements are enforced in VTS.
281# Devices that checks the running kernel (instead of the kernel in OTA package) should not
282# set this variable to prevent OTA failures.
Anton Hanssond26c6472019-05-06 14:40:57 +0100283_product_list_vars += PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS
Anton Hansson13ea2a62019-03-28 14:47:25 +0000284
Tao Bao9be20c72019-04-08 21:11:59 -0700285# If set to true, this product builds a generic OTA package, which installs generic system images
286# onto matching devices. The product may only build a subset of system images (e.g. only
287# system.img), so devices need to install the package in a system-only OTA manner.
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100288_product_single_value_vars += PRODUCT_BUILD_GENERIC_OTA_PACKAGE
Tao Bao9be20c72019-04-08 21:11:59 -0700289
Anton Hanssond26c6472019-05-06 14:40:57 +0100290_product_list_vars += PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES
291_product_list_vars += PRODUCT_PACKAGE_NAME_OVERRIDES
292_product_list_vars += PRODUCT_CERTIFICATE_OVERRIDES
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100293
294# Controls for whether different partitions are built for the current product.
295_product_single_value_vars += PRODUCT_BUILD_SYSTEM_IMAGE
296_product_single_value_vars += PRODUCT_BUILD_SYSTEM_OTHER_IMAGE
297_product_single_value_vars += PRODUCT_BUILD_VENDOR_IMAGE
298_product_single_value_vars += PRODUCT_BUILD_PRODUCT_IMAGE
Justin Yun6151e3f2019-06-25 15:58:13 +0900299_product_single_value_vars += PRODUCT_BUILD_SYSTEM_EXT_IMAGE
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100300_product_single_value_vars += PRODUCT_BUILD_ODM_IMAGE
Yifan Hongcfb917a2020-05-07 14:58:20 -0700301_product_single_value_vars += PRODUCT_BUILD_VENDOR_DLKM_IMAGE
Yifan Hongf496f1b2020-07-15 16:52:59 -0700302_product_single_value_vars += PRODUCT_BUILD_ODM_DLKM_IMAGE
Ramji Jiyani13a41372022-01-27 07:05:08 +0000303_product_single_value_vars += PRODUCT_BUILD_SYSTEM_DLKM_IMAGE
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100304_product_single_value_vars += PRODUCT_BUILD_CACHE_IMAGE
305_product_single_value_vars += PRODUCT_BUILD_RAMDISK_IMAGE
306_product_single_value_vars += PRODUCT_BUILD_USERDATA_IMAGE
Chris Grossa784ef12019-04-22 11:09:57 -0700307_product_single_value_vars += PRODUCT_BUILD_RECOVERY_IMAGE
308_product_single_value_vars += PRODUCT_BUILD_BOOT_IMAGE
Devin Moore380d9e42021-11-04 19:01:19 +0000309_product_single_value_vars += PRODUCT_BUILD_INIT_BOOT_IMAGE
Yi-Yo Chiang4d7c6132021-09-29 19:41:11 +0800310_product_single_value_vars += PRODUCT_BUILD_DEBUG_BOOT_IMAGE
Daniel Norman42879ff2020-10-06 11:09:56 -0700311_product_single_value_vars += PRODUCT_BUILD_VENDOR_BOOT_IMAGE
Lucas Weif57333f2022-02-24 10:30:15 +0800312_product_single_value_vars += PRODUCT_BUILD_VENDOR_KERNEL_BOOT_IMAGE
Yi-Yo Chiang4d7c6132021-09-29 19:41:11 +0800313_product_single_value_vars += PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE
Paul Trautrim4e143232019-08-13 16:30:57 +0900314_product_single_value_vars += PRODUCT_BUILD_VBMETA_IMAGE
Yo Chiange86bab42021-03-25 10:12:28 +0000315_product_single_value_vars += PRODUCT_BUILD_SUPER_EMPTY_IMAGE
Pierre-Clément Tosifa8193c2021-09-24 15:49:00 +0200316_product_single_value_vars += PRODUCT_BUILD_PVMFW_IMAGE
Anton Hanssonc1c4c0b2019-05-06 15:09:19 +0100317
Martin Stjernholm743513c2021-07-05 20:53:57 +0100318# List of boot jars delivered via updatable APEXes, following the same format as
319# PRODUCT_BOOT_JARS.
satayev65e68bb2021-07-15 18:19:56 +0100320_product_list_vars += PRODUCT_APEX_BOOT_JARS
Chris Grossa784ef12019-04-22 11:09:57 -0700321
Yifan Hong7d37b402019-07-23 14:20:29 -0700322# If set, device uses virtual A/B.
323_product_single_value_vars += PRODUCT_VIRTUAL_AB_OTA
324
Kelvin Zhang239a79a2021-01-15 13:47:52 -0500325# If set, device uses virtual A/B Compression.
326_product_single_value_vars += PRODUCT_VIRTUAL_AB_COMPRESSION
327
Yifan Hong7d37b402019-07-23 14:20:29 -0700328# If set, device retrofits virtual A/B.
329_product_single_value_vars += PRODUCT_VIRTUAL_AB_OTA_RETROFIT
330
Yifan Hong65afc072020-04-17 10:08:10 -0700331# If set, forcefully generate a non-A/B update package.
332# Note: A device configuration should inherit from virtual_ab_ota_plus_non_ab.mk
333# instead of setting this variable directly.
334# Note: Use TARGET_OTA_ALLOW_NON_AB in the build system because
335# TARGET_OTA_ALLOW_NON_AB takes the value of AB_OTA_UPDATER into account.
336_product_single_value_vars += PRODUCT_OTA_FORCE_NON_AB_PACKAGE
337
Jeongik Cha74529792019-07-19 13:40:18 +0900338# If set, Java module in product partition cannot use hidden APIs.
339_product_single_value_vars += PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE
340
JaeMan Park33d9aad2020-12-02 16:34:12 +0900341# If set, only java_sdk_library can be used at inter-partition dependency.
342# Note: Build error if BOARD_VNDK_VERSION is not set while
343# PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY is true, because
344# PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY has no meaning if
345# BOARD_VNDK_VERSION is not set.
346# Note: When PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE is not set, there are
347# no restrictions at dependency between system and product partition.
348_product_single_value_vars += PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY
349
350# Allowlist for PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY option.
351# Listed modules are allowed at inter-partition dependency even if it isn't
352# a java_sdk_library module.
353_product_list_vars += PRODUCT_INTER_PARTITION_JAVA_LIBRARY_ALLOWLIST
354
Jooyung Han9efe5342019-12-05 16:14:18 +0900355_product_single_value_vars += PRODUCT_INSTALL_EXTRA_FLATTENED_APEXES
356
Yi-Yo Chiangf63bd5d2021-09-23 14:14:16 +0000357# Install a copy of the debug policy to the system_ext partition, and allow
358# init-second-stage to load debug policy from system_ext.
Yi-Yo Chiangb225d8c2021-10-18 18:32:46 +0800359# This option is only meant to be set by compliance GSI targets.
Yi-Yo Chiangf63bd5d2021-09-23 14:14:16 +0000360_product_single_value_vars += PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT
361
Victor Hsieh89415a82022-09-09 14:16:33 -0700362# If set, fsverity metadata files will be generated for each files in the
363# allowlist, plus an manifest APK per partition. For example,
364# /system/framework/service.jar will come with service.jar.fsv_meta in the same
365# directory; the file information will also be included in
366# /system/etc/security/fsverity/BuildManifest.apk
367_product_single_value_vars += PRODUCT_FSVERITY_GENERATE_METADATA
Inseob Kim9cda3972021-10-12 22:59:12 +0900368
Martin Stjernholm47dcbea2022-03-10 17:51:13 +0000369# If true, sets the default for MODULE_BUILD_FROM_SOURCE. This overrides
370# BRANCH_DEFAULT_MODULE_BUILD_FROM_SOURCE but not an explicitly set value.
371_product_single_value_vars += PRODUCT_MODULE_BUILD_FROM_SOURCE
372
Nikita Ioffebb9d6db2022-10-24 17:21:58 +0100373# If true, installs a full version of com.android.virt APEX.
374_product_single_value_vars += PRODUCT_AVF_ENABLED
375
Jiakai Zhangd6c6e3a2022-11-16 11:52:00 +0000376# Whether to use userfaultfd GC.
377# Possible values are:
378# - "default" or empty: both the build system and the runtime determine whether to use userfaultfd
379# GC based on the vendor API level
380# - "true": forces the build system to use userfaultfd GC regardless of the vendor API level; the
381# runtime determines whether to use userfaultfd GC based on the kernel support. Note that the
382# device may have to re-compile everything on the first boot if the kernel doesn't support
383# userfaultfd
384# - "false": disallows the build system and the runtime to use userfaultfd GC even if the device
385# supports it
386_product_single_value_vars += PRODUCT_ENABLE_UFFD_GC
387
Anton Hanssond26c6472019-05-06 14:40:57 +0100388.KATI_READONLY := _product_single_value_vars _product_list_vars
389_product_var_list :=$= $(_product_single_value_vars) $(_product_list_vars)
Ying Wang20ebd2e2014-10-07 18:07:23 -0700390
The Android Open Source Project88b60792009-03-03 19:28:42 -0800391#
Anton Hansson13ea2a62019-03-28 14:47:25 +0000392# Functions for including product makefiles
393#
394
395#
The Android Open Source Project88b60792009-03-03 19:28:42 -0800396# $(1): product to inherit
397#
Anton Hansson061cbcf2018-05-30 18:24:41 +0100398# To be called from product makefiles, and is later evaluated during the import-nodes
Cole Faust04727302022-02-28 10:49:33 -0800399# call below. It does the following:
The Android Open Source Project6a5f7f02009-03-05 14:34:30 -0800400# 1. Inherits all of the variables from $1.
401# 2. Records the inheritance in the .INHERITS_FROM variable
Anton Hansson061cbcf2018-05-30 18:24:41 +0100402#
Cole Faust04727302022-02-28 10:49:33 -0800403# (2) and the PRODUCTS variable can be used together to reconstruct the include hierarchy
Anton Hansson061cbcf2018-05-30 18:24:41 +0100404# See e.g. product-graph.mk for an example of this.
The Android Open Source Project6a5f7f02009-03-05 14:34:30 -0800405#
The Android Open Source Project88b60792009-03-03 19:28:42 -0800406define inherit-product
Cole Faust725aab22022-03-08 18:29:17 -0800407 $(eval _inherit_product_wildcard := $(wildcard $(1)))\
408 $(if $(_inherit_product_wildcard),,$(error $(1) does not exist.))\
409 $(foreach part,$(_inherit_product_wildcard),\
410 $(if $(findstring ../,$(part)),\
411 $(eval np := $(call normalize-paths,$(part))),\
412 $(eval np := $(strip $(part))))\
413 $(foreach v,$(_product_var_list), \
414 $(eval $(v) := $($(v)) $(INHERIT_TAG)$(np))) \
415 $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
416 $(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \
417 $(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \
Cole Faust7162b952022-06-24 14:37:33 -0700418 $(call dump-inherit,$(current_mk),$(1)) \
Cole Faust725aab22022-03-08 18:29:17 -0800419 $(call dump-config-vals,$(current_mk),inherit))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800420endef
421
Anton Hansson837425b2018-06-01 14:18:14 +0100422# Specifies a number of path prefixes, relative to PRODUCT_OUT, where the
423# product makefile hierarchy rooted in the current node places its artifacts.
424# Creating artifacts outside the specified paths will cause a build-time error.
425define require-artifacts-in-path
426 $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
427 $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENTS := $(strip $(1))) \
Colin Crossc3ad8042020-06-11 11:25:05 -0700428 $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_ALLOWED_LIST := $(strip $(2))) \
Anton Hansson837425b2018-06-01 14:18:14 +0100429 $(eval ARTIFACT_PATH_REQUIREMENT_PRODUCTS := \
430 $(sort $(ARTIFACT_PATH_REQUIREMENT_PRODUCTS) $(current_mk)))
431endef
Joe Onorato28a846d2010-02-22 10:33:05 -0800432
Anton Hanssond1258eb2020-12-08 12:13:50 +0000433# Like require-artifacts-in-path, but does not require all allow-list entries to
434# have an effect.
435define require-artifacts-in-path-relaxed
436 $(require-artifacts-in-path) \
437 $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENT_IS_RELAXED := true)
438endef
439
Yo Chiang1db657a2020-05-10 20:33:35 +0800440# Makes including non-existent modules in PRODUCT_PACKAGES an error.
Colin Crossc3ad8042020-06-11 11:25:05 -0700441# $(1): list of non-existent modules to allow.
Anton Hansson1ebcbd52018-07-04 17:17:23 +0100442define enforce-product-packages-exist
443 $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
444 $(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST := true) \
Colin Crossc3ad8042020-06-11 11:25:05 -0700445 $(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST := $(1)) \
Anton Hansson1ebcbd52018-07-04 17:17:23 +0100446 $(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST) \
Colin Crossc3ad8042020-06-11 11:25:05 -0700447 $(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST)
Anton Hansson1ebcbd52018-07-04 17:17:23 +0100448endef
449
Joe Onorato28a846d2010-02-22 10:33:05 -0800450#
451# Do inherit-product only if $(1) exists
452#
453define inherit-product-if-exists
454 $(if $(wildcard $(1)),$(call inherit-product,$(1)),)
455endef
456
The Android Open Source Project88b60792009-03-03 19:28:42 -0800457#
458# $(1): product makefile list
459#
460#TODO: check to make sure that products have all the necessary vars defined
461define import-products
Anton Hanssond26c6472019-05-06 14:40:57 +0100462$(call import-nodes,PRODUCTS,$(1),$(_product_var_list),$(_product_single_value_vars))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800463endef
464
465
466#
Cole Faust81f1e922022-04-08 11:12:10 -0700467# Does various consistency checks on the current product.
The Android Open Source Project88b60792009-03-03 19:28:42 -0800468# Takes no parameters, so $(call ) is not necessary.
469#
Cole Faust81f1e922022-04-08 11:12:10 -0700470define check-current-product
The Android Open Source Project88b60792009-03-03 19:28:42 -0800471$(if ,, \
Cole Faust81f1e922022-04-08 11:12:10 -0700472 $(if $(call is-c-identifier,$(PRODUCT_NAME)),, \
473 $(error $(INTERNAL_PRODUCT): PRODUCT_NAME must be a valid C identifier, not "$(pn)")) \
474 $(if $(PRODUCT_BRAND),, \
475 $(error $(INTERNAL_PRODUCT): PRODUCT_BRAND must be defined.)) \
476 $(foreach cf,$(strip $(PRODUCT_COPY_FILES)), \
477 $(if $(filter 2 3,$(words $(subst :,$(space),$(cf)))),, \
478 $(error $(p): malformed COPY_FILE "$(cf)"))))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800479endef
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400480
Anton Hansson13ea2a62019-03-28 14:47:25 +0000481# BoardConfig variables that are also inherited in product mks. Should ideally
482# be cleaned up to not be product variables.
483_readonly_late_variables := \
484 DEVICE_PACKAGE_OVERLAYS \
485 WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY \
486
487# Modified internally in the build system
488_readonly_late_variables += \
489 PRODUCT_COPY_FILES \
490 PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING \
491 PRODUCT_DEX_PREOPT_BOOT_FLAGS \
492
493_readonly_early_variables := $(filter-out $(_readonly_late_variables),$(_product_var_list))
Yifan Honge5d879a2018-11-27 11:37:38 -0800494
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400495#
Dan Willemsenc1f17ff2016-10-05 16:57:27 -0700496# Mark the variables in _product_stash_var_list as readonly
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400497#
Anton Hansson13ea2a62019-03-28 14:47:25 +0000498define readonly-variables
499$(foreach v,$(1), \
Anton Hansson70222b22019-02-21 10:41:03 +0000500 $(eval $(v) ?=) \
501 $(eval .KATI_READONLY := $(v)) \
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400502 )
503endef
Anton Hansson13ea2a62019-03-28 14:47:25 +0000504define readonly-product-vars
505$(call readonly-variables,$(_readonly_early_variables))
506endef
507
508define readonly-final-product-vars
509$(call readonly-variables,$(_readonly_late_variables))
510endef
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400511
Anton Hanssoncca8cdb2019-10-28 11:30:40 +0000512# Macro re-defined inside strip-product-vars.
513get-product-var = $(PRODUCTS.$(strip $(1)).$(2))
Yifan Honge5d879a2018-11-27 11:37:38 -0800514#
Anton Hansson528fdc02019-06-25 18:57:57 +0100515# Strip the variables in _product_var_list and a few build-system
516# internal variables, and assign the ones for the current product
517# to a shorthand that is more convenient to read from elsewhere.
Yifan Honge5d879a2018-11-27 11:37:38 -0800518#
519define strip-product-vars
Joe Onorato38a57bf2021-02-08 13:38:01 -0800520$(call dump-phase-start,PRODUCT-EXPAND,,$(_product_var_list),$(_product_single_value_vars), \
521 build/make/core/product.mk) \
Anton Hansson528fdc02019-06-25 18:57:57 +0100522$(foreach v,\
523 $(_product_var_list) \
524 PRODUCT_ENFORCE_PACKAGES_EXIST \
Colin Crossc3ad8042020-06-11 11:25:05 -0700525 PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST, \
Anton Hansson13ea2a62019-03-28 14:47:25 +0000526 $(eval $(v) := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).$(v)))) \
Anton Hanssoncca8cdb2019-10-28 11:30:40 +0000527 $(eval get-product-var = $$(if $$(filter $$(1),$$(INTERNAL_PRODUCT)),$$($$(2)),$$(PRODUCTS.$$(strip $$(1)).$$(2)))) \
528 $(KATI_obsolete_var PRODUCTS.$(INTERNAL_PRODUCT).$(v),Use $(v) instead) \
Joe Onorato38a57bf2021-02-08 13:38:01 -0800529) \
530$(call dump-phase-end,build/make/core/product.mk)
Yifan Honge5d879a2018-11-27 11:37:38 -0800531endef
532
Keun young Parkc41c5f42012-05-30 10:22:29 -0700533define add-to-product-copy-files-if-exists
534$(if $(wildcard $(word 1,$(subst :, ,$(1)))),$(1))
535endef
Ying Wang20ebd2e2014-10-07 18:07:23 -0700536
537# whitespace placeholder when we record module's dex-preopt config.
538_PDPMC_SP_PLACE_HOLDER := |@SP@|
539# Set up dex-preopt config for a module.
540# $(1) list of module names
541# $(2) the modules' dex-preopt config
542define add-product-dex-preopt-module-config
543$(eval _c := $(subst $(space),$(_PDPMC_SP_PLACE_HOLDER),$(strip $(2))))\
544$(eval PRODUCT_DEX_PREOPT_MODULE_CONFIGS += \
545 $(foreach m,$(1),$(m)=$(_c)))
546endef
Andreas Gampe6b30d772016-06-27 15:15:31 -0700547
548# whitespace placeholder when we record module's sanitizer config.
549_PSMC_SP_PLACE_HOLDER := |@SP@|
550# Set up sanitizer config for a module.
551# $(1) list of module names
552# $(2) the modules' sanitizer config
553define add-product-sanitizer-module-config
554$(eval _c := $(subst $(space),$(_PSMC_SP_PLACE_HOLDER),$(strip $(2))))\
555$(eval PRODUCT_SANITIZER_MODULE_CONFIGS += \
556 $(foreach m,$(1),$(m)=$(_c)))
557endef