# This is included by the top-level Makefile. # It sets up standard variables based on the # current configuration and platform, which # are not specific to what is being built.
ifndef KATI
$(warning Directly using config.mk from make is no longer supported.)
$(warning )
$(warning If you are just attempting to build, you probably need to re-source envsetup.sh:)
$(warning )
$(warning $$ source build/envsetup.sh)
$(warning )
$(warning If you are attempting to emulate get_build_var, use one of the following:)
$(warning $$ build/soong/soong_ui.bash --dumpvar-mode)
$(warning $$ build/soong/soong_ui.bash --dumpvars-mode)
$(warning )
$(error done) endif
# ----------------------------------------------------------------- # Rules and functions to help copy important files to DIST_DIR # when requested. This must be included once only, and must be included before # soong_config (as soong_config calls make_vars-$(TARGET).mk, and soong may # propagate calls to dist-for-goals there). include $(BUILD_SYSTEM)/distdir.mk
# Mark variables that should be coming as environment variables from soong_ui # as readonly
.KATI_READONLY := OUT_DIR TMPDIR BUILD_DATETIME_FILE
ifdef CALLED_FROM_SETUP
.KATI_READONLY := CALLED_FROM_SETUP endif
ifdef KATI_PACKAGE_MK_DIR
.KATI_READONLY := KATI_PACKAGE_MK_DIR endif
# Mark variables deprecated/obsolete
CHANGES_URL := https://android.googlesource.com/platform/build/+/master/Changes.md
.KATI_READONLY := CHANGES_URL
$(KATI_deprecated_var TARGET_USES_64_BIT_BINDER,All devices use 64-bit binder by default now. Uses of TARGET_USES_64_BIT_BINDER should be removed.)
$(KATI_deprecated_var PRODUCT_SEPOLICY_SPLIT,All devices are built with split sepolicy.)
$(KATI_deprecated_var PRODUCT_SEPOLICY_SPLIT_OVERRIDE,All devices are built with split sepolicy.)
$(KATI_obsolete_var PATH,Do not use PATH directly. See $(CHANGES_URL)#PATH)
$(KATI_obsolete_var PYTHONPATH,Do not use PYTHONPATH directly. See $(CHANGES_URL)#PYTHONPATH)
$(KATI_obsolete_var OUT,Use OUT_DIR instead. See $(CHANGES_URL)#OUT)
$(KATI_obsolete_var ANDROID_HOST_OUT,Use HOST_OUT instead. See $(CHANGES_URL)#ANDROID_HOST_OUT)
$(KATI_obsolete_var ANDROID_PRODUCT_OUT,Use PRODUCT_OUT instead. See $(CHANGES_URL)#ANDROID_PRODUCT_OUT)
$(KATI_obsolete_var ANDROID_HOST_OUT_TESTCASES,Use HOST_OUT_TESTCASES instead. See $(CHANGES_URL)#ANDROID_HOST_OUT_TESTCASES)
$(KATI_obsolete_var ANDROID_TARGET_OUT_TESTCASES,Use TARGET_OUT_TESTCASES instead. See $(CHANGES_URL)#ANDROID_TARGET_OUT_TESTCASES)
$(KATI_obsolete_var ANDROID_BUILD_TOP,Use '.' instead. See $(CHANGES_URL)#ANDROID_BUILD_TOP)
$(KATI_obsolete_var \
ANDROID_TOOLCHAIN \
ANDROID_TOOLCHAIN_2ND_ARCH \
ANDROID_DEV_SCRIPTS \
ANDROID_EMULATOR_PREBUILTS \
ANDROID_PRE_BUILD_PATHS \
,See $(CHANGES_URL)#other_envsetup_variables)
$(KATI_obsolete_var PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE,Set FCM Version in device manifest instead. See $(CHANGES_URL)#PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE)
$(KATI_obsolete_var USE_CLANG_PLATFORM_BUILD,Clang is the only supported Android compiler. See $(CHANGES_URL)#USE_CLANG_PLATFORM_BUILD)
$(KATI_obsolete_var BUILD_DROIDDOC,Droiddoc is only supported in Soong. See details on build/soong/java/droiddoc.go)
$(KATI_obsolete_var BUILD_APIDIFF,Apidiff is only supported in Soong. See details on build/soong/java/droiddoc.go)
$(KATI_obsolete_var \
DEFAULT_GCC_CPP_STD_VERSION \
HOST_GLOBAL_CFLAGS 2ND_HOST_GLOBAL_CFLAGS \
HOST_GLOBAL_CONLYFLAGS 2ND_HOST_GLOBAL_CONLYFLAGS \
HOST_GLOBAL_CPPFLAGS 2ND_HOST_GLOBAL_CPPFLAGS \
HOST_GLOBAL_LDFLAGS 2ND_HOST_GLOBAL_LDFLAGS \
HOST_GLOBAL_LLDFLAGS 2ND_HOST_GLOBAL_LLDFLAGS \
HOST_CLANG_SUPPORTED 2ND_HOST_CLANG_SUPPORTED \
HOST_CC 2ND_HOST_CC \
HOST_CXX 2ND_HOST_CXX \
HOST_CROSS_GLOBAL_CFLAGS 2ND_HOST_CROSS_GLOBAL_CFLAGS \
HOST_CROSS_GLOBAL_CONLYFLAGS 2ND_HOST_CROSS_GLOBAL_CONLYFLAGS \
HOST_CROSS_GLOBAL_CPPFLAGS 2ND_HOST_CROSS_GLOBAL_CPPFLAGS \
HOST_CROSS_GLOBAL_LDFLAGS 2ND_HOST_CROSS_GLOBAL_LDFLAGS \
HOST_CROSS_GLOBAL_LLDFLAGS 2ND_HOST_CROSS_GLOBAL_LLDFLAGS \
HOST_CROSS_CLANG_SUPPORTED 2ND_HOST_CROSS_CLANG_SUPPORTED \
HOST_CROSS_CC 2ND_HOST_CROSS_CC \
HOST_CROSS_CXX 2ND_HOST_CROSS_CXX \
TARGET_GLOBAL_CFLAGS 2ND_TARGET_GLOBAL_CFLAGS \
TARGET_GLOBAL_CONLYFLAGS 2ND_TARGET_GLOBAL_CONLYFLAGS \
TARGET_GLOBAL_CPPFLAGS 2ND_TARGET_GLOBAL_CPPFLAGS \
TARGET_GLOBAL_LDFLAGS 2ND_TARGET_GLOBAL_LDFLAGS \
TARGET_GLOBAL_LLDFLAGS 2ND_TARGET_GLOBAL_LLDFLAGS \
TARGET_CLANG_SUPPORTED 2ND_TARGET_CLANG_SUPPORTED \
TARGET_CC 2ND_TARGET_CC \
TARGET_CXX 2ND_TARGET_CXX \
TARGET_TOOLCHAIN_ROOT 2ND_TARGET_TOOLCHAIN_ROOT \
HOST_TOOLCHAIN_ROOT 2ND_HOST_TOOLCHAIN_ROOT \
HOST_CROSS_TOOLCHAIN_ROOT 2ND_HOST_CROSS_TOOLCHAIN_ROOT \
HOST_TOOLS_PREFIX 2ND_HOST_TOOLS_PREFIX \
HOST_CROSS_TOOLS_PREFIX 2ND_HOST_CROSS_TOOLS_PREFIX \
HOST_GCC_VERSION 2ND_HOST_GCC_VERSION \
HOST_CROSS_GCC_VERSION 2ND_HOST_CROSS_GCC_VERSION \
TARGET_NDK_GCC_VERSION 2ND_TARGET_NDK_GCC_VERSION \
GLOBAL_CFLAGS_NO_OVERRIDE GLOBAL_CPPFLAGS_NO_OVERRIDE \
,GCC support has been removed. Use Clang instead)
$(KATI_obsolete_var DIST_DIR dist_goal,Use dist-for-goals instead. See $(CHANGES_URL)#dist)
$(KATI_obsolete_var TARGET_ANDROID_FILESYSTEM_CONFIG_H,Use TARGET_FS_CONFIG_GEN instead)
$(KATI_deprecated_var USER,Use BUILD_USERNAME instead. See $(CHANGES_URL)#USER)
$(KATI_obsolete_var TARGET_ROOT_OUT_SBIN,/sbin has been removed, use /system/bin instead)
$(KATI_obsolete_var TARGET_ROOT_OUT_SBIN_UNSTRIPPED,/sbin has been removed, use /system/bin instead)
$(KATI_obsolete_var BUILD_BROKEN_PHONY_TARGETS)
$(KATI_obsolete_var BUILD_BROKEN_DUP_COPY_HEADERS)
$(KATI_obsolete_var BUILD_BROKEN_ENG_DEBUG_TAGS)
$(KATI_obsolete_var BUILD_BROKEN_GENRULE_SANDBOXING)
$(KATI_obsolete_export It is a global setting. See $(CHANGES_URL)#export_keyword)
$(KATI_obsolete_var BUILD_BROKEN_ANDROIDMK_EXPORTS)
$(KATI_obsolete_var PRODUCT_NOTICE_SPLIT_OVERRIDE,Stop using this, keep calm, and carry on.)
$(KATI_obsolete_var PRODUCT_STATIC_BOOT_CONTROL_HAL,Use shared library module instead. See $(CHANGES_URL)#PRODUCT_STATIC_BOOT_CONTROL_HAL)
$(KATI_obsolete_var \
ARCH_ARM_HAVE_ARMV7A \
ARCH_DSP_REV \
ARCH_HAVE_ALIGNED_DOUBLES \
ARCH_MIPS_HAS_DSP \
ARCH_MIPS_HAS_FPU \
ARCH_MIPS_REV6 \
ARCH_X86_HAVE_AES_NI \
ARCH_X86_HAVE_AVX \
ARCH_X86_HAVE_AVX2 \
ARCH_X86_HAVE_AVX512 \
ARCH_X86_HAVE_MOVBE \
ARCH_X86_HAVE_POPCNT \
ARCH_X86_HAVE_SSE4 \
ARCH_X86_HAVE_SSE4_2 \
ARCH_X86_HAVE_SSSE3 \
)
$(KATI_obsolete_var PRODUCT_IOT)
$(KATI_obsolete_var MD5SUM)
$(KATI_obsolete_var BOARD_HAL_STATIC_LIBRARIES, See $(CHANGES_URL)#BOARD_HAL_STATIC_LIBRARIES)
$(KATI_obsolete_var LOCAL_HAL_STATIC_LIBRARIES, See $(CHANGES_URL)#BOARD_HAL_STATIC_LIBRARIES)
$(KATI_obsolete_var \
TARGET_AUX_OS_VARIANT_LIST \
LOCAL_AUX_ARCH \
LOCAL_AUX_CPU \
LOCAL_AUX_OS \
LOCAL_AUX_OS_VARIANT \
LOCAL_AUX_SUBARCH \
LOCAL_AUX_TOOLCHAIN \
LOCAL_CUSTOM_BUILD_STEP_INPUT \
LOCAL_CUSTOM_BUILD_STEP_OUTPUT \
LOCAL_IS_AUX_MODULE \
,AUX support has been removed)
$(KATI_obsolete_var HOST_OUT_TEST_CONFIG TARGET_OUT_TEST_CONFIG LOCAL_TEST_CONFIG_OPTIONS)
$(KATI_obsolete_var \
TARGET_PROJECT_INCLUDES \ 2ND_TARGET_PROJECT_INCLUDES \
TARGET_PROJECT_SYSTEM_INCLUDES \ 2ND_TARGET_PROJECT_SYSTEM_INCLUDES \
,Project include variables have been removed)
$(KATI_obsolete_var TARGET_PREFER_32_BIT TARGET_PREFER_32_BIT_APPS TARGET_PREFER_32_BIT_EXECUTABLES)
$(KATI_obsolete_var PRODUCT_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT_WHITELIST,Use PRODUCT_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT_ALLOW_LIST)
$(KATI_obsolete_var PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST,Use PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST)
$(KATI_obsolete_var COVERAGE_PATHS,Use NATIVE_COVERAGE_PATHS instead)
$(KATI_obsolete_var COVERAGE_EXCLUDE_PATHS,Use NATIVE_COVERAGE_EXCLUDE_PATHS instead)
$(KATI_obsolete_var BOARD_VNDK_RUNTIME_DISABLE,VNDK-Lite is no longer supported)
$(KATI_obsolete_var LOCAL_SANITIZE_BLACKLIST,Use LOCAL_SANITIZE_BLOCKLIST instead)
$(KATI_obsolete_var BOARD_PLAT_PUBLIC_SEPOLICY_DIR,Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead)
$(KATI_obsolete_var BOARD_PLAT_PRIVATE_SEPOLICY_DIR,Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead)
$(KATI_obsolete_var TARGET_NO_VENDOR_BOOT,Use PRODUCT_BUILD_VENDOR_BOOT_IMAGE instead)
$(KATI_obsolete_var PRODUCT_CHECK_ELF_FILES,Use BUILD_BROKEN_PREBUILT_ELF_FILES instead)
$(KATI_obsolete_var ALL_GENERATED_SOURCES,ALL_GENERATED_SOURCES is no longer used)
$(KATI_obsolete_var ALL_ORIGINAL_DYNAMIC_BINARIES,ALL_ORIGINAL_DYNAMIC_BINARIES is no longer used)
$(KATI_obsolete_var PRODUCT_SUPPORTS_VERITY,VB 1.0 and related variables are no longer supported)
$(KATI_obsolete_var PRODUCT_SUPPORTS_VERITY_FEC,VB 1.0 and related variables are no longer supported)
$(KATI_obsolete_var PRODUCT_SUPPORTS_BOOT_SIGNER,VB 1.0 and related variables are no longer supported)
$(KATI_obsolete_var PRODUCT_VERITY_SIGNING_KEY,VB 1.0 and related variables are no longer supported)
$(KATI_obsolete_var BOARD_PREBUILT_PVMFWIMAGE,pvmfw.bin is now built in AOSP and custom versions are no longer supported)
$(KATI_obsolete_var BUILDING_PVMFW_IMAGE,BUILDING_PVMFW_IMAGE is no longer used)
$(KATI_obsolete_var BOARD_BUILD_SYSTEM_ROOT_IMAGE)
$(KATI_obsolete_var FS_GET_STATS)
$(KATI_obsolete_var BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES)
$(KATI_obsolete_var BOARD_SYSTEM_EXT_PREBUILT_DIR,Use BOARD_SYSTEM_EXT_SEPOLICY_PREBUILT_DIRS instead)
$(KATI_obsolete_var BOARD_PRODUCT_PREBUILT_DIR,Use BOARD_PRODUCT_SEPOLICY_PREBUILT_DIRS instead)
# Used to force goals to build. Only use for conditionally defined goals.
.PHONY: FORCE
FORCE:
ORIGINAL_MAKECMDGOALS := $(MAKECMDGOALS)
UNAME := $(shell uname -sm)
SRC_TARGET_DIR := $(TOPDIR)build/make/target
# Some specific paths to tools
SRC_DROIDDOC_DIR := $(TOPDIR)build/make/tools/droiddoc
# Mark some inputs as readonly
ifdef TARGET_DEVICE_DIR
.KATI_READONLY := TARGET_DEVICE_DIR endif
# Set up efficient math functions which are used in make. # Here since this file is included by envsetup as well as during build. include $(BUILD_SYSTEM_COMMON)/math.mk
include $(BUILD_SYSTEM_COMMON)/strings.mk
include $(BUILD_SYSTEM_COMMON)/json.mk
# Various mappings to avoid hard-coding paths all over the place include $(BUILD_SYSTEM)/pathmap.mk
# Allow projects to define their own globally-available variables include $(BUILD_SYSTEM)/project_definitions.mk
# ############################################################### # Build system internal files # ###############################################################
# ############################################################### # Parse out any modifier targets. # ###############################################################
# $(1): the paths to be normalized define normalize-paths
$(if $(1),$(shell $(NORMALIZE_PATH) $(1))) endef
# ############################################################### # Set common values # ###############################################################
# Initialize SOONG_CONFIG_NAMESPACES so that it isn't recursive.
SOONG_CONFIG_NAMESPACES :=
# TODO(asmundak): remove add_soong_config_namespace, add_soong_config_var, # and add_soong_config_var_value once all their usages are replaced with # soong_config_set/soong_config_append.
# The add_soong_config_namespace function adds a namespace and initializes it # to be empty. # $1 is the namespace. # Ex: $(call add_soong_config_namespace,acme)
# The add_soong_config_var function adds a a list of soong config variables to # SOONG_CONFIG_*. The variables and their values are then available to a # soong_config_module_type in an Android.bp file. # $1 is the namespace. $2 is the list of variables. # Ex: $(call add_soong_config_var,acme,COOL_FEATURE_A COOL_FEATURE_B) define add_soong_config_var
$(eval SOONG_CONFIG_$(strip $1) += $(strip $2)) \
$(foreach v,$(strip $2),$(eval SOONG_CONFIG_$(strip $1)_$v := $(strip $($v)))) endef
# The add_soong_config_var_value function defines a make variable and also adds # the variable to SOONG_CONFIG_*. # $1 is the namespace. $2 is the variable name. $3 is the variable value. # Ex: $(call add_soong_config_var_value,acme,COOL_FEATURE,true)
# Soong config namespace variables manipulation. # # internal utility to define a namespace and a variable in it. define soong_config_define_internal
$(if $(filter $1,$(SOONG_CONFIG_NAMESPACES)),,$(eval SOONG_CONFIG_NAMESPACES:=$(SOONG_CONFIG_NAMESPACES) $(strip $1))) \
$(if $(filter $2,$(SOONG_CONFIG_$(strip $1))),,$(eval SOONG_CONFIG_$(strip $1):=$(SOONG_CONFIG_$(strip $1)) $(strip $2))) endef
# soong_config_set defines the variable in the given Soong config namespace # and sets its value. If the namespace does not exist, it will be defined. # $1 is the namespace. $2 is the variable name. $3 is the variable value. # Ex: $(call soong_config_set,acme,COOL_FEATURE,true) define soong_config_set
$(call soong_config_define_internal,$1,$2) \
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(strip $3)) endef
# soong_config_set_if_exist defines the variable in the given Soong config # namespace and sets its value ONLY if the value is not empty. # $1 is the namespace. $2 is the variable name. $3 is the variable value. define soong_config_set_if_exist
$(if $(strip $3),$(call soong_config_set,$1,$2,$3)) endef
# soong_config_set_bool is the same as soong_config_set, but it will # also type the variable as a bool, so that when using select() expressions # in blueprint files they can use boolean values instead of strings. # It will only accept "true" for its value, any other value will be # treated as false. # $1 is the namespace. $2 is the variable name. $3 is the variable value. # Ex: $(call soong_config_set_bool,acme,COOL_FEATURE,true) define soong_config_set_bool
$(call soong_config_define_internal,$1,$2) \
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(filter true,$3))
$(eval SOONG_CONFIG_TYPE_$(strip $1)_$(strip $2):=bool) endef
# soong_config_set_int is the same as soong_config_set, but it will # also type the variable as an integer, so that when using select() expressions # in blueprint files they can use integer values instead of strings. # It will error out if a non-integer is supplied # $1 is the namespace. $2 is the variable name. $3 is the variable value. # Ex: $(call soong_config_set_int,acme,COOL_FEATURE,34) define soong_config_set_int
$(call soong_config_define_internal,$1,$2)
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(strip $3))
$(eval SOONG_CONFIG_TYPE_$(strip $1)_$(strip $2):=int) endef
# soong_config_set_string_list is the same as soong_config_set, but it will # also type the variable as a list of strings, so that when using select() expressions # in blueprint files they can use list values instead of strings. # The values of the list must be space-separated. # $1 is the namespace. $2 is the variable name. $3 is the variable value. # Ex: $(call soong_config_set_string_list,acme,COOL_LIBS,a b) define soong_config_set_string_list
$(call soong_config_define_internal,$1,$2) \
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(strip $3))
$(eval SOONG_CONFIG_TYPE_$(strip $1)_$(strip $2):=string_list) endef
# soong_config_append appends to the value of the variable in the given Soong # config namespace. If the variable does not exist, it will be defined. If the # namespace does not exist, it will be defined. # $1 is the namespace, $2 is the variable name, $3 is the value define soong_config_append
$(call soong_config_define_internal,$1,$2) \
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(SOONG_CONFIG_$(strip $1)_$(strip $2)) $(strip $3)) endef
# soong_config_append gets to the value of the variable in the given Soong # config namespace. If the namespace or variables does not exist, an # empty string will be returned. # $1 is the namespace, $2 is the variable name define soong_config_get
$(SOONG_CONFIG_$(strip $1)_$(strip $2)) endef
# Set the extensions used for various packages
COMMON_PACKAGE_SUFFIX := .zip
COMMON_JAVA_PACKAGE_SUFFIX := .jar
COMMON_ANDROID_PACKAGE_SUFFIX := .apk
# These build broken variables are intended to be set in a buildspec file, # while other build broken flags are expected to be set in a board config. # These are build broken variables that are expected to apply across board # configs, generally for cross-cutting features.
# Build broken variables that should be treated as booleans
_build_broken_bool_vars :=
# Build broken variables that should be treated as lists
_build_broken_list_vars := \
BUILD_BROKEN_PLUGIN_VALIDATION \
# ############################################################### # Include sub-configuration files # ###############################################################
# --------------------------------------------------------------- # Try to include buildspec.mk, which will try to set stuff up. # If this file doesn't exist, the environment variables will # be used, and if that doesn't work, then the default is an # arm build
ifndef ANDROID_BUILDSPEC
ANDROID_BUILDSPEC := $(TOPDIR)buildspec.mk endif
-include $(ANDROID_BUILDSPEC)
# --------------------------------------------------------------- # Define most of the global variables. These are the ones that # are specific to the user's build configuration. include $(BUILD_SYSTEM)/envsetup.mk
$(foreach var,$(_build_broken_bool_vars), \
$(if $(filter-out true false,$($(var))), \
$(error Valid values of $(var) are "true", "false", and "". Not "$($(var))")))
.KATI_READONLY := $(_build_broken_var_names)
# Returns true if it is a low memory device, otherwise it returns false. define is-low-mem-device
$(if $(findstring ro.config.low_ram=true,$(PRODUCT_PROPERTY_OVERRIDES)),true,\
$(if $(findstring ro.config.low_ram=true,$(PRODUCT_DEFAULT_PROPERTY_OVERRIDES)),true,\
$(if $(findstring ro.config.low_ram=true,$(PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE)),true,\
$(if $(findstring ro.config.low_ram=true,$(PRODUCT_COMPATIBLE_PROPERTY)),true,\
$(if $(findstring ro.config.low_ram=true,$(PRODUCT_SYSTEM_DEFAULT_PROPERTIES)),true,\
$(if $(findstring ro.config.low_ram=true,$(PRODUCT_SYSTEM_EXT_PROPERTIES)),true,\
$(if $(findstring ro.config.low_ram=true,$(PRODUCT_PRODUCT_PROPERTIES)),true,\
$(if $(findstring ro.config.low_ram=true,$(PRODUCT_VENDOR_PROPERTIES)),true,\
$(if $(findstring ro.config.low_ram=true,$(PRODUCT_ODM_PROPERTIES)),true,false))))))))) endef
# Set TARGET_MAX_PAGE_SIZE_SUPPORTED. # TARGET_MAX_PAGE_SIZE_SUPPORTED indicates the alignment of the ELF segments.
ifdef PRODUCT_MAX_PAGE_SIZE_SUPPORTED
TARGET_MAX_PAGE_SIZE_SUPPORTED := $(PRODUCT_MAX_PAGE_SIZE_SUPPORTED) elseifeq ($(strip $(call is-low-mem-device)),true) # Low memory device will have 4096 binary alignment.
TARGET_MAX_PAGE_SIZE_SUPPORTED := 4096 elseifeq ($(call math_lt,$(VSR_VENDOR_API_LEVEL),34),true)
TARGET_MAX_PAGE_SIZE_SUPPORTED := 4096 elseifeq (,$(filter arm64 x86_64,$(TARGET_ARCH))) # TARGET_MAX_PAGE_SIZE_SUPPORTED > 4096 is only supported in arm64 and # x86_64 targets.
TARGET_MAX_PAGE_SIZE_SUPPORTED := 4096 else # The default binary alignment for userspace is 16384.
TARGET_MAX_PAGE_SIZE_SUPPORTED := 16384 endif
.KATI_READONLY := TARGET_MAX_PAGE_SIZE_SUPPORTED
TARGET_RESTRICTS_ASHMEM_USAGE := false
# If the vendor API level is 202604, then the device restricts what # applications can use ashmem. # # Check if the build is for CF on either WearOS or TV, as they are pinned to # older kernel versions that do not have memfd_class support, and therefore # must continue to use ashmem unconditionally. This can be simplified to just # the VSR_VENDOR_API_LEVEL check once all CF instances move to kernel version # 6.12 or newer. ifeq ($(call math_gt_or_eq,$(VSR_VENDOR_API_LEVEL),202604),true) ifneq (true,$(CLOCKWORK_EMULATOR_PRODUCT)) ifeq (,$(findstring x86_tv,$(PRODUCT_NAME)))
TARGET_RESTRICTS_ASHMEM_USAGE := true endif endif endif
# Pruned directory options used when using findleaves.py # See envsetup.mk for a description of SCAN_EXCLUDE_DIRS
FIND_LEAVES_EXCLUDES := $(addprefix --prune=, $(SCAN_EXCLUDE_DIRS) .repo .git)
# The build system exposes several variables for where to find the kernel # headers: # TARGET_DEVICE_KERNEL_HEADERS is automatically created for the current # device being built. It is set as $(TARGET_DEVICE_DIR)/kernel-headers, # e.g. device/samsung/tuna/kernel-headers. This directory is not # explicitly set by anyone, the build system always adds this subdir. # # TARGET_BOARD_KERNEL_HEADERS is specified by the BoardConfig.mk file # to allow other directories to be included. This is useful if there's # some common place where a few headers are being kept for a group # of devices. For example, device/<vendor>/common/kernel-headers could # contain some headers for several of <vendor>'s devices. # # TARGET_PRODUCT_KERNEL_HEADERS is generated by the product inheritance # graph. This allows architecture products to provide headers for the # devices using that architecture. For example, # hardware/ti/omap4xxx/omap4.mk will specify # PRODUCT_VENDOR_KERNEL_HEADERS variable that specify where the omap4 # specific headers are, e.g. hardware/ti/omap4xxx/kernel-headers. # The build system then combines all the values specified by all the # PRODUCT_VENDOR_KERNEL_HEADERS directives in the product inheritance # tree and then exports a TARGET_PRODUCT_KERNEL_HEADERS variable. # # The layout of subdirs in any of the kernel-headers dir should mirror the # layout of the kernel include/ directory. For example, # device/samsung/tuna/kernel-headers/linux/, # hardware/ti/omap4xxx/kernel-headers/media/, # etc. # # NOTE: These directories MUST contain post-processed headers using the # bionic/libc/kernel/tools/clean_header.py tool. Additionally, the original # kernel headers must also be checked in, but in a different subdirectory. By # convention, the originals should be checked into original-kernel-headers # directory of the same parent dir. For example, # device/samsung/tuna/kernel-headers <----- post-processed # device/samsung/tuna/original-kernel-headers <----- originals #
TARGET_DEVICE_KERNEL_HEADERS := $(strip $(wildcard $(TARGET_DEVICE_DIR)/kernel-headers))
define validate-kernel-headers
$(if $(firstword $(foreach hdr_dir,$(1),\
$(filter-out kernel-headers,$(notdir $(hdr_dir))))),\
$(error Kernel header dirs must be end in kernel-headers: $(1))) endef # also allow the board config to provide additional directories since # there could be device/oem/base_hw and device/oem/derived_hw # that both are valid devices but derived_hw needs to use kernel headers # from base_hw.
TARGET_BOARD_KERNEL_HEADERS := $(strip $(wildcard $(TARGET_BOARD_KERNEL_HEADERS)))
TARGET_BOARD_KERNEL_HEADERS := $(patsubst %/,%,$(TARGET_BOARD_KERNEL_HEADERS))
$(call validate-kernel-headers,$(TARGET_BOARD_KERNEL_HEADERS))
# then add product-inherited includes, to allow for # hardware/sivendor/chip/chip.mk to include their own headers
TARGET_PRODUCT_KERNEL_HEADERS := $(strip $(wildcard $(PRODUCT_VENDOR_KERNEL_HEADERS)))
TARGET_PRODUCT_KERNEL_HEADERS := $(patsubst %/,%,$(TARGET_PRODUCT_KERNEL_HEADERS))
$(call validate-kernel-headers,$(TARGET_PRODUCT_KERNEL_HEADERS))
.KATI_READONLY := TARGET_DEVICE_KERNEL_HEADERS TARGET_BOARD_KERNEL_HEADERS TARGET_PRODUCT_KERNEL_HEADERS
# Commands to generate .toc file common to ELF .so files. define _gen_toc_command_for_elf
$(hide) ($($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)READELF) -d $(1) | grep SONAME || echo"No SONAME for $1") > $(2)
$(hide) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)READELF) --dyn-syms $(1) | awk '{$$2=""; $$3=""; print}' >> $(2) endef
# Unset WITH_TIDY_ONLY if global WITH_TIDY_ONLY is not true nor 1. ifeq (,$(filter 1 true,$(WITH_TIDY_ONLY)))
WITH_TIDY_ONLY := endif
# --------------------------------------------------------------- # Check that the configuration is current. We check that # BUILD_ENV_SEQUENCE_NUMBER is current against this value. # Don't fail if we're called from envsetup, so they have a # chance to update their environment.
ifeq (,$(strip $(CALLED_FROM_SETUP))) ifneq (,$(strip $(BUILD_ENV_SEQUENCE_NUMBER))) ifneq ($(BUILD_ENV_SEQUENCE_NUMBER),$(CORRECT_BUILD_ENV_SEQUENCE_NUMBER))
$(warning BUILD_ENV_SEQUENCE_NUMBER is set incorrectly.)
$(info *** If you use envsetup/lunch/choosecombo:)
$(info *** - Re-execute envsetup (". envsetup.sh"))
$(info *** - Re-run lunch or choosecombo)
$(info *** If you use buildspec.mk:)
$(info *** - Look at buildspec.mk.default to see what has changed)
$(info *** - Update BUILD_ENV_SEQUENCE_NUMBER to "$(CORRECT_BUILD_ENV_SEQUENCE_NUMBER)")
$(error bailing..) endif endif endif
# --------------------------------------------------------------- # Whether we can expect a full build graph
ALLOW_MISSING_DEPENDENCIES := $(filter true,$(ALLOW_MISSING_DEPENDENCIES)) ifneq ($(TARGET_BUILD_APPS),)
ALLOW_MISSING_DEPENDENCIES := true endif ifeq ($(TARGET_BUILD_UNBUNDLED_IMAGE),true)
ALLOW_MISSING_DEPENDENCIES := true endif ifneq ($(filter true,$(SOONG_ALLOW_MISSING_DEPENDENCIES)),)
ALLOW_MISSING_DEPENDENCIES := true endif # Mac builds default to ALLOW_MISSING_DEPENDENCIES, at least until the host # tools aren't enabled by default for Mac. ifeq ($(HOST_OS),darwin)
ALLOW_MISSING_DEPENDENCIES := true endif
.KATI_READONLY := ALLOW_MISSING_DEPENDENCIES
# SOONG_ZIP is exported by Soong, but needs to be defined early for # $OUT/dexpreopt.global. It will be verified against the Soong version.
SOONG_ZIP := $(HOST_OUT_EXECUTABLES)/soong_zip
# Boolean variable determining if the allow list for compatible properties is enabled
PRODUCT_COMPATIBLE_PROPERTY := true ifeq ($(PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE),false)
$(error PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE is obsolete) endif
.KATI_READONLY := \
PRODUCT_COMPATIBLE_PROPERTY
$(KATI_obsolete_var PRODUCT_TREBLE_LINKER_NAMESPACES,This is now always true.)
$(KATI_obsolete_var PRODUCT_ENFORCE_VINTF_MANIFEST,This is now always true.)
$(KATI_obsolete_var PRODUCT_TREBLE_LINKER_NAMESPACES_OVERRIDE,Deprecated.)
$(KATI_obsolete_var PRODUCT_ENFORCE_VINTF_MANIFEST_OVERRIDE,Deprecated.)
$(KATI_obsolete_var PRODUCT_FULL_TREBLE_OVERRIDE,Deprecated.)
# BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED can be true only if early-mount of # partitions is supported. But the early-mount must be supported for full # treble products, and so BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED should be set # by default for full treble products.
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED ?= true
ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),36),) ifneq ($(NEED_AIDL_NDK_PLATFORM_BACKEND),)
$(error Must not set NEED_AIDL_NDK_PLATFORM_BACKEND, but it is set to: $(NEED_AIDL_NDK_PLATFORM_BACKEND). Support will be removed.) endif endif
# Set BOARD_SYSTEMSDK_VERSIONS to the latest SystemSDK version starting from P-launching # devices if unset.
ifndef BOARD_SYSTEMSDK_VERSIONS ifeq (REL,$(PLATFORM_VERSION_CODENAME))
BOARD_SYSTEMSDK_VERSIONS := $(PLATFORM_SDK_VERSION) else
BOARD_SYSTEMSDK_VERSIONS := $(PLATFORM_VERSION_CODENAME) endif endif
ifndef BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES
BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES := current else
ifdef PRODUCT_SHIPPING_API_LEVEL ifneq ($(call math_lt,$(BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES),$(PRODUCT_SHIPPING_API_LEVEL)),)
$(error BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES ($(BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES)) must be greater than or equal to PRODUCT_SHIPPING_API_LEVEL ($(PRODUCT_SHIPPING_API_LEVEL))) endif endif endif
.KATI_READONLY := BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES
ifdef PRODUCT_SHIPPING_API_LEVEL ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),29),) ifneq ($(BOARD_OTA_FRAMEWORK_VBMETA_VERSION_OVERRIDE),)
$(error When PRODUCT_SHIPPING_API_LEVEL >= 29, BOARD_OTA_FRAMEWORK_VBMETA_VERSION_OVERRIDE cannot be set) endif endif endif
# The default key if not set as LOCAL_CERTIFICATE
ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE
DEFAULT_SYSTEM_DEV_CERTIFICATE := $(PRODUCT_DEFAULT_DEV_CERTIFICATE) else
DEFAULT_SYSTEM_DEV_CERTIFICATE := build/make/target/product/security/testkey endif
.KATI_READONLY := DEFAULT_SYSTEM_DEV_CERTIFICATE
# Certificate for the Bluetooth sepolicy context
ifdef PRODUCT_MAINLINE_BLUETOOTH_SEPOLICY_DEV_CERTIFICATES # Priority 1: Use the product specific variable if defined
MAINLINE_BLUETOOTH_SEPOLICY_DEV_CERTIFICATES := $(PRODUCT_MAINLINE_BLUETOOTH_SEPOLICY_DEV_CERTIFICATES) elseifneq (,$(filter com.google.android.bt com.google.android.bt_compressed com.google.android.go.bt,$(PRODUCT_PACKAGES))) # Priority 2: Use Mainline Sepolicy cert if the Bluetooth module is detected
MAINLINE_BLUETOOTH_SEPOLICY_DEV_CERTIFICATES := $(MAINLINE_SEPOLICY_DEV_CERTIFICATES) elseifeq (,$(filter com.google.android.art com.google.android.art_compressed com.google.android.go.art,$(PRODUCT_PACKAGES))) # Priority 3: AOSP / No-Mainline Detection # If NO ART module package is found, we assume this is a legacy/AOSP build without mainline support. # In this case, use the directory of the default system dev certificate.
MAINLINE_BLUETOOTH_SEPOLICY_DEV_CERTIFICATES := $(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE)) else # Priority 4: Fallback # We have some mainline modules (ART exists), but without the Bluetooth module. # Use the standard testkey directory.
MAINLINE_BLUETOOTH_SEPOLICY_DEV_CERTIFICATES := $(dir build/make/target/product/security/testkey) endif
.KATI_READONLY := MAINLINE_BLUETOOTH_SEPOLICY_DEV_CERTIFICATES
# Certificate for the Bluetooth sepolicy context
ifdef PRODUCT_MAINLINE_NFC_SEPOLICY_DEV_CERTIFICATES # Priority 1: Use the product specific variable if defined
MAINLINE_NFC_SEPOLICY_DEV_CERTIFICATES := $(PRODUCT_MAINLINE_NFC_SEPOLICY_DEV_CERTIFICATES) else # Priority 2: Use Mainline Sepolicy cert
MAINLINE_NFC_SEPOLICY_DEV_CERTIFICATES := $(MAINLINE_SEPOLICY_DEV_CERTIFICATES) endif
.KATI_READONLY := MAINLINE_NFC_SEPOLICY_DEV_CERTIFICATES
# PLATFORM_SEPOLICY_VERSION is a number of the form "YYYYMM" with "YYYYMM" # mapping to vFRC version.
PLATFORM_SEPOLICY_VERSION := $(BOARD_API_LEVEL)
BOARD_SEPOLICY_VERS := $(PLATFORM_SEPOLICY_VERSION)
.KATI_READONLY := PLATFORM_SEPOLICY_VERSION BOARD_SEPOLICY_VERS
# A list of SEPolicy versions, besides PLATFORM_SEPOLICY_VERSION, that the framework supports.
PLATFORM_SEPOLICY_COMPAT_VERSIONS := \ 31.0 \ 32.0 \ 33.0 \ 34.0 \
BOARD_GENFS_LABELS_VERSION ?= $(BOARD_API_LEVEL) ifeq ($(call math_gt,$(BOARD_API_LEVEL),$(BOARD_GENFS_LABELS_VERSION)),true)
$(error BOARD_GENFS_LABELS_VERSION ($(BOARD_GENFS_LABELS_VERSION)) must be greater than or equal to BOARD_API_LEVEL ($(BOARD_API_LEVEL))) endif
ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) ifneq ($(PRODUCT_USE_DYNAMIC_PARTITION_SIZE),true)
$(error PRODUCT_USE_DYNAMIC_PARTITION_SIZE must be true for devices with dynamic partitions) endif endif
ifeq ($(PRODUCT_BUILD_SUPER_PARTITION),true) ifneq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true)
$(error Can only build super partition for devices with dynamic partitions) endif endif
ifeq ($(PRODUCT_USE_DYNAMIC_PARTITION_SIZE),true)
ifneq ($(BOARD_SYSTEMIMAGE_PARTITION_SIZE),) ifneq ($(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),)
$(error Should not define BOARD_SYSTEMIMAGE_PARTITION_SIZE and \
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE together) endif endif
ifneq ($(BOARD_VENDORIMAGE_PARTITION_SIZE),) ifneq ($(BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE),)
$(error Should not define BOARD_VENDORIMAGE_PARTITION_SIZE and \
BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE together) endif endif
ifneq ($(BOARD_ODMIMAGE_PARTITION_SIZE),) ifneq ($(BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE),)
$(error Should not define BOARD_ODMIMAGE_PARTITION_SIZE and \
BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE together) endif endif
ifneq ($(BOARD_VENDOR_DLKMIMAGE_PARTITION_SIZE),) ifneq ($(BOARD_VENDOR_DLKMIMAGE_PARTITION_RESERVED_SIZE),)
$(error Should not define BOARD_VENDOR_DLKMIMAGE_PARTITION_SIZE and \
BOARD_VENDOR_DLKMIMAGE_PARTITION_RESERVED_SIZE together) endif endif
ifneq ($(BOARD_ODM_DLKMIMAGE_PARTITION_SIZE),) ifneq ($(BOARD_ODM_DLKMIMAGE_PARTITION_RESERVED_SIZE),)
$(error Should not define BOARD_ODM_DLKMIMAGE_PARTITION_SIZE and \
BOARD_ODM_DLKMIMAGE_PARTITION_RESERVED_SIZE together) endif endif
ifneq ($(BOARD_SYSTEM_DLKMIMAGE_PARTITION_SIZE),) ifneq ($(BOARD_SYSTEM_DLKMIMAGE_PARTITION_RESERVED_SIZE),)
$(error Should not define BOARD_SYSTEM_DLKMIMAGE_PARTITION_SIZE and \
BOARD_SYSTEM_DLKMIMAGE_PARTITION_RESERVED_SIZE together) endif endif
ifneq ($(BOARD_PRODUCTIMAGE_PARTITION_SIZE),) ifneq ($(BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE),)
$(error Should not define BOARD_PRODUCTIMAGE_PARTITION_SIZE and \
BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE together) endif endif
ifneq ($(BOARD_SYSTEM_EXTIMAGE_PARTITION_SIZE),) ifneq ($(BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE),)
$(error Should not define BOARD_SYSTEM_EXTIMAGE_PARTITION_SIZE and \
BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE together) endif endif
endif# PRODUCT_USE_DYNAMIC_PARTITION_SIZE
ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true)
# BOARD_SUPER_PARTITION_GROUPS defines a list of "updatable groups". Each updatable group is a # group of partitions that share the same pool of free spaces. # For each group in BOARD_SUPER_PARTITION_GROUPS, a BOARD_{GROUP}_SIZE and # BOARD_{GROUP}_PARTITION_PARTITION_LIST may be defined. # - BOARD_{GROUP}_SIZE: The maximum sum of sizes of all partitions in the group. # Must not be empty. # - BOARD_{GROUP}_PARTITION_PARTITION_LIST: the list of partitions that belongs to this group. # If empty, no partitions belong to this group, and the sum of sizes is effectively 0.
$(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \
$(eval BOARD_$(group)_SIZE := $(strip $(BOARD_$(group)_SIZE))) \
$(if $(BOARD_$(group)_SIZE),,$(error BOARD_$(group)_SIZE must not be empty)) \
$(eval .KATI_READONLY := BOARD_$(group)_SIZE) \
$(eval BOARD_$(group)_PARTITION_LIST ?=) \
$(eval .KATI_READONLY := BOARD_$(group)_PARTITION_LIST) \
)
# Define BOARD_SUPER_PARTITION_PARTITION_LIST, the sum of all BOARD_*_PARTITION_LIST
ifdef BOARD_SUPER_PARTITION_PARTITION_LIST
$(error BOARD_SUPER_PARTITION_PARTITION_LIST should not be defined, but computed from \
BOARD_SUPER_PARTITION_GROUPS and BOARD_*_PARTITION_LIST) endif
BOARD_SUPER_PARTITION_PARTITION_LIST := \
$(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)),$(BOARD_$(group)_PARTITION_LIST))
.KATI_READONLY := BOARD_SUPER_PARTITION_PARTITION_LIST
ifneq ($(BOARD_SUPER_PARTITION_SIZE),) # For normal devices, we populate BOARD_SUPER_PARTITION_BLOCK_DEVICES so the # build can handle both cases consistently. ifeq ($(BOARD_SUPER_PARTITION_METADATA_DEVICE),)
BOARD_SUPER_PARTITION_METADATA_DEVICE := super endif
# If only one super block device, default to super partition size. ifeq ($(word 2,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),)
BOARD_SUPER_PARTITION_$(call to-upper,$(strip $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)))_DEVICE_SIZE ?= \
$(BOARD_SUPER_PARTITION_SIZE) endif
# Additional kernel-module related variables that are allowed when using a kernel module zip: # - BOARD_DO_NOT_STRIP_VENDOR_MODULES
# Could consider denying them, but it'll probably require a lot of product config changes.
$(foreach var,$(disallowed_variables), \
$(if $($(var)),$(eval $(var) :=)))
disallowed_variables := endif
# By default, we build the hidden API csv files from source. You can use # prebuilt hiddenapi files by setting BOARD_PREBUILT_HIDDENAPI_DIR to the name # of a directory containing both prebuilt hiddenapi-flags.csv and # hiddenapi-index.csv.
BOARD_PREBUILT_HIDDENAPI_DIR ?=
.KATI_READONLY := BOARD_PREBUILT_HIDDENAPI_DIR
# ############################################################### # Set up final options. # ###############################################################
# We run gcc/clang with PWD=/proc/self/cwd to remove the $TOP # from the debug output. That way two builds in two different # directories will create the same output. # /proc doesn't exist on Darwin. ifeq ($(HOST_OS),linux)
RELATIVE_PWD := PWD=/proc/self/cwd else
RELATIVE_PWD := endif
# ############################################################### # Collect a list of the SDK versions that we could compile against # For use with the LOCAL_SDK_VERSION variable for include $(BUILD_PACKAGE) # ###############################################################
# The path where app can reference the support library resources.
ifdef TARGET_BUILD_USE_PREBUILT_SDKS
SUPPORT_LIBRARY_ROOT := $(HISTORICAL_SDK_VERSIONS_ROOT)/current/support else
SUPPORT_LIBRARY_ROOT := frameworks/support endif
# Resolve LOCAL_SDK_VERSION to prebuilt framework.aidl # $(1): An sdk version (LOCAL_SDK_VERSION)
resolve-prebuilt-sdk-aidl-path = $(call get-prebuilt-sdk-dir,$(call get-sdk-version,$(1)))/framework.aidl
# Historical SDK version N is stored in $(HISTORICAL_SDK_VERSIONS_ROOT)/N. # The 'current' version is whatever this source tree is. # # sgrax is the opposite of xargs. It takes the list of args and puts them # on each line for sort to process. # sort -g is a numeric sort, so 1 2 3 10 instead of 1 10 2 3.
# Numerically sort a list of numbers # $(1): the list of numbers to be sorted define numerically_sort
$(shell function sgrax() { \ while [ -n "$$1" ] ; doecho $$1 ; shift ; done \
} ; \
( sgrax $(1) | sort -g ) ) endef
# This produces a list like "current/core current/public current/system 4/public"
TARGET_AVAILABLE_SDK_VERSIONS := $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/*/android.jar)
TARGET_AVAILABLE_SDK_VERSIONS := $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/android.jar,%,$(TARGET_AVAILABLE_SDK_VERSIONS)) # Strips and reorganizes the "public", "core", "system" and "test" subdirs.
TARGET_AVAILABLE_SDK_VERSIONS := $(subst /public,,$(TARGET_AVAILABLE_SDK_VERSIONS))
TARGET_AVAILABLE_SDK_VERSIONS := $(patsubst %/core,core_%,$(TARGET_AVAILABLE_SDK_VERSIONS))
TARGET_AVAILABLE_SDK_VERSIONS := $(patsubst %/system,system_%,$(TARGET_AVAILABLE_SDK_VERSIONS))
TARGET_AVAILABLE_SDK_VERSIONS := $(patsubst %/test,test_%,$(TARGET_AVAILABLE_SDK_VERSIONS)) # module-lib and system-server are not supported in Make.
TARGET_AVAILABLE_SDK_VERSIONS := $(filter-out %/module-lib %/system-server,$(TARGET_AVAILABLE_SDK_VERSIONS))
TARGET_AVAIALBLE_SDK_VERSIONS := $(call numerically_sort,$(TARGET_AVAILABLE_SDK_VERSIONS))
# This is the standard way to name a directory containing prebuilt target # objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so
TARGET_PREBUILT_TAG := android-$(TARGET_ARCH)
ifdef TARGET_2ND_ARCH
TARGET_2ND_PREBUILT_TAG := android-$(TARGET_2ND_ARCH) endif
# Set up RS prebuilt variables for compatibility library
# API Level lists for Renderscript Compat lib.
RSCOMPAT_32BIT_ONLY_API_LEVELS := 891011121314151617181920
RSCOMPAT_NO_USAGEIO_API_LEVELS := 8910111213
APPS_DEFAULT_VERSION_NAME := $(PLATFORM_VERSION)
# Add BUILD_NUMBER to apps if PRODUCT_BUILD_APPS_WITH_BUILD_NUMBER is defined. ifeq ($(PRODUCT_BUILD_APPS_WITH_BUILD_NUMBER),true)
APPS_DEFAULT_VERSION_NAME := $(PLATFORM_VERSION)-$(BUILD_NUMBER_FROM_FILE) endif
# ANDROID_WARNING_ALLOWED_PROJECTS is generated by build/soong. define find_warning_allowed_projects
$(filter $(ANDROID_WARNING_ALLOWED_PROJECTS),$(1)/) endef
RBE_POOL := # When RBE is enabled, kati will be passed --default_pool=local_pool to put # most rules into the local pool. Explicitly set the pool to "none" for rules that # should be run outside the local pool, i.e. with -j500. ifneq (,$(filter-out false,$(USE_RBE)))
RBE_POOL := none endif
.KATI_READONLY := RBE_POOL
# Make ANDROID Soong config variables visible to Android.mk files, for # consistency with those defined in BoardConfig.mk files. include $(BUILD_SYSTEM)/android_soong_config_vars.mk
# EMMA_INSTRUMENT is set to true when coverage is enabled. Creates a suffix to # differeciate the coverage version of ninja files. This will save 5 minutes of # build time used to regenerate ninja. ifeq (true,$(EMMA_INSTRUMENT))
COVERAGE_SUFFIX := .coverage endif
ifeq (true,$(FULL_SYSTEM_OPTIMIZE_JAVA)) ifeq (false,$(SYSTEM_OPTIMIZE_JAVA))
$(error SYSTEM_OPTIMIZE_JAVA must be enabled when FULL_SYSTEM_OPTIMIZE_JAVA is enabled) endif endif
# ----------------------------------------------------------------- # Define fingerprint, thumbprint, and version tags for the current build # # BUILD_VERSION_TAGS is a comma-separated list of tags chosen by the device # implementer that further distinguishes the build. It's basically defined # by the device implementer. Here, we are adding a mandatory tag that # identifies the signing config of the build.
BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS) ifeq ($(TARGET_BUILD_TYPE),debug)
BUILD_VERSION_TAGS += debug endif # The "test-keys" tag marks builds signed with the old test keys, # which are available in the SDK. "dev-keys" marks builds signed with # non-default dev keys (usually private keys from a vendor directory). # Both of these tags will be removed and replaced with "release-keys" # when the target-files is signed in a post-build step. ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/make/target/product/security/testkey)
BUILD_KEYS := test-keys else
BUILD_KEYS := dev-keys endif
BUILD_VERSION_TAGS += $(BUILD_KEYS)
BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
# BUILD_FINGERPRINT is used to uniquely identify the combined build and product; # used by the OTA server. ifeq (,$(strip $(BUILD_FINGERPRINT)))
BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS) endif
# In order to allow product-config to be run in parallel for multiple lunch targets, the build_fingerprint file is product-specific.
BUILD_FINGERPRINT_FILE := $(PRODUCT_OUT)/build_fingerprint-$(TARGET_PRODUCT).txt ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) >$(BUILD_FINGERPRINT_FILE).tmp && (if ! cmp -s $(BUILD_FINGERPRINT_FILE).tmp $(BUILD_FINGERPRINT_FILE); then mv $(BUILD_FINGERPRINT_FILE).tmp $(BUILD_FINGERPRINT_FILE); elserm $(BUILD_FINGERPRINT_FILE).tmp; fi) && grep " " $(BUILD_FINGERPRINT_FILE)))
$(error BUILD_FINGERPRINT cannot contain spaces: "$(file <$(BUILD_FINGERPRINT_FILE))") endif
BUILD_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_FINGERPRINT_FILE)) # unset it for safety.
BUILD_FINGERPRINT :=
BUILD_UUID_FILE := $(SOONG_OUT_DIR)/build_uuid-$(TARGET_PRODUCT).txt
BUILD_UUID_FROM_FILE := $$(cat $(BUILD_UUID_FILE)) # unset it for safety.
BUILD_UUID_FILE :=
# BUILD_THUMBPRINT is used to uniquely identify the system build; used by the # OTA server. This purposefully excludes any product-specific variables. ifeq (,$(strip $(BUILD_THUMBPRINT)))
BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS) endif
# In order to allow product-config to be run in parallel for multiple lunch targets, the build_thumbprint file is product-specific.
BUILD_THUMBPRINT_FILE := $(PRODUCT_OUT)/build_thumbprint-$(TARGET_PRODUCT).txt ifeq ($(strip $(HAS_BUILD_NUMBER)),true)
$(BUILD_THUMBPRINT_FILE): $(BUILD_NUMBER_FILE) endif ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_THUMBPRINT) >$(BUILD_THUMBPRINT_FILE).tmp && (if ! cmp -s $(BUILD_THUMBPRINT_FILE).tmp $(BUILD_THUMBPRINT_FILE); then mv $(BUILD_THUMBPRINT_FILE).tmp $(BUILD_THUMBPRINT_FILE); elserm $(BUILD_THUMBPRINT_FILE).tmp; fi) && grep " " $(BUILD_THUMBPRINT_FILE)))
$(error BUILD_THUMBPRINT cannot contain spaces: "$(file <$(BUILD_THUMBPRINT_FILE))") endif # unset it for safety.
BUILD_THUMBPRINT_FILE :=
BUILD_THUMBPRINT :=
# BUILD_SYSTEM_FINGERPRINT is a fingerprint of the system image. Different from # the BUILD_THUMBPRINT, it includes system image attributes to uniquely identify # the system image; This purposefully excludes any product-specific variables. ifeq (,$(strip $(BUILD_SYSTEM_FINGERPRINT)))
BUILD_SYSTEM_FINGERPRINT := $(PRODUCT_SYSTEM_BRAND)/$(PRODUCT_SYSTEM_NAME)/$(PRODUCT_SYSTEM_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS) endif
# In order to allow product-config to be run in parallel for multiple lunch targets, the build_system_fingerprint file is product-specific.
BUILD_SYSTEM_FINGERPRINT_FILE := $(PRODUCT_OUT)/build_system_fingerprint-$(TARGET_PRODUCT).txt ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_SYSTEM_FINGERPRINT) >$(BUILD_SYSTEM_FINGERPRINT_FILE).tmp && (if ! cmp -s $(BUILD_SYSTEM_FINGERPRINT_FILE).tmp $(BUILD_SYSTEM_FINGERPRINT_FILE); then mv $(BUILD_SYSTEM_FINGERPRINT_FILE).tmp $(BUILD_SYSTEM_FINGERPRINT_FILE); elserm $(BUILD_SYSTEM_FINGERPRINT_FILE).tmp; fi) && grep " " $(BUILD_SYSTEM_FINGERPRINT_FILE)))
$(error BUILD_SYSTEM_FINGERPRINT cannot contain spaces: "$(file <$(BUILD_SYSTEM_FINGERPRINT_FILE))") endif
BUILD_SYSTEM_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_SYSTEM_FINGERPRINT_FILE)) # unset it for safety.
BUILD_SYSTEM_FINGERPRINT_FILE :=
BUILD_SYSTEM_FINGERPRINT :=
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.5 Sekunden
(vorverarbeitet am 2026-06-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.