1# 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 17# 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 25_product_single_value_vars += PRODUCT_NAME 26_product_single_value_vars += PRODUCT_MODEL 27_product_single_value_vars += PRODUCT_NAME_FOR_ATTESTATION 28_product_single_value_vars += PRODUCT_MODEL_FOR_ATTESTATION 29_product_single_value_vars += PRODUCT_BASE_OS 30 31# Defines the ELF segment alignment for binaries (executables and shared libraries). 32# The ELF segment alignment has to be a PAGE_SIZE multiple. For example, if 33# PRODUCT_MAX_PAGE_SIZE_SUPPORTED=65536, the possible values for PAGE_SIZE could be 34# 4096, 16384 and 65536. 35_product_single_value_vars += PRODUCT_MAX_PAGE_SIZE_SUPPORTED 36_product_single_value_vars += PRODUCT_CHECK_PREBUILT_MAX_PAGE_SIZE 37 38# Boolean variable determining if AOSP relies on bionic's PAGE_SIZE macro. 39_product_single_value_vars += PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO 40 41# The resource configuration options to use for this product. 42_product_list_vars += PRODUCT_LOCALES 43_product_list_vars += PRODUCT_AAPT_CONFIG 44_product_single_value_vars += PRODUCT_AAPT_PREF_CONFIG 45_product_list_vars += PRODUCT_AAPT_PREBUILT_DPI 46_product_list_vars += PRODUCT_HOST_PACKAGES 47_product_list_vars += PRODUCT_PACKAGES 48_product_list_vars += PRODUCT_PACKAGES_DEBUG 49_product_list_vars += PRODUCT_PACKAGES_DEBUG_ASAN 50_product_list_vars += PRODUCT_PACKAGES_ARM64 51 52# packages that are added to PRODUCT_PACKAGES based on the PRODUCT_SHIPPING_API_LEVEL 53# These are only added if the shipping API level is that level or lower 54_product_list_vars += PRODUCT_PACKAGES_SHIPPING_API_LEVEL_29 55_product_list_vars += PRODUCT_PACKAGES_SHIPPING_API_LEVEL_33 56_product_list_vars += PRODUCT_PACKAGES_SHIPPING_API_LEVEL_34 57 58# Packages included only for eng/userdebug builds, when building with EMMA_INSTRUMENT=true 59_product_list_vars += PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE 60_product_list_vars += PRODUCT_PACKAGES_ENG 61_product_list_vars += PRODUCT_PACKAGES_TESTS 62 63# The device that this product maps to. 64_product_single_value_vars += PRODUCT_DEVICE 65_product_single_value_vars += PRODUCT_MANUFACTURER 66_product_single_value_vars += PRODUCT_BRAND 67_product_single_value_vars += PRODUCT_BRAND_FOR_ATTESTATION 68 69# These PRODUCT_SYSTEM_* flags, if defined, are used in place of the 70# corresponding PRODUCT_* flags for the sysprops on /system. 71_product_single_value_vars += \ 72 PRODUCT_SYSTEM_NAME \ 73 PRODUCT_SYSTEM_MODEL \ 74 PRODUCT_SYSTEM_DEVICE \ 75 PRODUCT_SYSTEM_BRAND \ 76 PRODUCT_SYSTEM_MANUFACTURER \ 77 78# PRODUCT_<PARTITION>_PROPERTIES are lists of property assignments 79# that go to <partition>/build.prop. Each property assignment is 80# "key = value" with zero or more whitespace characters on either 81# side of the '='. 82_product_list_vars += \ 83 PRODUCT_SYSTEM_PROPERTIES \ 84 PRODUCT_SYSTEM_EXT_PROPERTIES \ 85 PRODUCT_VENDOR_PROPERTIES \ 86 PRODUCT_ODM_PROPERTIES \ 87 PRODUCT_PRODUCT_PROPERTIES 88 89# TODO(b/117892318) deprecate these: 90# ... in favor or PRODUCT_SYSTEM_PROPERTIES 91_product_list_vars += PRODUCT_SYSTEM_DEFAULT_PROPERTIES 92# ... in favor of PRODUCT_VENDOR_PROPERTIES 93_product_list_vars += PRODUCT_PROPERTY_OVERRIDES 94_product_list_vars += PRODUCT_DEFAULT_PROPERTY_OVERRIDES 95 96# TODO(b/117892318) consider deprecating these too 97_product_list_vars += PRODUCT_SYSTEM_PROPERTY_BLACKLIST 98_product_list_vars += PRODUCT_VENDOR_PROPERTY_BLACKLIST 99 100# The characteristics of the product, which among other things is passed to aapt 101_product_single_value_vars += PRODUCT_CHARACTERISTICS 102 103# A list of words like <source path>:<destination path>[:<owner>]. 104# The file at the source path should be copied to the destination path 105# when building this product. <destination path> is relative to 106# $(PRODUCT_OUT), so it should look like, e.g., "system/etc/file.xml". 107# The rules for these copy steps are defined in build/make/core/Makefile. 108# The optional :<owner> is used to indicate the owner of a vendor file. 109_product_list_vars += PRODUCT_COPY_FILES 110 111# The OTA key(s) specified by the product config, if any. The names 112# of these keys are stored in the target-files zip so that post-build 113# signing tools can substitute them for the test key embedded by 114# default. 115_product_list_vars += PRODUCT_OTA_PUBLIC_KEYS 116_product_list_vars += PRODUCT_EXTRA_OTA_KEYS 117_product_list_vars += PRODUCT_EXTRA_RECOVERY_KEYS 118 119# Should we use the default resources or add any product specific overlays 120_product_list_vars += PRODUCT_PACKAGE_OVERLAYS 121_product_list_vars += DEVICE_PACKAGE_OVERLAYS 122 123# Resource overlay list which must be excluded from enforcing RRO. 124_product_list_vars += PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS 125 126# Package list to apply enforcing RRO. 127_product_list_vars += PRODUCT_ENFORCE_RRO_TARGETS 128 129_product_list_vars += PRODUCT_SDK_ATREE_FILES 130_product_list_vars += PRODUCT_SDK_ADDON_NAME 131_product_list_vars += PRODUCT_SDK_ADDON_COPY_FILES 132_product_list_vars += PRODUCT_SDK_ADDON_COPY_MODULES 133_product_list_vars += PRODUCT_SDK_ADDON_DOC_MODULES 134_product_list_vars += PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP 135 136# which Soong namespaces to export to Make 137_product_list_vars += PRODUCT_SOONG_NAMESPACES 138 139_product_list_vars += PRODUCT_DEFAULT_WIFI_CHANNELS 140_product_single_value_vars += PRODUCT_DEFAULT_DEV_CERTIFICATE 141_product_list_vars += PRODUCT_MAINLINE_SEPOLICY_DEV_CERTIFICATES 142_product_list_vars += PRODUCT_RESTRICT_VENDOR_FILES 143 144# The list of product-specific kernel header dirs 145_product_list_vars += PRODUCT_VENDOR_KERNEL_HEADERS 146 147# A list of module names in BOOTCLASSPATH (jar files). Each module may be 148# prefixed with "<apex>:", which identifies the APEX that provides it. APEXes 149# are identified by their "variant" names, i.e. their `apex_name` values in 150# Soong, which default to the `name` values. The prefix can also be "platform:" 151# or "system_ext:", and defaults to "platform:" if left out. See the long 152# comment in build/soong/java/dexprepopt_bootjars.go for details. 153_product_list_vars += PRODUCT_BOOT_JARS 154 155# A list of extra BOOTCLASSPATH jars (to be appended after common jars), 156# following the same format as PRODUCT_BOOT_JARS. Products that include 157# device-specific makefiles before AOSP makefiles should use this instead of 158# PRODUCT_BOOT_JARS, so that device-specific jars go after common jars. 159_product_list_vars += PRODUCT_BOOT_JARS_EXTRA 160 161# List of jars to be included in the ART boot image for testing. 162_product_list_vars += PRODUCT_TEST_ONLY_ART_BOOT_IMAGE_JARS 163 164_product_list_vars += PRODUCT_SYSTEM_SERVER_APPS 165# List of system_server classpath jars on the platform. 166_product_list_vars += PRODUCT_SYSTEM_SERVER_JARS 167# List of system_server classpath jars delivered via apex. Format = <apex name>:<jar name>. 168_product_list_vars += PRODUCT_APEX_SYSTEM_SERVER_JARS 169# List of jars on the platform that system_server loads dynamically using separate classloaders. 170_product_list_vars += PRODUCT_STANDALONE_SYSTEM_SERVER_JARS 171# List of jars delivered via apex that system_server loads dynamically using separate classloaders. 172# Format = <apex name>:<jar name> 173_product_list_vars += PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS 174# If true, then suboptimal order of system server jars does not cause an error. 175_product_single_value_vars += PRODUCT_BROKEN_SUBOPTIMAL_ORDER_OF_SYSTEM_SERVER_JARS 176# If true, then system server jars defined in Android.mk are supported. 177_product_single_value_vars += PRODUCT_BROKEN_DEPRECATED_MK_SYSTEM_SERVER_JARS 178 179# Additional system server jars to be appended at the end of the common list. 180# This is necessary to avoid jars reordering due to makefile inheritance order. 181_product_list_vars += PRODUCT_SYSTEM_SERVER_JARS_EXTRA 182 183# Set to true to disable <uses-library> checks for a product. 184_product_list_vars += PRODUCT_BROKEN_VERIFY_USES_LIBRARIES 185 186_product_list_vars += PRODUCT_DEXPREOPT_SPEED_APPS 187_product_list_vars += PRODUCT_LOADED_BY_PRIVILEGED_MODULES 188_product_single_value_vars += PRODUCT_VBOOT_SIGNING_KEY 189_product_single_value_vars += PRODUCT_VBOOT_SIGNING_SUBKEY 190_product_single_value_vars += PRODUCT_SYSTEM_VERITY_PARTITION 191_product_single_value_vars += PRODUCT_VENDOR_VERITY_PARTITION 192_product_single_value_vars += PRODUCT_PRODUCT_VERITY_PARTITION 193_product_single_value_vars += PRODUCT_SYSTEM_EXT_VERITY_PARTITION 194_product_single_value_vars += PRODUCT_ODM_VERITY_PARTITION 195_product_single_value_vars += PRODUCT_VENDOR_DLKM_VERITY_PARTITION 196_product_single_value_vars += PRODUCT_ODM_DLKM_VERITY_PARTITION 197_product_single_value_vars += PRODUCT_SYSTEM_DLKM_VERITY_PARTITION 198_product_single_value_vars += PRODUCT_SYSTEM_SERVER_DEBUG_INFO 199_product_single_value_vars += PRODUCT_OTHER_JAVA_DEBUG_INFO 200 201# Per-module dex-preopt configs. 202_product_list_vars += PRODUCT_DEX_PREOPT_MODULE_CONFIGS 203_product_single_value_vars += PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER 204_product_list_vars += PRODUCT_DEX_PREOPT_DEFAULT_FLAGS 205_product_single_value_vars += PRODUCT_DEX_PREOPT_BOOT_FLAGS 206_product_single_value_vars += PRODUCT_DEX_PREOPT_PROFILE_DIR 207_product_single_value_vars += PRODUCT_DEX_PREOPT_GENERATE_DM_FILES 208_product_single_value_vars += PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING 209_product_single_value_vars += PRODUCT_DEX_PREOPT_RESOLVE_STARTUP_STRINGS 210 211# Boot image options. 212_product_list_vars += PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION 213_product_single_value_vars += \ 214 PRODUCT_EXPORT_BOOT_IMAGE_TO_DIST \ 215 PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE \ 216 PRODUCT_USES_DEFAULT_ART_CONFIG \ 217 218_product_single_value_vars += PRODUCT_SYSTEM_SERVER_COMPILER_FILTER 219# Per-module sanitizer configs 220_product_list_vars += PRODUCT_SANITIZER_MODULE_CONFIGS 221_product_single_value_vars += PRODUCT_SYSTEM_BASE_FS_PATH 222_product_single_value_vars += PRODUCT_VENDOR_BASE_FS_PATH 223_product_single_value_vars += PRODUCT_PRODUCT_BASE_FS_PATH 224_product_single_value_vars += PRODUCT_SYSTEM_EXT_BASE_FS_PATH 225_product_single_value_vars += PRODUCT_ODM_BASE_FS_PATH 226_product_single_value_vars += PRODUCT_VENDOR_DLKM_BASE_FS_PATH 227_product_single_value_vars += PRODUCT_ODM_DLKM_BASE_FS_PATH 228_product_single_value_vars += PRODUCT_SYSTEM_DLKM_BASE_FS_PATH 229 230# The first API level this product shipped with 231_product_single_value_vars += PRODUCT_SHIPPING_API_LEVEL 232 233# The first vendor API level this product shipped with 234_product_single_value_vars += PRODUCT_SHIPPING_VENDOR_API_LEVEL 235 236_product_list_vars += VENDOR_PRODUCT_RESTRICT_VENDOR_FILES 237_product_list_vars += VENDOR_EXCEPTION_MODULES 238_product_list_vars += VENDOR_EXCEPTION_PATHS 239# Whether the product wants to ship libartd. For rules and meaning, see art/Android.mk. 240_product_single_value_vars += PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD 241 242# Make this art variable visible to soong_config.mk. 243_product_single_value_vars += PRODUCT_ART_USE_READ_BARRIER 244 245# Add reserved headroom to a system image. 246_product_single_value_vars += PRODUCT_SYSTEM_HEADROOM 247 248# Whether to save disk space by minimizing java debug info 249_product_single_value_vars += PRODUCT_MINIMIZE_JAVA_DEBUG_INFO 250 251# Whether any paths are excluded from sanitization when SANITIZE_TARGET=integer_overflow 252_product_list_vars += PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS 253 254_product_single_value_vars += PRODUCT_ADB_KEYS 255 256# Whether any paths should have CFI enabled for components 257_product_list_vars += PRODUCT_CFI_INCLUDE_PATHS 258 259# Whether any paths are excluded from sanitization when SANITIZE_TARGET=cfi 260_product_list_vars += PRODUCT_CFI_EXCLUDE_PATHS 261 262# Whether any paths should have HWASan enabled for components 263_product_list_vars += PRODUCT_HWASAN_INCLUDE_PATHS 264 265# Whether any paths are excluded from sanitization when SANITIZE_TARGET=hwaddress 266_product_list_vars += PRODUCT_HWASAN_EXCLUDE_PATHS 267 268# Whether any paths should have Memtag_heap enabled for components 269_product_list_vars += PRODUCT_MEMTAG_HEAP_ASYNC_INCLUDE_PATHS 270_product_list_vars += PRODUCT_MEMTAG_HEAP_ASYNC_DEFAULT_INCLUDE_PATHS 271_product_list_vars += PRODUCT_MEMTAG_HEAP_SYNC_INCLUDE_PATHS 272_product_list_vars += PRODUCT_MEMTAG_HEAP_SYNC_DEFAULT_INCLUDE_PATHS 273_product_list_vars += PRODUCT_MEMTAG_HEAP_EXCLUDE_PATHS 274 275# Whether this product wants to start with an empty list of default memtag_heap include paths 276_product_single_value_vars += PRODUCT_MEMTAG_HEAP_SKIP_DEFAULT_PATHS 277 278# Whether the Scudo hardened allocator is disabled platform-wide 279_product_single_value_vars += PRODUCT_DISABLE_SCUDO 280 281# List of extra VNDK versions to be included 282_product_list_vars += PRODUCT_EXTRA_VNDK_VERSIONS 283 284# Whether APEX should be compressed or not 285_product_single_value_vars += PRODUCT_COMPRESSED_APEX 286 287# Default fs type for APEX payload image (apex_payload.img) 288_product_single_value_vars += PRODUCT_DEFAULT_APEX_PAYLOAD_TYPE 289 290# VNDK version of product partition. It can be 'current' if the product 291# partitions uses PLATFORM_VNDK_VERSION. 292_product_single_value_vars += PRODUCT_PRODUCT_VNDK_VERSION 293 294_product_single_value_vars += PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS 295_product_single_value_vars += PRODUCT_ENFORCE_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT 296_product_list_vars += PRODUCT_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT_ALLOW_LIST 297_product_list_vars += PRODUCT_ARTIFACT_PATH_REQUIREMENT_HINT 298_product_list_vars += PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST 299 300# List of modules that should be forcefully unmarked from being LOCAL_PRODUCT_MODULE, and hence 301# installed on /system directory by default. 302_product_list_vars += PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION 303 304# When this is true, dynamic partitions is retrofitted on a device that has 305# already been launched without dynamic partitions. Otherwise, the device 306# is launched with dynamic partitions. 307# This flag implies PRODUCT_USE_DYNAMIC_PARTITIONS. 308_product_single_value_vars += PRODUCT_RETROFIT_DYNAMIC_PARTITIONS 309 310# List of directories that will be used to gate blueprint modules from the build graph 311_product_list_vars += PRODUCT_SOURCE_ROOT_DIRS 312 313# When this is true, various build time as well as runtime debugfs restrictions are enabled. 314_product_single_value_vars += PRODUCT_SET_DEBUGFS_RESTRICTIONS 315 316# Other dynamic partition feature flags.PRODUCT_USE_DYNAMIC_PARTITION_SIZE and 317# PRODUCT_BUILD_SUPER_PARTITION default to the value of PRODUCT_USE_DYNAMIC_PARTITIONS. 318_product_single_value_vars += \ 319 PRODUCT_USE_DYNAMIC_PARTITIONS \ 320 PRODUCT_USE_DYNAMIC_PARTITION_SIZE \ 321 PRODUCT_BUILD_SUPER_PARTITION \ 322 323# If set, kernel configuration requirements are present in OTA package (and will be enforced 324# during OTA). Otherwise, kernel configuration requirements are enforced in VTS. 325# Devices that checks the running kernel (instead of the kernel in OTA package) should not 326# set this variable to prevent OTA failures. 327_product_list_vars += PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS 328 329# If set to true, this product forces HIDL to be enabled by declaring android.hidl.manager 330# and android.hidl.token in the framework manifest. The product will also need to add the 331# 'hwservicemanager' service to PRODUCT_PACKAGES if its SHIPPING_API_LEVEL is greater than 34. 332# This should only be used during bringup for devices that are targeting FCM 202404 and still 333# have partner-owned HIDL interfaces that are being converted to AIDL. 334_product_single_value_vars += PRODUCT_HIDL_ENABLED 335 336# If set to true, this product builds a generic OTA package, which installs generic system images 337# onto matching devices. The product may only build a subset of system images (e.g. only 338# system.img), so devices need to install the package in a system-only OTA manner. 339_product_single_value_vars += PRODUCT_BUILD_GENERIC_OTA_PACKAGE 340 341_product_list_vars += PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES 342_product_list_vars += PRODUCT_PACKAGE_NAME_OVERRIDES 343_product_list_vars += PRODUCT_CERTIFICATE_OVERRIDES 344 345# Overrides the (apex, jar) pairs above when determining the on-device location. The format is: 346# <old_apex>:<old_jar>:<new_apex>:<new_jar> 347_product_list_vars += PRODUCT_CONFIGURED_JAR_LOCATION_OVERRIDES 348 349# Controls for whether different partitions are built for the current product. 350_product_single_value_vars += PRODUCT_BUILD_SYSTEM_IMAGE 351_product_single_value_vars += PRODUCT_BUILD_SYSTEM_OTHER_IMAGE 352_product_single_value_vars += PRODUCT_BUILD_VENDOR_IMAGE 353_product_single_value_vars += PRODUCT_BUILD_PRODUCT_IMAGE 354_product_single_value_vars += PRODUCT_BUILD_SYSTEM_EXT_IMAGE 355_product_single_value_vars += PRODUCT_BUILD_ODM_IMAGE 356_product_single_value_vars += PRODUCT_BUILD_VENDOR_DLKM_IMAGE 357_product_single_value_vars += PRODUCT_BUILD_ODM_DLKM_IMAGE 358_product_single_value_vars += PRODUCT_BUILD_SYSTEM_DLKM_IMAGE 359_product_single_value_vars += PRODUCT_BUILD_CACHE_IMAGE 360_product_single_value_vars += PRODUCT_BUILD_RAMDISK_IMAGE 361_product_single_value_vars += PRODUCT_BUILD_USERDATA_IMAGE 362_product_single_value_vars += PRODUCT_BUILD_RECOVERY_IMAGE 363_product_single_value_vars += PRODUCT_BUILD_BOOT_IMAGE 364_product_single_value_vars += PRODUCT_BUILD_INIT_BOOT_IMAGE 365_product_single_value_vars += PRODUCT_BUILD_DEBUG_BOOT_IMAGE 366_product_single_value_vars += PRODUCT_BUILD_VENDOR_BOOT_IMAGE 367_product_single_value_vars += PRODUCT_BUILD_VENDOR_KERNEL_BOOT_IMAGE 368_product_single_value_vars += PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE 369_product_single_value_vars += PRODUCT_BUILD_VBMETA_IMAGE 370_product_single_value_vars += PRODUCT_BUILD_SUPER_EMPTY_IMAGE 371_product_single_value_vars += PRODUCT_BUILD_PVMFW_IMAGE 372_product_single_value_vars += PRODUCT_BUILD_DESKTOP_RECOVERY_IMAGE 373_product_single_value_vars += PRODUCT_BUILD_DESKTOP_UPDATE_IMAGE 374 375# List of boot jars delivered via updatable APEXes, following the same format as 376# PRODUCT_BOOT_JARS. 377_product_list_vars += PRODUCT_APEX_BOOT_JARS 378 379# If set, device uses virtual A/B. 380_product_single_value_vars += PRODUCT_VIRTUAL_AB_OTA 381 382# If set, device uses virtual A/B Compression. 383_product_single_value_vars += PRODUCT_VIRTUAL_AB_COMPRESSION 384 385# If set, device retrofits virtual A/B. 386_product_single_value_vars += PRODUCT_VIRTUAL_AB_OTA_RETROFIT 387 388# If set, forcefully generate a non-A/B update package. 389# Note: A device configuration should inherit from virtual_ab_ota_plus_non_ab.mk 390# instead of setting this variable directly. 391# Note: Use TARGET_OTA_ALLOW_NON_AB in the build system because 392# TARGET_OTA_ALLOW_NON_AB takes the value of AB_OTA_UPDATER into account. 393_product_single_value_vars += PRODUCT_OTA_FORCE_NON_AB_PACKAGE 394 395# If set, Java module in product partition cannot use hidden APIs. 396_product_single_value_vars += PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE 397 398# Install a copy of the debug policy to the system_ext partition, and allow 399# init-second-stage to load debug policy from system_ext. 400# This option is only meant to be set by compliance GSI targets. 401_product_single_value_vars += PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT 402 403# If set, fsverity metadata files will be generated for each files in the 404# allowlist, plus an manifest APK per partition. For example, 405# /system/framework/service.jar will come with service.jar.fsv_meta in the same 406# directory; the file information will also be included in 407# /system/etc/security/fsverity/BuildManifest.apk 408_product_single_value_vars += PRODUCT_FSVERITY_GENERATE_METADATA 409 410# If true, this builds the mainline modules from source. This overrides any 411# prebuilts selected via RELEASE_APEX_CONTRIBUTIONS_* build flags for the 412# current release config. 413_product_single_value_vars += PRODUCT_MODULE_BUILD_FROM_SOURCE 414 415# If true, installs a full version of com.android.virt APEX. 416_product_single_value_vars += PRODUCT_AVF_ENABLED 417 418# If false, disable the AVF remote attestaton feature. 419_product_single_value_vars += PRODUCT_AVF_REMOTE_ATTESTATION_DISABLED 420 421# If true, kernel with modules will be used for Microdroid VMs. 422_product_single_value_vars += PRODUCT_AVF_KERNEL_MODULES_ENABLED 423 424# If true, the memory controller will be force-enabled in the cgroup v2 hierarchy 425_product_single_value_vars += PRODUCT_MEMCG_V2_FORCE_ENABLED 426 427# If true, the cgroup v2 hierarchy will be split into apps/system subtrees 428_product_single_value_vars += PRODUCT_CGROUP_V2_SYS_APP_ISOLATION_ENABLED 429 430# List of .json files to be merged/compiled into vendor/etc/linker.config.pb and product/etc/linker.config.pb 431_product_list_vars += PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS 432_product_list_vars += PRODUCT_PRODUCT_LINKER_CONFIG_FRAGMENTS 433 434# Whether to use userfaultfd GC. 435# Possible values are: 436# - "default" or empty: both the build system and the runtime determine whether to use userfaultfd 437# GC based on the vendor API level 438# - "true": forces the build system to use userfaultfd GC regardless of the vendor API level; the 439# runtime determines whether to use userfaultfd GC based on the kernel support. Note that the 440# device may have to re-compile everything on the first boot if the kernel doesn't support 441# userfaultfd 442# - "false": disallows the build system and the runtime to use userfaultfd GC even if the device 443# supports it. This option is temporary - the plan is to remove it by Aug 2025, at which time 444# Mainline updates of the ART module will ignore it as well. 445_product_single_value_vars += PRODUCT_ENABLE_UFFD_GC 446 447# Specifies COW version to be used by update_engine and libsnapshot. If this value is not 448# specified we default to COW version 2 in update_engine for backwards compatibility 449_product_single_value_vars += PRODUCT_VIRTUAL_AB_COW_VERSION 450 451# Specifies maximum bytes to be compressed at once during ota. Options: 4096, 8192, 16384, 32768, 65536, 131072, 262144. 452_product_single_value_vars += PRODUCT_VIRTUAL_AB_COMPRESSION_FACTOR 453 454# If set, determines whether the build system checks vendor seapp contexts violations. 455_product_single_value_vars += PRODUCT_CHECK_VENDOR_SEAPP_VIOLATIONS 456 457# If set, determines whether the build system checks dev type violations. 458_product_single_value_vars += PRODUCT_CHECK_DEV_TYPE_VIOLATIONS 459 460_product_list_vars += PRODUCT_AFDO_PROFILES 461 462_product_single_value_vars += PRODUCT_SCUDO_ALLOCATION_RING_BUFFER_SIZE 463 464_product_list_vars += PRODUCT_RELEASE_CONFIG_MAPS 465 466_product_list_vars += PRODUCT_VALIDATION_CHECKS 467 468_product_single_value_vars += PRODUCT_BUILD_FROM_SOURCE_STUB 469 470_product_single_value_vars += PRODUCT_BUILD_IGNORE_APEX_CONTRIBUTION_CONTENTS 471 472_product_single_value_vars += PRODUCT_HIDDEN_API_EXPORTABLE_STUBS 473 474_product_single_value_vars += PRODUCT_EXPORT_RUNTIME_APIS 475 476# If set, determines which version of the GKI is used as guest kernel for Microdroid VMs. 477# TODO(b/325991735): link to documentation once it is done. 478_product_single_value_vars += PRODUCT_AVF_MICRODROID_GUEST_GKI_VERSION 479 480# Enables 16KB developer option for device if set. 481_product_single_value_vars += PRODUCT_16K_DEVELOPER_OPTION 482 483# If set, adb root will be disabled (really ro.debuggable=0) in userdebug 484# builds. It's already off disabled in user builds. Eng builds are unaffected 485# by this flag. 486_product_single_value_vars += PRODUCT_NOT_DEBUGGABLE_IN_USERDEBUG 487 488# If set, the default value of the versionName of apps will include the build number. 489_product_single_value_vars += PRODUCT_BUILD_APPS_WITH_BUILD_NUMBER 490 491# If set, build would generate system image from Soong-defined module. 492_product_single_value_vars += PRODUCT_SOONG_DEFINED_SYSTEM_IMAGE 493 494# List of stub libraries specific to the product that are already present in the system image and 495# should be included in the system_linker_config. 496_product_list_vars += PRODUCT_EXTRA_STUB_LIBRARIES 497 498# If set to true, all Android.mk files will be ignored. 499_product_single_value_vars += PRODUCT_IGNORE_ALL_ANDROIDMK 500# When PRODUCT_IGNORE_ALL_ANDROIDMK is set to true, this variable will be used to allow some Android.mk files. 501_product_list_vars += PRODUCT_ALLOWED_ANDROIDMK_FILES 502# When PRODUCT_IGNORE_ALL_ANDROIDMK is set to true, path of file that contains a list of allowed Android.mk files 503_product_single_value_vars += PRODUCT_ANDROIDMK_ALLOWLIST_FILE 504 505.KATI_READONLY := _product_single_value_vars _product_list_vars 506_product_var_list :=$= $(_product_single_value_vars) $(_product_list_vars) 507 508# 509# Functions for including product makefiles 510# 511 512# 513# $(1): product to inherit 514# 515# To be called from product makefiles, and is later evaluated during the import-nodes 516# call below. It does the following: 517# 1. Inherits all of the variables from $1. 518# 2. Records the inheritance in the .INHERITS_FROM variable 519# 520# (2) and the PRODUCTS variable can be used together to reconstruct the include hierarchy 521# See e.g. product-graph.mk for an example of this. 522# 523define inherit-product 524 $(eval _inherit_product_wildcard := $(wildcard $(1)))\ 525 $(if $(_inherit_product_wildcard),,$(error $(1) does not exist.))\ 526 $(foreach part,$(_inherit_product_wildcard),\ 527 $(if $(findstring ../,$(part)),\ 528 $(eval np := $(call normalize-paths,$(part))),\ 529 $(eval np := $(strip $(part))))\ 530 $(foreach v,$(_product_var_list), \ 531 $(eval $(v) := $($(v)) $(INHERIT_TAG)$(np))) \ 532 $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \ 533 $(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \ 534 $(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \ 535 $(call dump-inherit,$(current_mk),$(1)) \ 536 $(call dump-config-vals,$(current_mk),inherit)) 537endef 538 539# Specifies a number of path prefixes, relative to PRODUCT_OUT, where the 540# product makefile hierarchy rooted in the current node places its artifacts. 541# Creating artifacts outside the specified paths will cause a build-time error. 542define require-artifacts-in-path 543 $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \ 544 $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENTS := $(strip $(1))) \ 545 $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_ALLOWED_LIST := $(strip $(2))) \ 546 $(eval ARTIFACT_PATH_REQUIREMENT_PRODUCTS := \ 547 $(sort $(ARTIFACT_PATH_REQUIREMENT_PRODUCTS) $(current_mk))) 548endef 549 550# Like require-artifacts-in-path, but does not require all allow-list entries to 551# have an effect. 552define require-artifacts-in-path-relaxed 553 $(require-artifacts-in-path) \ 554 $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENT_IS_RELAXED := true) 555endef 556 557# Makes including non-existent modules in PRODUCT_PACKAGES an error. 558# $(1): list of non-existent modules to allow. 559define enforce-product-packages-exist 560 $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \ 561 $(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST := true) \ 562 $(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST := $(1)) \ 563 $(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST) \ 564 $(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST) 565endef 566 567# 568# Do inherit-product only if $(1) exists 569# 570define inherit-product-if-exists 571 $(if $(wildcard $(1)),$(call inherit-product,$(1)),) 572endef 573 574# 575# $(1): product makefile list 576# 577#TODO: check to make sure that products have all the necessary vars defined 578define import-products 579$(call import-nodes,PRODUCTS,$(1),$(_product_var_list),$(_product_single_value_vars)) 580endef 581 582 583# 584# Does various consistency checks on the current product. 585# Takes no parameters, so $(call ) is not necessary. 586# 587define check-current-product 588$(if ,, \ 589 $(if $(call is-c-identifier,$(PRODUCT_NAME)),, \ 590 $(error $(INTERNAL_PRODUCT): PRODUCT_NAME must be a valid C identifier, not "$(pn)")) \ 591 $(if $(PRODUCT_BRAND),, \ 592 $(error $(INTERNAL_PRODUCT): PRODUCT_BRAND must be defined.)) \ 593 $(foreach cf,$(strip $(PRODUCT_COPY_FILES)), \ 594 $(if $(filter 2 3,$(words $(subst :,$(space),$(cf)))),, \ 595 $(error $(p): malformed COPY_FILE "$(cf)")))) 596endef 597 598# BoardConfig variables that are also inherited in product mks. Should ideally 599# be cleaned up to not be product variables. 600_readonly_late_variables := \ 601 DEVICE_PACKAGE_OVERLAYS \ 602 WITH_DEXPREOPT_ART_BOOT_IMG_ONLY \ 603 604# Modified internally in the build system 605_readonly_late_variables += \ 606 PRODUCT_COPY_FILES \ 607 PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING \ 608 PRODUCT_DEX_PREOPT_BOOT_FLAGS \ 609 610_readonly_early_variables := $(filter-out $(_readonly_late_variables),$(_product_var_list)) 611 612# 613# Mark the variables in _product_stash_var_list as readonly 614# 615define readonly-variables 616$(foreach v,$(1), \ 617 $(eval $(v) ?=) \ 618 $(eval .KATI_READONLY := $(v)) \ 619 ) 620endef 621define readonly-product-vars 622$(call readonly-variables,$(_readonly_early_variables)) 623endef 624 625define readonly-final-product-vars 626$(call readonly-variables,$(_readonly_late_variables)) 627endef 628 629# Macro re-defined inside strip-product-vars. 630get-product-var = $(PRODUCTS.$(strip $(1)).$(2)) 631# 632# Strip the variables in _product_var_list and a few build-system 633# internal variables, and assign the ones for the current product 634# to a shorthand that is more convenient to read from elsewhere. 635# 636define strip-product-vars 637$(call dump-phase-start,PRODUCT-EXPAND,,$(_product_var_list),$(_product_single_value_vars), \ 638 build/make/core/product.mk) \ 639$(foreach v,\ 640 $(_product_var_list) \ 641 PRODUCT_ENFORCE_PACKAGES_EXIST \ 642 PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST, \ 643 $(eval $(v) := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).$(v)))) \ 644 $(eval get-product-var = $$(if $$(filter $$(1),$$(INTERNAL_PRODUCT)),$$($$(2)),$$(PRODUCTS.$$(strip $$(1)).$$(2)))) \ 645 $(KATI_obsolete_var PRODUCTS.$(INTERNAL_PRODUCT).$(v),Use $(v) instead) \ 646) \ 647$(call dump-phase-end,build/make/core/product.mk) 648endef 649 650define add-to-product-copy-files-if-exists 651$(if $(wildcard $(word 1,$(subst :, ,$(1)))),$(1)) 652endef 653 654# whitespace placeholder when we record module's dex-preopt config. 655_PDPMC_SP_PLACE_HOLDER := |@SP@| 656# Set up dex-preopt config for a module. 657# $(1) list of module names 658# $(2) the modules' dex-preopt config 659define add-product-dex-preopt-module-config 660$(eval _c := $(subst $(space),$(_PDPMC_SP_PLACE_HOLDER),$(strip $(2))))\ 661$(eval PRODUCT_DEX_PREOPT_MODULE_CONFIGS += \ 662 $(foreach m,$(1),$(m)=$(_c))) 663endef 664 665# whitespace placeholder when we record module's sanitizer config. 666_PSMC_SP_PLACE_HOLDER := |@SP@| 667# Set up sanitizer config for a module. 668# $(1) list of module names 669# $(2) the modules' sanitizer config 670define add-product-sanitizer-module-config 671$(eval _c := $(subst $(space),$(_PSMC_SP_PLACE_HOLDER),$(strip $(2))))\ 672$(eval PRODUCT_SANITIZER_MODULE_CONFIGS += \ 673 $(foreach m,$(1),$(m)=$(_c))) 674endef 675