2009-03-04 04:28:42 +01:00
# 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.
2017-10-17 10:30:14 +02:00
i f n d e f K A T I
$( warning Directly using config .mk from make is no longer supported .)
2017-11-03 23:52:50 +01:00
$( 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 )
2017-10-17 10:30:14 +02:00
$( error done )
e n d i f
2018-10-19 01:11:40 +02:00
BUILD_SYSTEM := $= build/make/core
BUILD_SYSTEM_COMMON := $= build/make/common
2012-09-27 22:26:25 +02:00
2018-10-19 01:11:40 +02:00
i n c l u d e $( BUILD_SYSTEM_COMMON ) / c o r e . m k
2018-03-28 23:33:10 +02:00
2019-09-26 23:57:33 +02:00
# -----------------------------------------------------------------
# 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).
i n c l u d e $( BUILD_SYSTEM ) / d i s t d i r . m k
2018-03-28 23:33:10 +02:00
# Mark variables that should be coming as environment variables from soong_ui
# as readonly
2018-10-18 01:50:49 +02:00
.KATI_READONLY := OUT_DIR TMPDIR BUILD_DATETIME_FILE
i f d e f C A L L E D _ F R O M _ S E T U P
2018-10-21 06:37:44 +02:00
.KATI_READONLY := CALLED_FROM_SETUP
2018-10-18 01:50:49 +02:00
e n d i f
i f d e f K A T I _ P A C K A G E _ M K _ D I R
.KATI_READONLY := KATI_PACKAGE_MK_DIR
e n d i f
2018-03-28 23:33:10 +02:00
2017-10-30 21:41:53 +01:00
# Mark variables deprecated/obsolete
2017-11-09 01:39:18 +01:00
CHANGES_URL := https://android.googlesource.com/platform/build/+/master/Changes.md
2019-01-23 04:38:56 +01:00
.KATI_READONLY := CHANGES_URL
2023-04-22 00:04:36 +02:00
$( 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 .)
2023-06-01 00:00:06 +02:00
$( 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 .)
2017-12-28 01:57:34 +01:00
$( KATI_obsolete_var PATH ,Do not use PATH directly . See $ ( CHANGES_URL ) #PATH )
2017-11-29 07:32:05 +01:00
$( 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 )
2017-12-28 01:57:34 +01:00
$( KATI_obsolete_var ANDROID_PRODUCT_OUT ,Use PRODUCT_OUT instead . See $ ( CHANGES_URL ) #ANDROID_PRODUCT_OUT )
2017-11-29 07:32:05 +01:00
$( 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 )
2018-01-04 00:15:38 +01:00
$( KATI_obsolete_var ANDROID_BUILD_TOP ,Use '.' instead . See $ ( CHANGES_URL ) #ANDROID_BUILD_TOP )
2017-11-29 07:32:05 +01:00
$( KATI_obsolete_var \
2017-11-09 01:39:18 +01:00
ANDROID_TOOLCHAIN \
ANDROID_TOOLCHAIN_2ND_ARCH \
ANDROID_DEV_SCRIPTS \
ANDROID_EMULATOR_PREBUILTS \
ANDROID_PRE_BUILD_PATHS \
,See $( CHANGES_URL) #other_envsetup_variables)
2017-12-13 03:01:09 +01:00
$( KATI_obsolete_var PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE ,Set FCM Version in device manifest instead . See $ ( CHANGES_URL ) #PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE )
2018-01-11 20:54:48 +01:00
$( KATI_obsolete_var USE_CLANG_PLATFORM_BUILD ,Clang is the only supported Android compiler . See $ ( CHANGES_URL ) #USE_CLANG_PLATFORM_BUILD )
2018-08-30 23:47:35 +02:00
$( KATI_obsolete_var BUILD_DROIDDOC ,Droiddoc is only supported in Soong . See details on build /soong /java /droiddoc .go )
2018-09-17 23:32:52 +02:00
$( KATI_obsolete_var BUILD_APIDIFF ,Apidiff is only supported in Soong . See details on build /soong /java /droiddoc .go )
2018-09-05 07:25:22 +02:00
$( 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 \
2018-10-08 04:41:21 +02:00
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 \
2018-09-05 07:25:22 +02:00
,GCC support has been removed. Use Clang instead)
2018-10-21 06:37:44 +02:00
$( KATI_obsolete_var DIST_DIR dist_goal ,Use dist -for -goals instead . See $ ( CHANGES_URL ) #dist )
2019-02-11 22:09:59 +01:00
$( KATI_obsolete_var TARGET_ANDROID_FILESYSTEM_CONFIG_H ,Use TARGET_FS_CONFIG_GEN instead )
2019-01-02 23:32:54 +01:00
$( KATI_deprecated_var USER ,Use BUILD_USERNAME instead . See $ ( CHANGES_URL ) #USER )
2019-04-17 00:18:52 +02:00
$( 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 )
2019-04-18 18:38:25 +02:00
$( KATI_obsolete_var BUILD_BROKEN_PHONY_TARGETS )
2019-04-18 18:38:25 +02:00
$( KATI_obsolete_var BUILD_BROKEN_DUP_COPY_HEADERS )
2019-02-10 03:58:36 +01:00
$( KATI_obsolete_var BUILD_BROKEN_ENG_DEBUG_TAGS )
2019-05-15 07:03:58 +02:00
$( KATI_obsolete_export It is a global setting . See $ ( CHANGES_URL ) #export_keyword )
$( KATI_obsolete_var BUILD_BROKEN_ANDROIDMK_EXPORTS )
2023-12-27 02:09:36 +01:00
$( KATI_obsolete_var PRODUCT_NOTICE_SPLIT_OVERRIDE ,Stop using this , keep calm , and carry on .)
2019-05-29 01:30:18 +02:00
$( KATI_obsolete_var PRODUCT_STATIC_BOOT_CONTROL_HAL ,Use shared library module instead . See $ ( CHANGES_URL ) #PRODUCT_STATIC_BOOT_CONTROL_HAL )
2019-07-19 00:03:52 +02:00
$( 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 \
)
2019-07-30 17:41:49 +02:00
$( KATI_obsolete_var PRODUCT_IOT )
2019-09-06 19:58:14 +02:00
$( KATI_obsolete_var MD 5SUM )
2019-10-12 00:52:44 +02:00
$( 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 )
2020-03-07 03:09:06 +01:00
$( 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)
2020-03-07 03:27:52 +01:00
$( KATI_obsolete_var HOST_OUT_TEST_CONFIG TARGET_OUT_TEST_CONFIG LOCAL_TEST_CONFIG_OPTIONS )
2020-05-01 06:18:58 +02:00
$( 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)
2020-04-18 00:46:55 +02:00
$( KATI_obsolete_var TARGET_PREFER_ 32_BIT TARGET_PREFER_ 32_BIT_APPS TARGET_PREFER_ 32_BIT_EXECUTABLES )
2021-02-21 14:36:19 +01:00
$( 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 )
2020-07-07 16:19:44 +02:00
$( KATI_obsolete_var COVERAGE_PATHS ,Use NATIVE_COVERAGE_PATHS instead )
$( KATI_obsolete_var COVERAGE_EXCLUDE_PATHS ,Use NATIVE_COVERAGE_EXCLUDE_PATHS instead )
2021-02-21 14:36:19 +01:00
$( KATI_obsolete_var BOARD_VNDK_RUNTIME_DISABLE ,VNDK -Lite is no longer supported )
$( KATI_obsolete_var LOCAL_SANITIZE_BLACKLIST ,Use LOCAL_SANITIZE_BLOCKLIST instead )
2022-06-09 06:26:35 +02:00
$( 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 )
2020-10-17 00:10:21 +02:00
$( KATI_obsolete_var TARGET_NO_VENDOR_BOOT ,Use PRODUCT_BUILD_VENDOR_BOOT_IMAGE instead )
2021-03-30 10:52:59 +02:00
$( KATI_obsolete_var PRODUCT_CHECK_ELF_FILES ,Use BUILD_BROKEN_PREBUILT_ELF_FILES instead )
2022-03-21 22:31:31 +01:00
$( KATI_obsolete_var ALL_GENERATED_SOURCES ,ALL_GENERATED_SOURCES is no longer used )
2022-03-21 22:32:42 +01:00
$( KATI_obsolete_var ALL_ORIGINAL_DYNAMIC_BINARIES ,ALL_ORIGINAL_DYNAMIC_BINARIES is no longer used )
2022-08-08 11:34:47 +02:00
$( 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 )
2022-08-08 11:16:30 +02:00
$( KATI_obsolete_var PRODUCT_SUPPORTS_BOOT_SIGNER ,VB 1.0 and related variables are no longer supported )
2022-08-08 11:49:14 +02:00
$( KATI_obsolete_var PRODUCT_VERITY_SIGNING_KEY ,VB 1.0 and related variables are no longer supported )
2022-09-07 11:36:54 +02:00
$( KATI_obsolete_var BOARD_PREBUILT_PVMFWIMAGE ,pvmfw .bin is now built in AOSP and custom versions are no longer supported )
2023-03-28 01:36:27 +02:00
$( KATI_obsolete_var BUILDING_PVMFW_IMAGE ,BUILDING_PVMFW_IMAGE is no longer used )
2022-10-25 19:46:10 +02:00
$( KATI_obsolete_var BOARD_BUILD_SYSTEM_ROOT_IMAGE )
2024-03-14 16:29:48 +01:00
$( KATI_obsolete_var FS_GET_STATS )
2022-10-25 19:46:10 +02:00
2016-11-10 01:35:34 +01:00
# Used to force goals to build. Only use for conditionally defined goals.
.PHONY : FORCE
FORCE :
ORIGINAL_MAKECMDGOALS := $( MAKECMDGOALS)
2017-07-25 09:57:38 +02:00
UNAME := $( shell uname -sm)
2019-04-10 06:35:37 +02:00
SRC_TARGET_DIR := $( TOPDIR) build/make/target
2009-03-04 04:28:42 +01:00
# Some specific paths to tools
2017-12-06 23:38:40 +01:00
SRC_DROIDDOC_DIR := $( TOPDIR) build/make/tools/droiddoc
2009-03-04 04:28:42 +01:00
2018-05-02 09:15:41 +02:00
# Mark some inputs as readonly
i f d e f T A R G E T _ D E V I C E _ D I R
.KATI_READONLY := TARGET_DEVICE_DIR
e n d i f
2019-07-30 08:45:19 +02:00
ONE_SHOT_MAKEFILE :=
.KATI_READONLY := ONE_SHOT_MAKEFILE
2017-05-31 21:48:55 +02:00
# Set up efficient math functions which are used in make.
# Here since this file is included by envsetup as well as during build.
2018-10-19 01:11:40 +02:00
i n c l u d e $( BUILD_SYSTEM_COMMON ) / m a t h . m k
2017-05-31 21:48:55 +02:00
2018-10-19 01:11:40 +02:00
i n c l u d e $( BUILD_SYSTEM_COMMON ) / s t r i n g s . m k
2018-09-22 01:39:37 +02:00
2018-11-17 06:26:33 +01:00
i n c l u d e $( BUILD_SYSTEM_COMMON ) / j s o n . m k
2009-03-04 04:28:42 +01:00
# Various mappings to avoid hard-coding paths all over the place
i n c l u d e $( BUILD_SYSTEM ) / p a t h m a p . m k
2018-02-15 17:26:31 +01:00
# Allow projects to define their own globally-available variables
i n c l u d e $( BUILD_SYSTEM ) / p r o j e c t _ d e f i n i t i o n s . m k
2009-03-04 04:28:42 +01:00
# ###############################################################
# Build system internal files
# ###############################################################
2019-04-17 21:25:25 +02:00
BUILD_COMBOS := $= $( BUILD_SYSTEM) /combo
CLEAR_VARS := $= $( BUILD_SYSTEM) /clear_vars.mk
BUILD_HOST_STATIC_LIBRARY := $= $( BUILD_SYSTEM) /host_static_library.mk
BUILD_HOST_SHARED_LIBRARY := $= $( BUILD_SYSTEM) /host_shared_library.mk
BUILD_STATIC_LIBRARY := $= $( BUILD_SYSTEM) /static_library.mk
BUILD_HEADER_LIBRARY := $= $( BUILD_SYSTEM) /header_library.mk
BUILD_SHARED_LIBRARY := $= $( BUILD_SYSTEM) /shared_library.mk
BUILD_EXECUTABLE := $= $( BUILD_SYSTEM) /executable.mk
BUILD_HOST_EXECUTABLE := $= $( BUILD_SYSTEM) /host_executable.mk
BUILD_PACKAGE := $= $( BUILD_SYSTEM) /package.mk
BUILD_PHONY_PACKAGE := $= $( BUILD_SYSTEM) /phony_package.mk
BUILD_RRO_PACKAGE := $= $( BUILD_SYSTEM) /build_rro_package.mk
BUILD_HOST_PREBUILT := $= $( BUILD_SYSTEM) /host_prebuilt.mk
BUILD_PREBUILT := $= $( BUILD_SYSTEM) /prebuilt.mk
BUILD_MULTI_PREBUILT := $= $( BUILD_SYSTEM) /multi_prebuilt.mk
BUILD_JAVA_LIBRARY := $= $( BUILD_SYSTEM) /java_library.mk
BUILD_STATIC_JAVA_LIBRARY := $= $( BUILD_SYSTEM) /static_java_library.mk
BUILD_HOST_JAVA_LIBRARY := $= $( BUILD_SYSTEM) /host_java_library.mk
BUILD_COPY_HEADERS := $= $( BUILD_SYSTEM) /copy_headers.mk
BUILD_NATIVE_TEST := $= $( BUILD_SYSTEM) /native_test.mk
BUILD_FUZZ_TEST := $= $( BUILD_SYSTEM) /fuzz_test.mk
BUILD_NOTICE_FILE := $= $( BUILD_SYSTEM) /notice_files.mk
2023-01-05 02:13:47 +01:00
BUILD_SBOM_GEN := $= $( BUILD_SYSTEM) /sbom.mk
2019-04-17 21:25:25 +02:00
2019-04-17 21:25:09 +02:00
i n c l u d e $( BUILD_SYSTEM ) / d e p r e c a t i o n . m k
2017-12-07 00:57:31 +01:00
2009-03-04 04:28:42 +01:00
# ###############################################################
# Parse out any modifier targets.
# ###############################################################
2017-05-26 07:10:08 +02:00
hide := @
2009-03-04 04:28:42 +01:00
2015-10-28 22:33:40 +01:00
################################################################
# Tools needed in product configuration makefiles.
################################################################
2017-12-06 23:38:40 +01:00
NORMALIZE_PATH := build/make/tools/normalize_path.py
2015-10-28 22:33:40 +01:00
# $(1): the paths to be normalized
d e f i n e n o r m a l i z e - p a t h s
$( if $ ( 1) ,$ ( shell $ ( NORMALIZE_PATH ) $ ( 1) ) )
e n d e f
2009-03-04 04:28:42 +01:00
# ###############################################################
# Set common values
# ###############################################################
2018-03-13 08:04:48 +01:00
# Initialize SOONG_CONFIG_NAMESPACES so that it isn't recursive.
SOONG_CONFIG_NAMESPACES :=
2021-10-07 21:06:49 +02:00
# 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.
2020-01-03 02:59:11 +01:00
# 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)
d e f i n e a d d _ s o o n g _ c o n f i g _ n a m e s p a c e
2023-05-16 19:46:24 +02:00
$( eval SOONG_CONFIG_NAMESPACES += $ ( strip $ 1) ) \
2021-08-20 20:08:41 +02:00
$(eval SOONG_CONFIG_$(strip $1) : =)
2020-01-03 02:59:11 +01:00
e n d e f
2020-02-07 00:27:59 +01:00
# 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
2020-01-03 02:59:11 +01:00
# soong_config_module_type in an Android.bp file.
2020-02-07 00:27:59 +01:00
# $1 is the namespace. $2 is the list of variables.
# Ex: $(call add_soong_config_var,acme,COOL_FEATURE_A COOL_FEATURE_B)
2020-01-03 02:59:11 +01:00
d e f i n e a d d _ s o o n g _ c o n f i g _ v a r
2023-05-16 19:46:24 +02:00
$( eval SOONG_CONFIG_ $ ( strip $ 1) += $ ( strip $ 2) ) \
$(foreach v,$(strip $2),$(eval SOONG_CONFIG_$(strip $1)_$v : = $( strip $ ( $ v ) ) ))
2020-01-03 02:59:11 +01:00
e n d e f
# 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)
d e f i n e a d d _ s o o n g _ c o n f i g _ v a r _ v a l u e
2023-05-16 19:46:24 +02:00
$(eval $(strip $2) : = $( strip $ 3) ) \
2020-01-03 02:59:11 +01:00
$( call add_soong_config_var ,$ 1,$ 2)
e n d e f
2021-10-07 21:06:49 +02:00
# Soong config namespace variables manipulation.
#
# internal utility to define a namespace and a variable in it.
d e f i n e s o o n g _ c o n f i g _ d e f i n e _ i n t e r n a l
2023-05-16 19:46:24 +02:00
$(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) ))
2021-10-07 21:06:49 +02:00
e n d e f
# 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)
d e f i n e s o o n g _ c o n f i g _ s e t
$( call soong_config_define_internal ,$ 1,$ 2) \
2023-05-16 19:46:24 +02:00
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2) : =$( strip $ 3) )
2021-10-07 21:06:49 +02:00
e n d e f
# soong_config_append appends to the value of the variable in the given Soong
2021-11-08 21:12:45 +01:00
# config namespace. If the variable does not exist, it will be defined. If the
2021-10-07 21:06:49 +02:00
# namespace does not exist, it will be defined.
# $1 is the namespace, $2 is the variable name, $3 is the value
d e f i n e s o o n g _ c o n f i g _ a p p e n d
$( call soong_config_define_internal ,$ 1,$ 2) \
2023-05-16 19:46:24 +02:00
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2) : =$( SOONG_CONFIG_ $ ( strip $ 1) _ $ ( strip $ 2) ) $( strip $ 3) )
2021-10-07 21:06:49 +02:00
e n d e f
2021-11-08 21:12:45 +01:00
# 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
d e f i n e s o o n g _ c o n f i g _ g e t
$( SOONG_CONFIG_ $ ( strip $ 1) _ $ ( strip $ 2) )
e n d e f
2009-03-04 04:28:42 +01:00
# Set the extensions used for various packages
COMMON_PACKAGE_SUFFIX := .zip
COMMON_JAVA_PACKAGE_SUFFIX := .jar
COMMON_ANDROID_PACKAGE_SUFFIX := .apk
2015-03-13 12:08:26 +01:00
i f d e f T M P D I R
JAVA_TMPDIR_ARG := -Djava.io.tmpdir= $( TMPDIR)
e l s e
JAVA_TMPDIR_ARG :=
e n d i f
2023-06-23 17:22:42 +02:00
# 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_USES_SOONG_PYTHON2_MODULES \
# Build broken variables that should be treated as lists
_build_broken_list_vars := \
BUILD_BROKEN_PLUGIN_VALIDATION \
_build_broken_var_names := $( _build_broken_bool_vars)
_build_broken_var_names += $( _build_broken_list_vars)
$(foreach v,$(_build_broken_var_names),$(eval $(v) : =))
2009-03-04 04:28:42 +01:00
# ###############################################################
# Include sub-configuration files
# ###############################################################
# ---------------------------------------------------------------
# Try to include buildspec.mk, which will try to set stuff up.
2013-06-27 21:02:46 +02:00
# If this file doesn't exist, the environment variables will
2009-03-04 04:28:42 +01:00
# be used, and if that doesn't work, then the default is an
# arm build
2011-11-02 21:49:08 +01:00
i f n d e f A N D R O I D _ B U I L D S P E C
ANDROID_BUILDSPEC := $( TOPDIR) buildspec.mk
e n d i f
- i n c l u d e $( ANDROID_BUILDSPEC )
2009-03-04 04:28:42 +01:00
# ---------------------------------------------------------------
# Define most of the global variables. These are the ones that
# are specific to the user's build configuration.
i n c l u d e $( BUILD_SYSTEM ) / e n v s e t u p . m k
2023-06-23 17:22:42 +02:00
$( 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)
2023-04-08 08:46:43 +02:00
# Returns true if it is a low memory device, otherwise it returns false.
d e f i n e i s - l o w - m e m - d e v i c e
$( 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 ) ) ) ) ) ) ) ) )
e n d e f
# Set TARGET_MAX_PAGE_SIZE_SUPPORTED.
2023-07-14 19:42:31 +02:00
# TARGET_MAX_PAGE_SIZE_SUPPORTED indicates the alignment of the ELF segments.
2023-04-08 08:46:43 +02:00
i f d e f P R O D U C T _ M A X _ P A G E _ S I Z E _ S U P P O R T E D
TARGET_MAX_PAGE_SIZE_SUPPORTED := $( PRODUCT_MAX_PAGE_SIZE_SUPPORTED)
e l s e i f e q ( $( strip $ ( call is -low -mem -device ) ) , t r u e )
# Low memory device will have 4096 binary alignment.
TARGET_MAX_PAGE_SIZE_SUPPORTED := 4096
2024-03-22 00:50:34 +01:00
e l s e i f e q ( $( call math_lt ,$ ( VSR_VENDOR_API_LEVEL ) ,34) , t r u e )
TARGET_MAX_PAGE_SIZE_SUPPORTED := 4096
e l s e i f e q ( , $( filter arm 64 x 86_ 64,$ ( TARGET_ARCH ) ) )
# TARGET_MAX_PAGE_SIZE_SUPPORTED > 4096 is only supported in arm64 and
# x86_64 targets.
2023-04-08 08:46:43 +02:00
TARGET_MAX_PAGE_SIZE_SUPPORTED := 4096
2024-03-22 00:50:34 +01:00
e l s e
# The default binary alignment for userspace is 16384.
TARGET_MAX_PAGE_SIZE_SUPPORTED := 16384
2023-04-08 08:46:43 +02:00
e n d i f
.KATI_READONLY := TARGET_MAX_PAGE_SIZE_SUPPORTED
2024-06-01 00:29:25 +02:00
i f d e f P R O D U C T _ C H E C K _ P R E B U I L T _ M A X _ P A G E _ S I Z E
TARGET_CHECK_PREBUILT_MAX_PAGE_SIZE := $( PRODUCT_CHECK_PREBUILT_MAX_PAGE_SIZE)
e l s e
TARGET_CHECK_PREBUILT_MAX_PAGE_SIZE := false
e n d i f
.KATI_READONLY := TARGET_CHECK_PREBUILT_MAX_PAGE_SIZE
2024-03-26 05:09:17 +01:00
# Boolean variable determining if AOSP relies on bionic's PAGE_SIZE macro.
2023-12-04 23:34:42 +01:00
i f d e f P R O D U C T _ N O _ B I O N I C _ P A G E _ S I Z E _ M A C R O
TARGET_NO_BIONIC_PAGE_SIZE_MACRO := $( PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO)
2024-04-15 19:32:27 +02:00
e l s e i f e q ( $( call math_lt ,$ ( VSR_VENDOR_API_LEVEL ) ,35) , t r u e )
TARGET_NO_BIONIC_PAGE_SIZE_MACRO := false
e l s e
TARGET_NO_BIONIC_PAGE_SIZE_MACRO := true
2023-07-14 19:42:31 +02:00
e n d i f
2023-12-04 23:34:42 +01:00
.KATI_READONLY := TARGET_NO_BIONIC_PAGE_SIZE_MACRO
2023-07-14 19:42:31 +02:00
2015-06-09 19:35:45 +02:00
# Pruned directory options used when using findleaves.py
# See envsetup.mk for a description of SCAN_EXCLUDE_DIRS
2016-10-05 01:21:49 +02:00
FIND_LEAVES_EXCLUDES := $( addprefix --prune= , $( SCAN_EXCLUDE_DIRS) .repo .git)
2015-06-09 19:35:45 +02:00
2012-03-30 19:45:38 +02:00
# 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
2016-04-22 19:18:15 +02:00
# bionic/libc/kernel/tools/clean_header.py tool. Additionally, the original
# kernel headers must also be checked in, but in a different subdirectory. By
2012-03-30 19:45:38 +02:00
# 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
#
2012-03-15 07:50:17 +01:00
TARGET_DEVICE_KERNEL_HEADERS := $( strip $( wildcard $( TARGET_DEVICE_DIR) /kernel-headers) )
2012-03-16 17:57:11 +01:00
d e f i n e v a l i d a t e - k e r n e l - h e a d e r s
$( if $ ( firstword $ ( foreach hdr_dir ,$ ( 1) ,\
$( filter-out kernel-headers,$( notdir $( hdr_dir) ) ) ) ) ,\
$( error Kernel header dirs must be end in kernel-headers: $( 1) ) )
e n d e f
2012-03-15 07:50:17 +01:00
# 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) )
2012-03-16 17:57:11 +01:00
$( 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 ) )
2019-02-26 16:49:25 +01:00
.KATI_READONLY := TARGET_DEVICE_KERNEL_HEADERS TARGET_BOARD_KERNEL_HEADERS TARGET_PRODUCT_KERNEL_HEADERS
2012-03-15 07:50:17 +01:00
2015-10-09 07:36:04 +02:00
# Commands to generate .toc file common to ELF .so files.
d e f i n e _ g e n _ t o c _ c o m m a n d _ f o r _ e l f
2015-11-05 04:51:08 +01:00
$( hide ) ( $( $ ( PRIVATE_ 2ND_ARCH_VAR_PREFIX ) $ ( PRIVATE_PREFIX ) READELF ) - d $( 1) | g r e p S O N A M E | | e c h o "No SONAME for $1" ) > $( 2)
2016-01-06 07:13:25 +01:00
$( hide ) $( $ ( PRIVATE_ 2ND_ARCH_VAR_PREFIX ) $ ( PRIVATE_PREFIX ) READELF ) - - d y n - s y m s $( 1) | a w k '{$$2=""; $$3=""; print}' > > $( 2)
2015-10-09 07:36:04 +02:00
e n d e f
# Commands to generate .toc file from Darwin dynamic library.
d e f i n e _ g e n _ t o c _ c o m m a n d _ f o r _ m a c h o
2018-06-04 01:20:08 +02:00
$( hide ) $( HOST_OTOOL ) - l $( 1) | g r e p L C _ I D _ D Y L I B - A 5 > $( 2)
$( hide ) $( HOST_NM ) - g P $( 1) | c u t - f 1 - 2 - d " " | ( g r e p - v U $$ > > $( 2) | | t r u e )
2015-10-09 07:36:04 +02:00
e n d e f
2023-01-19 19:00:54 +01:00
# Pick a Java compiler.
i n c l u d e $( BUILD_SYSTEM ) / c o m b o / j a v a c . m k
2017-10-12 10:35:14 +02:00
i f e q ( $( CALLED_FROM_SETUP ) , t r u e )
2015-07-21 03:40:18 +02:00
i n c l u d e $( BUILD_SYSTEM ) / c c a c h e . m k
2019-07-17 14:28:40 +02:00
i n c l u d e $( BUILD_SYSTEM ) / r b e . m k
2016-08-31 22:32:39 +02:00
e n d i f
2016-08-31 18:35:32 +02:00
2016-05-17 07:07:31 +02:00
# GCC version selection
TARGET_GCC_VERSION := 4.9
i f d e f T A R G E T _ 2 N D _ A R C H
2ND_TARGET_GCC_VERSION := 4.9
e n d i f
2016-09-27 02:37:19 +02:00
# Normalize WITH_STATIC_ANALYZER
2013-09-10 11:37:14 +02:00
i f e q ( $( strip $ ( WITH_STATIC_ANALYZER ) ) , 0 )
WITH_STATIC_ANALYZER :=
e n d i f
2016-04-01 01:30:23 +02:00
# Unset WITH_TIDY_ONLY if global WITH_TIDY_ONLY is not true nor 1.
i f e q ( , $( filter 1 true ,$ ( WITH_TIDY_ONLY ) ) )
WITH_TIDY_ONLY :=
e n d i f
2009-03-04 04:28:42 +01:00
# ---------------------------------------------------------------
# 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.
i f e q ( , $( strip $ ( CALLED_FROM_SETUP ) ) )
i f n e q ( , $( strip $ ( BUILD_ENV_SEQUENCE_NUMBER ) ) )
i f n e q ( $( 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 ..)
e n d i f
e n d i f
e n d i f
2017-06-03 00:25:20 +02:00
# ---------------------------------------------------------------
# Whether we can expect a full build graph
ALLOW_MISSING_DEPENDENCIES := $( filter true,$( ALLOW_MISSING_DEPENDENCIES) )
i f n e q ( $( TARGET_BUILD_APPS ) , )
ALLOW_MISSING_DEPENDENCIES := true
e n d i f
2020-07-08 11:10:38 +02:00
i f e q ( $( TARGET_BUILD_UNBUNDLED_IMAGE ) , t r u e )
ALLOW_MISSING_DEPENDENCIES := true
e n d i f
2017-06-03 00:25:20 +02:00
i f n e q ( $( filter true ,$ ( SOONG_ALLOW_MISSING_DEPENDENCIES ) ) , )
ALLOW_MISSING_DEPENDENCIES := true
e n d i f
2021-07-08 23:21:11 +02:00
# Mac builds default to ALLOW_MISSING_DEPENDENCIES, at least until the host
# tools aren't enabled by default for Mac.
i f e q ( $( HOST_OS ) , d a r w i n )
ALLOW_MISSING_DEPENDENCIES := true
e n d i f
2017-06-03 00:25:20 +02:00
.KATI_READONLY := ALLOW_MISSING_DEPENDENCIES
2020-07-08 11:10:38 +02:00
TARGET_BUILD_USE_PREBUILT_SDKS :=
2020-07-08 11:18:11 +02:00
DISABLE_PREOPT :=
2023-05-10 14:49:05 +02:00
DISABLE_PREOPT_BOOT_IMAGES :=
2020-07-08 11:10:38 +02:00
i f n e q ( , $( TARGET_BUILD_APPS ) $( TARGET_BUILD_UNBUNDLED_IMAGE ) )
2020-07-08 11:18:11 +02:00
DISABLE_PREOPT := true
2023-05-24 17:03:05 +02:00
# VSDK builds perform dexpreopt during merge_target_files build step.
ifneq ( true,$( BUILDING_WITH_VSDK) )
DISABLE_PREOPT_BOOT_IMAGES := true
endif
2022-03-28 21:36:47 +02:00
e n d i f
i f e q ( t r u e , $( TARGET_BUILD_UNBUNDLED ) )
ifneq ( true,$( UNBUNDLED_BUILD_SDKS_FROM_SOURCE) )
2020-07-08 11:10:38 +02:00
TARGET_BUILD_USE_PREBUILT_SDKS := true
2018-12-19 07:43:16 +01:00
endif
e n d i f
2020-07-08 11:18:11 +02:00
.KATI_READONLY := \
TARGET_BUILD_USE_PREBUILT_SDKS \
DISABLE_PREOPT \
2023-05-10 14:49:05 +02:00
DISABLE_PREOPT_BOOT_IMAGES \
2020-07-08 11:10:38 +02:00
2016-03-08 20:12:40 +01:00
prebuilt_sdk_tools := prebuilts/sdk/tools
prebuilt_sdk_tools_bin := $( prebuilt_sdk_tools) /$( HOST_OS) /bin
2015-12-03 01:33:04 +01:00
2017-09-23 00:03:38 +02:00
prebuilt_build_tools := prebuilts/build-tools
prebuilt_build_tools_wrappers := prebuilts/build-tools/common/bin
prebuilt_build_tools_jars := prebuilts/build-tools/common/framework
2018-05-26 01:13:52 +02:00
prebuilt_build_tools_bin_noasan := $( prebuilt_build_tools) /$( HOST_PREBUILT_TAG) /bin
2017-09-23 00:03:38 +02:00
i f e q ( $( filter address ,$ ( SANITIZE_HOST ) ) , )
2018-05-26 01:13:52 +02:00
prebuilt_build_tools_bin := $( prebuilt_build_tools_bin_noasan)
2017-09-23 00:03:38 +02:00
e l s e
prebuilt_build_tools_bin := $( prebuilt_build_tools) /$( HOST_PREBUILT_TAG) /asan/bin
e n d i f
2017-11-02 01:49:52 +01:00
# Work around for b/68406220
# This should match the soong version.
2018-06-06 23:46:25 +02:00
USE_D8 := true
2018-06-19 19:23:50 +02:00
.KATI_READONLY := USE_D8
2017-11-02 01:49:52 +01:00
2017-07-06 22:42:00 +02:00
#
2020-07-08 11:10:38 +02:00
# Tools that are prebuilts for TARGET_BUILD_USE_PREBUILT_SDKS
2017-07-06 22:42:00 +02:00
#
2020-05-29 00:46:33 +02:00
i f e q ( , $( TARGET_BUILD_USE_PREBUILT_SDKS ) )
2017-07-06 22:42:00 +02:00
AAPT := $( HOST_OUT_EXECUTABLES) /aapt
2020-05-29 00:46:33 +02:00
e l s e # TARGET_BUILD_USE_PREBUILT_SDKS
2017-07-06 22:42:00 +02:00
AAPT := $( prebuilt_sdk_tools_bin) /aapt
2020-05-29 00:46:33 +02:00
e n d i f # TARGET_BUILD_USE_PREBUILT_SDKS
2015-12-03 01:33:04 +01:00
2020-07-08 11:10:38 +02:00
i f e q ( , $( TARGET_BUILD_USE_PREBUILT_SDKS ) )
2020-05-29 00:46:33 +02:00
# Use RenderScript prebuilts for unbundled builds
2017-07-06 22:42:00 +02:00
LLVM_RS_CC := $( HOST_OUT_EXECUTABLES) /llvm-rs-cc
BCC_COMPAT := $( HOST_OUT_EXECUTABLES) /bcc_compat
e l s e
LLVM_RS_CC := $( prebuilt_sdk_tools_bin) /llvm-rs-cc
BCC_COMPAT := $( prebuilt_sdk_tools_bin) /bcc_compat
2020-05-29 00:46:33 +02:00
e n d i f
2016-08-07 05:15:06 +02:00
2017-07-06 22:42:00 +02:00
prebuilt_sdk_tools :=
prebuilt_sdk_tools_bin :=
2017-04-17 23:59:43 +02:00
2016-06-06 23:44:00 +02:00
ACP := $( prebuilt_build_tools_bin) /acp
2016-04-20 00:32:22 +02:00
CKATI := $( prebuilt_build_tools_bin) /ckati
2017-07-06 22:42:00 +02:00
DEPMOD := $( HOST_OUT_EXECUTABLES) /depmod
2021-10-26 03:44:00 +02:00
FILESLIST := $( HOST_OUT_EXECUTABLES) /fileslist
2019-06-11 01:39:45 +02:00
FILESLIST_UTIL := $= build/make/tools/fileslist_util.py
2018-06-13 23:51:05 +02:00
HOST_INIT_VERIFIER := $( HOST_OUT_EXECUTABLES) /host_init_verifier
2021-10-26 03:44:00 +02:00
XMLLINT := $( HOST_OUT_EXECUTABLES) /xmllint
2023-06-29 23:34:18 +02:00
ACONFIG := $( HOST_OUT_EXECUTABLES) /aconfig
2019-08-08 21:56:01 +02:00
# SOONG_ZIP is exported by Soong, but needs to be defined early for
# $OUT/dexpreopt.global. It will be verified against the Soong version.
2021-10-26 03:44:00 +02:00
SOONG_ZIP := $( HOST_OUT_EXECUTABLES) /soong_zip
2016-03-08 20:12:40 +01:00
2009-03-04 04:28:42 +01:00
# ---------------------------------------------------------------
# Generic tools.
2020-07-18 04:52:55 +02:00
# These dependencies are now handled via dependencies on prebuilt_build_tool
BISON_DATA := $=
2013-04-06 03:02:16 +02:00
2014-06-06 04:05:47 +02:00
YASM := prebuilts/misc/$( BUILD_OS) -$( HOST_PREBUILT_ARCH) /yasm/yasm
2009-03-04 04:28:42 +01:00
DOXYGEN := doxygen
2015-09-24 10:40:52 +02:00
i f e q ( $( HOST_OS ) , l i n u x )
BREAKPAD_DUMP_SYMS := $( HOST_OUT_EXECUTABLES) /dump_syms
e l s e
# For non-supported hosts, do not generate breakpad symbols.
BREAKPAD_GENERATE_SYMBOLS := false
e n d i f
2023-06-21 01:41:58 +02:00
GZIP := prebuilts/build-tools/path/$( BUILD_OS) -$( HOST_PREBUILT_ARCH) /gzip
2010-11-05 19:28:51 +01:00
PROTOC := $( HOST_OUT_EXECUTABLES) /aprotoc$( HOST_EXECUTABLE_SUFFIX)
2018-08-04 01:48:10 +02:00
NANOPB_SRCS := $( HOST_OUT_EXECUTABLES) /protoc-gen-nanopb
2009-03-04 04:28:42 +01:00
MKBOOTFS := $( HOST_OUT_EXECUTABLES) /mkbootfs$( HOST_EXECUTABLE_SUFFIX)
2023-06-21 01:41:58 +02:00
MINIGZIP := $( GZIP)
2020-05-11 22:20:03 +02:00
LZ4 := $( HOST_OUT_EXECUTABLES) /lz4$( HOST_EXECUTABLE_SUFFIX)
2012-11-26 01:53:44 +01:00
i f e q ( , $( strip $ ( BOARD_CUSTOM_MKBOOTIMG ) ) )
2009-03-04 04:28:42 +01:00
MKBOOTIMG := $( HOST_OUT_EXECUTABLES) /mkbootimg$( HOST_EXECUTABLE_SUFFIX)
2012-11-26 01:53:44 +01:00
e l s e
MKBOOTIMG := $( BOARD_CUSTOM_MKBOOTIMG)
e n d i f
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
BUG=31264226
TEST=Manually tested on edison-eng by inspecting {boot, system,
vbmeta}.img in out/ directory as well as their counterparts in
the IMAGES/ directory of edision-target_files-eng.zeuthen.zip
Merged-In: Ic9a61cfc65c148b12996e57f04da5432eef6b982
Change-Id: I97042655bca15e7eac899f12c5bada2f6184d307
2016-09-15 19:43:54 +02:00
i f e q ( , $( strip $ ( BOARD_CUSTOM_AVBTOOL ) ) )
AVBTOOL := $( HOST_OUT_EXECUTABLES) /avbtool$( HOST_EXECUTABLE_SUFFIX)
2016-01-29 22:59:17 +01:00
e l s e
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
BUG=31264226
TEST=Manually tested on edison-eng by inspecting {boot, system,
vbmeta}.img in out/ directory as well as their counterparts in
the IMAGES/ directory of edision-target_files-eng.zeuthen.zip
Merged-In: Ic9a61cfc65c148b12996e57f04da5432eef6b982
Change-Id: I97042655bca15e7eac899f12c5bada2f6184d307
2016-09-15 19:43:54 +02:00
AVBTOOL := $( BOARD_CUSTOM_AVBTOOL)
2016-01-29 22:59:17 +01:00
e n d i f
2018-12-28 16:47:50 +01:00
APICHECK := $( HOST_OUT_JAVA_LIBRARIES) /metalava$( COMMON_JAVA_PACKAGE_SUFFIX)
2018-08-16 01:16:21 +02:00
MKEXTUSERIMG := $( HOST_OUT_EXECUTABLES) /mkuserimg_mke2fs
2017-03-11 01:53:45 +01:00
MKE2FS_CONF := system/extras/ext4_utils/mke2fs.conf
2022-01-20 07:43:09 +01:00
MKEROFS := $( HOST_OUT_EXECUTABLES) /mkfs.erofs
2022-09-06 03:34:56 +02:00
MKSQUASHFSUSERIMG := $( HOST_OUT_EXECUTABLES) /mksquashfsimage
MKF2FSUSERIMG := $( HOST_OUT_EXECUTABLES) /mkf2fsuserimg
2012-11-27 03:10:23 +01:00
SIMG2IMG := $( HOST_OUT_EXECUTABLES) /simg2img$( HOST_EXECUTABLE_SUFFIX)
E2FSCK := $( HOST_OUT_EXECUTABLES) /e2fsck$( HOST_EXECUTABLE_SUFFIX)
2010-05-07 11:23:59 +02:00
TUNE2FS := $( HOST_OUT_EXECUTABLES) /tune2fs$( HOST_EXECUTABLE_SUFFIX)
2010-05-04 00:01:38 +02:00
JARJAR := $( HOST_OUT_JAVA_LIBRARIES) /jarjar.jar
2015-04-19 18:55:39 +02:00
DATA_BINDING_COMPILER := $( HOST_OUT_JAVA_LIBRARIES) /databinding-compiler.jar
2017-12-06 23:38:40 +01:00
FAT16COPY := build/make/tools/fat16copy.py
2022-10-27 02:44:24 +02:00
CHECK_ELF_FILE := $( HOST_OUT_EXECUTABLES) /check_elf_file$( HOST_EXECUTABLE_SUFFIX)
2018-08-30 22:11:47 +02:00
LPMAKE := $( HOST_OUT_EXECUTABLES) /lpmake$( HOST_EXECUTABLE_SUFFIX)
2019-06-25 20:42:12 +02:00
ADD_IMG_TO_TARGET_FILES := $( HOST_OUT_EXECUTABLES) /add_img_to_target_files$( HOST_EXECUTABLE_SUFFIX)
2019-05-07 22:12:21 +02:00
BUILD_IMAGE := $( HOST_OUT_EXECUTABLES) /build_image$( HOST_EXECUTABLE_SUFFIX)
2023-03-17 21:17:35 +01:00
i f e q ( , $( strip $ ( BOARD_CUSTOM_BUILD_SUPER_IMAGE ) ) )
2019-05-07 22:12:21 +02:00
BUILD_SUPER_IMAGE := $( HOST_OUT_EXECUTABLES) /build_super_image$( HOST_EXECUTABLE_SUFFIX)
2023-03-17 21:17:35 +01:00
e l s e
BUILD_SUPER_IMAGE := $( BOARD_CUSTOM_BUILD_SUPER_IMAGE)
e n d i f
2019-08-15 08:08:18 +02:00
IMG_FROM_TARGET_FILES := $( HOST_OUT_EXECUTABLES) /img_from_target_files$( HOST_EXECUTABLE_SUFFIX)
2023-10-17 21:27:56 +02:00
UNPACK_BOOTIMG := $( HOST_OUT_EXECUTABLES) /unpack_bootimg
2019-08-07 08:21:23 +02:00
MAKE_RECOVERY_PATCH := $( HOST_OUT_EXECUTABLES) /make_recovery_patch$( HOST_EXECUTABLE_SUFFIX)
2019-08-05 21:05:45 +02:00
OTA_FROM_TARGET_FILES := $( HOST_OUT_EXECUTABLES) /ota_from_target_files$( HOST_EXECUTABLE_SUFFIX)
2023-08-23 02:47:44 +02:00
OTA_FROM_RAW_IMG := $( HOST_OUT_EXECUTABLES) /ota_from_raw_img$( HOST_EXECUTABLE_SUFFIX)
2019-08-07 08:21:23 +02:00
SPARSE_IMG := $( HOST_OUT_EXECUTABLES) /sparse_img$( HOST_EXECUTABLE_SUFFIX)
2019-11-01 19:23:19 +01:00
CHECK_PARTITION_SIZES := $( HOST_OUT_EXECUTABLES) /check_partition_sizes$( HOST_EXECUTABLE_SUFFIX)
2022-04-06 03:11:20 +02:00
SYMBOLS_MAP := $( HOST_OUT_EXECUTABLES) /symbols_map
2015-02-02 12:18:20 +01:00
2019-01-18 08:01:45 +01:00
PROGUARD_HOME := external/proguard
PROGUARD := $( PROGUARD_HOME) /bin/proguard.sh
PROGUARD_DEPS := $( PROGUARD) $( PROGUARD_HOME) /lib/proguard.jar
2017-12-06 23:38:40 +01:00
JAVATAGS := build/make/tools/java-event-log-tags.py
MERGETAGS := build/make/tools/merge-event-log-tags.py
2014-04-29 01:27:32 +02:00
APPEND2SIMG := $( HOST_OUT_EXECUTABLES) /append2simg
VERITY_SIGNER := $( HOST_OUT_EXECUTABLES) /verity_signer
2019-05-03 03:17:18 +02:00
BUILD_VERITY_METADATA := $( HOST_OUT_EXECUTABLES) /build_verity_metadata
2014-04-17 03:49:56 +02:00
BUILD_VERITY_TREE := $( HOST_OUT_EXECUTABLES) /build_verity_tree
2017-02-17 23:11:13 +01:00
FUTILITY := $( HOST_OUT_EXECUTABLES) /futility-host
2019-05-07 01:23:09 +02:00
VBOOT_SIGNER := $( HOST_OUT_EXECUTABLES) /vboot_signer
2009-03-04 04:28:42 +01:00
2019-04-03 18:30:06 +02:00
DEXDUMP := $( HOST_OUT_EXECUTABLES) /dexdump$( BUILD_EXECUTABLE_SUFFIX)
2017-02-28 20:17:32 +01:00
PROFMAN := $( HOST_OUT_EXECUTABLES) /profman
2015-11-09 08:47:42 +01:00
2023-01-05 02:13:47 +01:00
GEN_SBOM := $( HOST_OUT_EXECUTABLES) /generate-sbom
2014-05-20 10:04:16 +02:00
FINDBUGS_DIR := external/owasp/sanitizer/tools/findbugs/bin
FINDBUGS := $( FINDBUGS_DIR) /findbugs
2009-03-04 04:28:42 +01:00
2018-01-31 23:34:07 +01:00
JETIFIER := prebuilts/sdk/tools/jetifier/jetifier-standalone/bin/jetifier-standalone
2018-11-02 21:43:30 +01:00
EXTRACT_KERNEL := build/make/tools/extract_kernel.py
Pass OpenJDK 8's bootclasspath for host tools targeting <= 1.8.
Host (as opposed to hostdex) tools compile and run against OpenJDK's
core libraries. Before this CL, the core libraries of the default
toolchain were always used, even when targeting an earlier language
version.
This meant that code that uses APIs from a later version of OpenJDK
than corresponded to LOCAL_JAVA_LANGUAGE_VERSION would compile, but
would fail to run under that earlier version of OpenJDK. It also
meant that calls to existing APIs might be reinterpreted; for
example, the return type of java.nio.ByteBuffer.clear() changed from
Buffer in OpenJDK 8 to ByteBuffer in OpenJDK 9. At compile time, this
was noted via the warning:
bootstrap class path not set in conjunction with -source 1.8
After this CL, when targeting a language version <= 1.8 (which is
always the case when building with OpenJDK 8), some of OpenJDK 8's
core library/tools jars are now passed on the bootclasspath. The
decision to include the bootclasspath argument when building with
OpenJDK 8 was somewhat arbitrary, but has the advantage that we
discover any issues before we switch to OpenJDK 9.
Even when compiling with OpenJDK 9, use of OpenJDK 9 APIs will now
fail at compile time rather than at runtime; calls to existing APIs
will now be interpreted in OpenJDK 8 rather than 9 fashion. For
example, this means that dx and host-side CTS tests built with
OpenJDK 9 javac -target 1.8 will be runnable under OpenJDK 8.
Bug: 70521453
Bug: 70862583
Test: Checked that the bootclasspath argument was passed
in the javac invocation targeting 1.8 during:
make showcommands compatibility-common-util-hostsidelib
Test: make checkbuild
Change-Id: I9b6081edfdd2c3e9a450ae8a39c4e32c3d2cda92
2017-12-20 19:36:56 +01:00
# Path to tools.jar
HOST_JDK_TOOLS_JAR := $( ANDROID_JAVA8_HOME) /lib/tools.jar
2009-03-04 04:28:42 +01:00
2023-07-12 14:01:19 +02:00
APICHECK_COMMAND := $( JAVA) -Xmx4g -jar $( APICHECK)
2011-04-09 02:32:52 +02:00
2020-06-11 20:25:05 +02:00
# Boolean variable determining if the allow list for compatible properties is enabled
2020-11-19 10:48:49 +01:00
PRODUCT_COMPATIBLE_PROPERTY := true
i f e q ( $( PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE ) , f a l s e )
$( error PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE is obsolete)
2018-01-16 06:14:59 +01:00
e n d i f
.KATI_READONLY := \
PRODUCT_COMPATIBLE_PROPERTY
2017-05-19 00:26:59 +02:00
# Boolean variable determining if Treble is fully enabled
PRODUCT_FULL_TREBLE := false
i f n e q ( $( PRODUCT_FULL_TREBLE_OVERRIDE ) , )
PRODUCT_FULL_TREBLE := $( PRODUCT_FULL_TREBLE_OVERRIDE)
e l s e i f e q ( $( PRODUCT_SHIPPING_API_LEVEL ) , )
#$(warning no product shipping level defined)
e l s e i f n e q ( $( call math_gt_or_eq ,$ ( PRODUCT_SHIPPING_API_LEVEL ) ,26) , )
PRODUCT_FULL_TREBLE := true
e n d i f
2017-11-09 19:15:31 +01:00
requirements := \
PRODUCT_TREBLE_LINKER_NAMESPACES \
2023-12-27 02:09:36 +01:00
PRODUCT_ENFORCE_VINTF_MANIFEST
2017-11-09 19:15:31 +01:00
# If it is overriden, then the requirement override is taken, otherwise it's
# PRODUCT_FULL_TREBLE
$( foreach req ,$ ( requirements ) ,$ ( eval \
$( req) := $( if $( $( req) _OVERRIDE) ,$( $( req) _OVERRIDE) ,$( PRODUCT_FULL_TREBLE) ) ) )
2017-12-06 18:21:02 +01:00
# If the requirement is false for any reason, then it's not PRODUCT_FULL_TREBLE
$( foreach req ,$ ( requirements ) ,$ ( eval \
PRODUCT_FULL_TREBLE := $( if $( filter false,$( $( req) ) ) ,false,$( PRODUCT_FULL_TREBLE) ) ) )
2017-11-09 19:15:31 +01:00
2017-11-17 19:47:30 +01:00
PRODUCT_FULL_TREBLE_OVERRIDE ?=
$( foreach req ,$ ( requirements ) ,$ ( eval $ ( req ) _OVERRIDE ?=) )
2023-12-27 02:09:36 +01:00
# used to be a part of PRODUCT_FULL_TREBLE, but now always set it
PRODUCT_NOTICE_SPLIT := true
2018-09-14 01:57:51 +02:00
# TODO(b/114488870): disallow PRODUCT_FULL_TREBLE_OVERRIDE from being used.
2017-11-09 19:15:31 +01:00
.KATI_READONLY := \
2017-11-17 19:47:30 +01:00
PRODUCT_FULL_TREBLE_OVERRIDE \
$( foreach req,$( requirements) ,$( req) _OVERRIDE) \
2017-11-09 19:15:31 +01:00
$( requirements) \
2017-11-17 19:47:30 +01:00
PRODUCT_FULL_TREBLE \
2023-12-27 02:09:36 +01:00
PRODUCT_NOTICE_SPLIT \
2017-11-09 19:15:31 +01:00
2023-12-28 22:39:10 +01:00
i f n e q ( $( PRODUCT_FULL_TREBLE ) , t r u e )
$( warning This device does not have Treble enabled. This is unsafe.)
e n d i f
2018-09-14 01:57:51 +02:00
$( KATI_obsolete_var $ ( foreach req ,$ ( requirements ) ,$ ( req ) _OVERRIDE ) \
,This should be referenced without the _OVERRIDE suffix.)
2017-11-09 19:15:31 +01:00
requirements :=
2018-02-07 23:19:55 +01:00
# 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.
i f e q ( $( PRODUCT_FULL_TREBLE ) , t r u e )
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED ?= true
e n d i f
2018-04-23 03:39:54 +02:00
# Set BOARD_SYSTEMSDK_VERSIONS to the latest SystemSDK version starting from P-launching
# devices if unset.
i f n d e f B O A R D _ S Y S T E M S D K _ V E R S I O N S
2024-01-04 13:14:58 +01:00
ifeq ( REL,$( PLATFORM_VERSION_CODENAME) )
BOARD_SYSTEMSDK_VERSIONS := $( PLATFORM_SDK_VERSION)
else
BOARD_SYSTEMSDK_VERSIONS := $( PLATFORM_VERSION_CODENAME)
2018-04-23 03:39:54 +02:00
endif
e n d i f
2020-08-20 13:21:36 +02:00
i f n d e f B O A R D _ C U R R E N T _ A P I _ L E V E L _ F O R _ V E N D O R _ M O D U L E S
BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES := current
e l s e
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
e n d i f
.KATI_READONLY := BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES
2018-04-23 03:39:54 +02:00
2017-09-30 00:32:22 +02:00
i f d e f P R O D U C T _ S H I P P I N G _ A P I _ L E V E L
2021-11-09 15:09:52 +01:00
board_api_level := $( firstword $( BOARD_API_LEVEL) $( BOARD_SHIPPING_API_LEVEL) )
ifneq ( ,$( board_api_level) )
min_systemsdk_version := $( call math_min,$( board_api_level) ,$( PRODUCT_SHIPPING_API_LEVEL) )
else
min_systemsdk_version := $( PRODUCT_SHIPPING_API_LEVEL)
endif
ifneq ( $( call numbers_less_than,$( min_systemsdk_version) ,$( BOARD_SYSTEMSDK_VERSIONS) ) ,)
$( error BOARD_SYSTEMSDK_VERSIONS ( $( BOARD_SYSTEMSDK_VERSIONS) ) must all be greater than or equal to BOARD_API_LEVEL, BOARD_SHIPPING_API_LEVEL or PRODUCT_SHIPPING_API_LEVEL ( $( min_systemsdk_version) ) )
endif
2018-08-13 18:13:24 +02:00
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
2017-09-30 00:32:22 +02:00
e n d i f
2011-10-04 19:50:08 +02:00
# The default key if not set as LOCAL_CERTIFICATE
i f d e f P R O D U C T _ D E F A U L T _ D E V _ C E R T I F I C A T E
DEFAULT_SYSTEM_DEV_CERTIFICATE := $( PRODUCT_DEFAULT_DEV_CERTIFICATE)
e l s e
2019-04-10 06:35:37 +02:00
DEFAULT_SYSTEM_DEV_CERTIFICATE := build/make/target/product/security/testkey
2011-10-04 19:50:08 +02:00
e n d i f
2019-02-26 16:49:25 +01:00
.KATI_READONLY := DEFAULT_SYSTEM_DEV_CERTIFICATE
2011-10-04 19:50:08 +02:00
2019-08-07 11:13:33 +02:00
# Certificate for the NetworkStack sepolicy context
i f d e f P R O D U C T _ M A I N L I N E _ S E P O L I C Y _ D E V _ C E R T I F I C A T E S
MAINLINE_SEPOLICY_DEV_CERTIFICATES := $( PRODUCT_MAINLINE_SEPOLICY_DEV_CERTIFICATES)
e l s e
MAINLINE_SEPOLICY_DEV_CERTIFICATES := $( dir $( DEFAULT_SYSTEM_DEV_CERTIFICATE) )
e n d i f
2022-08-12 14:35:45 +02:00
.KATI_READONLY := MAINLINE_SEPOLICY_DEV_CERTIFICATES
2019-08-07 11:13:33 +02:00
2020-02-22 02:29:37 +01:00
BUILD_NUMBER_FROM_FILE := $$ ( cat $( SOONG_OUT_DIR) /build_number.txt)
2023-04-27 04:05:22 +02:00
BUILD_HOSTNAME_FROM_FILE := $$ ( cat $( SOONG_OUT_DIR) /build_hostname.txt)
2018-02-14 22:30:53 +01:00
BUILD_DATETIME_FROM_FILE := $$ ( cat $( BUILD_DATETIME_FILE) )
2017-11-03 23:49:25 +01:00
2018-02-06 00:51:34 +01:00
# SEPolicy versions
2024-02-13 03:19:24 +01:00
# PLATFORM_SEPOLICY_VERSION is a number of the form "YYYYMM" with "YYYYMM"
# mapping to vFRC version.
PLATFORM_SEPOLICY_VERSION := $( BOARD_API_LEVEL)
2021-12-10 10:36:18 +01:00
BOARD_SEPOLICY_VERS := $( PLATFORM_SEPOLICY_VERSION)
2023-12-11 10:11:59 +01:00
.KATI_READONLY := PLATFORM_SEPOLICY_VERSION BOARD_SEPOLICY_VERS
2021-12-10 10:36:18 +01:00
2018-02-06 00:52:46 +01:00
# A list of SEPolicy versions, besides PLATFORM_SEPOLICY_VERSION, that the framework supports.
2023-08-24 03:07:33 +02:00
PLATFORM_SEPOLICY_COMPAT_VERSIONS := $( filter-out $( PLATFORM_SEPOLICY_VERSION) , \
2019-06-02 02:06:05 +02:00
29.0 \
2020-05-07 10:05:19 +02:00
30.0 \
2021-06-16 02:46:59 +02:00
31.0 \
2021-11-19 10:41:05 +01:00
32.0 \
2022-05-02 07:19:51 +02:00
33.0 \
2023-06-23 08:51:26 +02:00
34.0 \
2024-03-11 08:19:33 +01:00
202404 \
2023-08-24 03:07:33 +02:00
)
2018-02-06 00:52:46 +01:00
2018-03-27 22:49:19 +02:00
.KATI_READONLY := \
PLATFORM_SEPOLICY_COMPAT_VERSIONS \
PLATFORM_SEPOLICY_VERSION \
2018-10-31 02:47:59 +01:00
i f e q ( $( PRODUCT_RETROFIT_DYNAMIC_PARTITIONS ) , t r u e )
ifneq ( $( PRODUCT_USE_DYNAMIC_PARTITIONS) ,true)
$( error PRODUCT_USE_DYNAMIC_PARTITIONS must be true when PRODUCT_RETROFIT_DYNAMIC_PARTITIONS \
is set )
endif
ifdef PRODUCT_SHIPPING_API_LEVEL
ifeq ( true,$( call math_gt_or_eq,$( PRODUCT_SHIPPING_API_LEVEL) ,29) )
$( error Devices with shipping API level $( PRODUCT_SHIPPING_API_LEVEL) must not set \
PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)
endif
endif
e n d i f
2018-11-09 19:27:23 +01:00
i f e q ( $( PRODUCT_USE_DYNAMIC_PARTITIONS ) , t r u e )
2019-03-13 20:27:07 +01:00
ifneq ( $( PRODUCT_USE_DYNAMIC_PARTITION_SIZE) ,true)
$( error PRODUCT_USE_DYNAMIC_PARTITION_SIZE must be true for devices with dynamic partitions)
endif
e n d i f
2019-02-14 00:07:46 +01:00
2019-03-13 20:27:07 +01:00
i f e q ( $( PRODUCT_BUILD_SUPER_PARTITION ) , t r u e )
ifneq ( $( PRODUCT_USE_DYNAMIC_PARTITIONS) ,true)
$( error Can only build super partition for devices with dynamic partitions)
endif
2018-07-31 21:47:27 +02:00
e n d i f
2019-03-13 20:27:07 +01:00
2018-07-31 21:47:27 +02:00
i f e q ( $( PRODUCT_USE_DYNAMIC_PARTITION_SIZE ) , t r u e )
2018-06-19 01:32:35 +02:00
i f n e q ( $( BOARD_SYSTEMIMAGE_PARTITION_SIZE ) , )
i f n e q ( $( BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE ) , )
$( error Should not define BOARD_SYSTEMIMAGE_PARTITION_SIZE and \
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE together)
e n d i f
2018-05-19 02:46:04 +02:00
e n d i f
2018-06-20 01:23:16 +02:00
i f n e q ( $( BOARD_VENDORIMAGE_PARTITION_SIZE ) , )
i f n e q ( $( BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE ) , )
$( error Should not define BOARD_VENDORIMAGE_PARTITION_SIZE and \
BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE together)
e n d i f
2018-05-19 02:46:04 +02:00
e n d i f
2017-11-14 16:42:30 +01:00
i f n e q ( $( BOARD_ODMIMAGE_PARTITION_SIZE ) , )
i f n e q ( $( BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE ) , )
$( error Should not define BOARD_ODMIMAGE_PARTITION_SIZE and \
BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE together)
e n d i f
e n d i f
2020-05-07 23:58:20 +02:00
i f n e q ( $( BOARD_VENDOR_DLKMIMAGE_PARTITION_SIZE ) , )
i f n e q ( $( BOARD_VENDOR_DLKMIMAGE_PARTITION_RESERVED_SIZE ) , )
$( error Should not define BOARD_VENDOR_DLKMIMAGE_PARTITION_SIZE and \
BOARD_VENDOR_DLKMIMAGE_PARTITION_RESERVED_SIZE together)
e n d i f
e n d i f
2020-07-16 01:52:59 +02:00
i f n e q ( $( BOARD_ODM_DLKMIMAGE_PARTITION_SIZE ) , )
i f n e q ( $( BOARD_ODM_DLKMIMAGE_PARTITION_RESERVED_SIZE ) , )
$( error Should not define BOARD_ODM_DLKMIMAGE_PARTITION_SIZE and \
BOARD_ODM_DLKMIMAGE_PARTITION_RESERVED_SIZE together)
e n d i f
e n d i f
2022-01-27 08:05:08 +01:00
i f n e q ( $( BOARD_SYSTEM_DLKMIMAGE_PARTITION_SIZE ) , )
i f n e q ( $( BOARD_SYSTEM_DLKMIMAGE_PARTITION_RESERVED_SIZE ) , )
$( error Should not define BOARD_SYSTEM_DLKMIMAGE_PARTITION_SIZE and \
BOARD_SYSTEM_DLKMIMAGE_PARTITION_RESERVED_SIZE together)
e n d i f
e n d i f
2018-07-21 00:19:34 +02:00
i f n e q ( $( BOARD_PRODUCTIMAGE_PARTITION_SIZE ) , )
i f n e q ( $( BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE ) , )
$( error Should not define BOARD_PRODUCTIMAGE_PARTITION_SIZE and \
BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE together)
e n d i f
e n d i f
2019-06-25 08:58:13 +02:00
i f n e q ( $( BOARD_SYSTEM_EXTIMAGE_PARTITION_SIZE ) , )
i f n e q ( $( BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE ) , )
$( error Should not define BOARD_SYSTEM_EXTIMAGE_PARTITION_SIZE and \
BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE together)
2018-07-21 00:33:47 +02:00
e n d i f
e n d i f
2018-07-31 21:47:27 +02:00
e n d i f # PRODUCT_USE_DYNAMIC_PARTITION_SIZE
2019-03-13 20:27:07 +01:00
i f e q ( $( PRODUCT_USE_DYNAMIC_PARTITIONS ) , t r u e )
2018-10-02 02:30:01 +02:00
# 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.
2018-10-25 22:17:27 +02:00
# Must not be empty.
2018-10-02 02:30:01 +02:00
# - 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 ) ) , \
2018-11-27 20:37:38 +01:00
$( eval BOARD_$( group) _SIZE := $( strip $( BOARD_$( group) _SIZE) ) ) \
2018-10-25 22:17:27 +02:00
$( if $( BOARD_$( group) _SIZE) ,,$( error BOARD_$( group) _SIZE must not be empty) ) \
2018-10-02 02:30:01 +02:00
$( eval .KATI_READONLY := BOARD_$( group) _SIZE) \
2019-06-28 20:00:05 +02:00
$( eval BOARD_$( group) _PARTITION_LIST ?= ) \
$( eval .KATI_READONLY := BOARD_$( group) _PARTITION_LIST) \
2018-10-02 02:30:01 +02:00
)
# Define BOARD_SUPER_PARTITION_PARTITION_LIST, the sum of all BOARD_*_PARTITION_LIST
i f d e f B O A R D _ S U P E R _ P A R T I T I O N _ P A R T I T I O N _ L I S T
$( error BOARD_SUPER_PARTITION_PARTITION_LIST should not be defined , but computed from \
BOARD_SUPER_PARTITION_GROUPS and BOARD_*_PARTITION_LIST)
e n d i f
BOARD_SUPER_PARTITION_PARTITION_LIST := \
2020-05-12 20:36:31 +02:00
$( foreach group,$( call to-upper,$( BOARD_SUPER_PARTITION_GROUPS) ) ,$( BOARD_$( group) _PARTITION_LIST) )
2018-10-02 02:30:01 +02:00
.KATI_READONLY := BOARD_SUPER_PARTITION_PARTITION_LIST
2018-11-27 20:37:38 +01:00
i f n e q ( $( BOARD_SUPER_PARTITION_SIZE ) , )
2018-10-31 02:47:59 +01:00
i f e q ( $( PRODUCT_RETROFIT_DYNAMIC_PARTITIONS ) , t r u e )
# The metadata device must be specified manually for retrofitting.
2018-11-09 00:41:24 +01:00
i f e q ( $( BOARD_SUPER_PARTITION_METADATA_DEVICE ) , )
$( error Must specify BOARD_SUPER_PARTITION_METADATA_DEVICE if PRODUCT_RETROFIT_DYNAMIC_PARTITIONS =true .)
e n d i f
# The super partition block device list must be specified manually for retrofitting.
i f e q ( $( BOARD_SUPER_PARTITION_BLOCK_DEVICES ) , )
$( error Must specify BOARD_SUPER_PARTITION_BLOCK_DEVICES if PRODUCT_RETROFIT_DYNAMIC_PARTITIONS =true .)
2018-10-31 02:47:59 +01:00
e n d i f
# The metadata device must be included in the super partition block device list.
i f e q ( , $( filter $ ( BOARD_SUPER_PARTITION_METADATA_DEVICE ) ,$ ( BOARD_SUPER_PARTITION_BLOCK_DEVICES ) ) )
$( error BOARD_SUPER_PARTITION_METADATA_DEVICE is not listed in BOARD_SUPER_PARTITION_BLOCK_DEVICES .)
e n d i f
# The metadata device must be supplied to init via the kernel command-line.
2019-02-26 18:36:30 +01:00
INTERNAL_KERNEL_CMDLINE += androidboot.super_partition= $( BOARD_SUPER_PARTITION_METADATA_DEVICE)
2018-10-31 02:47:59 +01:00
2018-12-27 21:47:23 +01:00
BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE := true
# If "vendor" is listed as one of the dynamic partitions but without its image available (e.g. an
# AOSP target built without vendor image), don't build the retrofit full OTA package. Because we
# won't be able to build meaningful super_* images for retrofitting purpose.
i f n e q ( , $( filter vendor ,$ ( BOARD_SUPER_PARTITION_PARTITION_LIST ) ) )
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f n d e f B U I L D I N G _ V E N D O R _ I M A G E
2018-12-27 21:47:23 +01:00
i f n d e f B O A R D _ P R E B U I L T _ V E N D O R I M A G E
BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE :=
e n d i f # BOARD_PREBUILT_VENDORIMAGE
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
e n d i f # BUILDING_VENDOR_IMAGE
2018-12-27 21:47:23 +01:00
e n d i f # BOARD_SUPER_PARTITION_PARTITION_LIST
2018-10-31 02:47:59 +01:00
e l s e # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
# For normal devices, we populate BOARD_SUPER_PARTITION_BLOCK_DEVICES so the
# build can handle both cases consistently.
2019-01-04 23:54:56 +01:00
i f e q ( $( BOARD_SUPER_PARTITION_METADATA_DEVICE ) , )
2018-10-31 02:47:59 +01:00
BOARD_SUPER_PARTITION_METADATA_DEVICE := super
2019-01-04 23:54:56 +01:00
e n d i f
i f e q ( $( BOARD_SUPER_PARTITION_BLOCK_DEVICES ) , )
BOARD_SUPER_PARTITION_BLOCK_DEVICES := $( BOARD_SUPER_PARTITION_METADATA_DEVICE)
e n d i f
# If only one super block device, default to super partition size.
i f e q ( $( word 2,$ ( BOARD_SUPER_PARTITION_BLOCK_DEVICES ) ) , )
B O A R D _ S U P E R _ P A R T I T I O N _ $( call to -upper ,$ ( strip $ ( BOARD_SUPER_PARTITION_BLOCK_DEVICES ) ) ) _DEVICE_SIZE ?= \
$( BOARD_SUPER_PARTITION_SIZE)
e n d i f
i f n e q ( $( BOARD_SUPER_PARTITION_METADATA_DEVICE ) , s u p e r )
2019-02-26 18:36:30 +01:00
INTERNAL_KERNEL_CMDLINE += androidboot.super_partition= $( BOARD_SUPER_PARTITION_METADATA_DEVICE)
2019-01-04 23:54:56 +01:00
e n d i f
2018-12-27 21:47:23 +01:00
BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE :=
2018-10-31 02:47:59 +01:00
e n d i f # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
e n d i f # BOARD_SUPER_PARTITION_SIZE
2019-06-10 21:50:19 +02:00
BOARD_SUPER_PARTITION_BLOCK_DEVICES ?=
2018-10-31 02:47:59 +01:00
.KATI_READONLY := BOARD_SUPER_PARTITION_BLOCK_DEVICES
2019-06-10 21:50:19 +02:00
BOARD_SUPER_PARTITION_METADATA_DEVICE ?=
2018-10-31 02:47:59 +01:00
.KATI_READONLY := BOARD_SUPER_PARTITION_METADATA_DEVICE
2019-06-10 21:50:19 +02:00
BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE ?=
2018-12-27 21:47:23 +01:00
.KATI_READONLY := BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE
2018-10-31 02:47:59 +01:00
$( foreach device ,$ ( call to -upper ,$ ( BOARD_SUPER_PARTITION_BLOCK_DEVICES ) ) , \
2018-11-27 20:37:38 +01:00
$( eval BOARD_SUPER_PARTITION_$( device) _DEVICE_SIZE := $( strip $( BOARD_SUPER_PARTITION_$( device) _DEVICE_SIZE) ) ) \
2018-10-31 02:47:59 +01:00
$( if $( BOARD_SUPER_PARTITION_$( device) _DEVICE_SIZE) ,, \
2019-01-04 23:54:56 +01:00
$( error BOARD_SUPER_PARTITION_$( device) _DEVICE_SIZE must not be empty) ) \
2018-10-31 02:47:59 +01:00
$( eval .KATI_READONLY := BOARD_SUPER_PARTITION_$( device) _DEVICE_SIZE) )
2019-06-10 21:50:19 +02:00
e n d i f # PRODUCT_USE_DYNAMIC_PARTITIONS
2018-06-19 01:32:35 +02:00
2021-01-08 18:37:47 +01:00
# 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
2009-03-04 04:28:42 +01:00
# ###############################################################
# Set up final options.
# ###############################################################
2020-10-20 07:52:49 +02:00
# 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.
i f e q ( $( HOST_OS ) , l i n u x )
RELATIVE_PWD := PWD = /proc/self/cwd
e l s e
RELATIVE_PWD :=
e n d i f
2014-04-19 00:23:40 +02:00
# Flags for DEX2OAT
2015-10-16 05:43:29 +02:00
first_non_empty_of_three = $( if $( 1) ,$( 1) ,$( if $( 2) ,$( 2) ,$( 3) ) )
2014-04-19 00:23:40 +02:00
DEX2OAT_TARGET_ARCH := $( TARGET_ARCH)
2015-10-16 05:43:29 +02:00
DEX2OAT_TARGET_CPU_VARIANT := $( call first_non_empty_of_three,$( TARGET_CPU_VARIANT) ,$( TARGET_ARCH_VARIANT) ,default)
2019-02-21 12:36:37 +01:00
DEX2OAT_TARGET_CPU_VARIANT_RUNTIME := $( call first_non_empty_of_three,$( TARGET_CPU_VARIANT_RUNTIME) ,$( TARGET_ARCH_VARIANT) ,default)
2014-03-20 20:13:10 +01:00
DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := default
2014-04-19 00:23:40 +02:00
i f d e f T A R G E T _ 2 N D _ A R C H
2014-05-13 22:57:28 +02:00
$(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH := $( TARGET_2ND_ARCH)
2015-10-16 05:43:29 +02:00
$(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT := $( call first_non_empty_of_three,$( TARGET_2ND_CPU_VARIANT) ,$( TARGET_2ND_ARCH_VARIANT) ,default)
2019-02-21 12:36:37 +01:00
$(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT_RUNTIME := $( call first_non_empty_of_three,$( TARGET_2ND_CPU_VARIANT_RUNTIME) ,$( TARGET_2ND_ARCH_VARIANT) ,default)
2014-05-13 22:57:28 +02:00
$(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := default
2014-03-20 20:13:10 +01:00
e n d i f
2009-03-04 04:28:42 +01:00
# ###############################################################
# Collect a list of the SDK versions that we could compile against
# For use with the LOCAL_SDK_VERSION variable for include $(BUILD_PACKAGE)
# ###############################################################
2011-11-29 19:24:27 +01:00
HISTORICAL_SDK_VERSIONS_ROOT := $( TOPDIR) prebuilts/sdk
2011-11-29 20:20:16 +01:00
HISTORICAL_NDK_VERSIONS_ROOT := $( TOPDIR) prebuilts/ndk
2010-06-09 19:26:26 +02:00
2015-05-20 01:03:57 +02:00
# The path where app can reference the support library resources.
2020-07-08 11:10:38 +02:00
i f d e f T A R G E T _ B U I L D _ U S E _ P R E B U I L T _ S D K S
2015-05-20 01:03:57 +02:00
SUPPORT_LIBRARY_ROOT := $( HISTORICAL_SDK_VERSIONS_ROOT) /current/support
e l s e
SUPPORT_LIBRARY_ROOT := frameworks/support
e n d i f
2018-04-27 15:11:17 +02:00
get-sdk-version = $( if $( findstring _,$( 1) ) ,$( subst core_,,$( subst system_,,$( subst test_,,$( 1) ) ) ) ,$( 1) )
get-sdk-api = $( if $( findstring _,$( 1) ) ,$( patsubst %_$( call get-sdk-version,$( 1) ) ,%,$( 1) ) ,public)
get-prebuilt-sdk-dir = $( HISTORICAL_SDK_VERSIONS_ROOT) /$( call get-sdk-version,$( 1) ) /$( call get-sdk-api,$( 1) )
2018-04-10 17:16:33 +02:00
# Resolve LOCAL_SDK_VERSION to prebuilt module name, e.g.:
2018-04-10 17:18:44 +02:00
# 23 -> sdk_public_23_android
# system_current -> sdk_system_current_android
2018-04-10 17:16:33 +02:00
# $(1): An sdk version (LOCAL_SDK_VERSION)
2018-04-12 17:17:55 +02:00
# $(2): optional library name (default: android)
2018-04-10 17:16:33 +02:00
d e f i n e r e s o l v e - p r e b u i l t - s d k - m o d u l e
2018-04-10 17:18:44 +02:00
$( if $ ( findstring _ ,$ ( 1) ) ,\
2018-04-12 17:17:55 +02:00
sdk_$( 1) _$( or $( 2) ,android) ,\
sdk_public_$( 1) _$( or $( 2) ,android) )
2018-04-10 17:18:44 +02:00
e n d e f
2018-04-27 15:11:17 +02:00
# Resolve LOCAL_SDK_VERSION to prebuilt android.jar
# $(1): LOCAL_SDK_VERSION
resolve-prebuilt-sdk-jar-path = $( call get-prebuilt-sdk-dir,$( 1) ) /android.jar
2018-04-10 17:18:44 +02:00
# Resolve LOCAL_SDK_VERSION to prebuilt framework.aidl
# $(1): An sdk version (LOCAL_SDK_VERSION)
2018-04-27 15:11:17 +02:00
resolve-prebuilt-sdk-aidl-path = $( call get-prebuilt-sdk-dir,$( call get-sdk-version,$( 1) ) ) /framework.aidl
2018-04-10 17:16:33 +02:00
2010-06-09 19:26:26 +02:00
# Historical SDK version N is stored in $(HISTORICAL_SDK_VERSIONS_ROOT)/N.
# The 'current' version is whatever this source tree is.
2009-03-04 04:28:42 +01:00
#
# 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.
2010-06-09 19:26:26 +02:00
# Numerically sort a list of numbers
# $(1): the list of numbers to be sorted
d e f i n e n u m e r i c a l l y _ s o r t
$( shell function sgrax ( ) { \
while [ -n " $$ 1 " ] ; do echo $$ 1 ; shift ; done \
} ; \
( sgrax $( 1) | sort -g ) )
e n d e f
2018-04-10 17:18:44 +02:00
# 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) )
2021-04-20 19:18:37 +02:00
# Strips and reorganizes the "public", "core", "system" and "test" subdirs.
2018-04-10 17:18:44 +02:00
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) )
2021-04-20 19:18:37 +02:00
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) )
2018-04-10 17:18:44 +02:00
TARGET_AVAIALBLE_SDK_VERSIONS := $( call numerically_sort,$( TARGET_AVAILABLE_SDK_VERSIONS) )
2009-03-04 04:28:42 +01:00
2023-09-13 02:56:15 +02:00
TARGET_SDK_VERSIONS_WITHOUT_JAVA_1_9_SUPPORT := $( call numbers_less_than,30,$( TARGET_AVAILABLE_SDK_VERSIONS) )
TARGET_SDK_VERSIONS_WITHOUT_JAVA_11_SUPPORT := $( call numbers_less_than,32,$( TARGET_AVAILABLE_SDK_VERSIONS) )
TARGET_SDK_VERSIONS_WITHOUT_JAVA_17_SUPPORT := $( call numbers_less_than,34,$( TARGET_AVAILABLE_SDK_VERSIONS) )
JAVA_LANGUAGE_VERSIONS_WITHOUT_SYSTEM_MODULES := 1.7 1.8
2017-10-12 22:34:40 +02:00
2010-10-14 23:31:48 +02:00
# This is the standard way to name a directory containing prebuilt target
# objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so
2011-07-12 07:11:46 +02:00
TARGET_PREBUILT_TAG := android-$( TARGET_ARCH)
2014-05-22 21:01:23 +02:00
i f d e f T A R G E T _ 2 N D _ A R C H
TARGET_2ND_PREBUILT_TAG := android-$( TARGET_2ND_ARCH)
e n d i f
2010-10-14 23:31:48 +02:00
2013-03-05 20:07:15 +01:00
# Set up RS prebuilt variables for compatibility library
2014-10-01 00:08:03 +02:00
RS_PREBUILT_CLCORE := prebuilts/sdk/renderscript/lib/$( TARGET_ARCH) /librsrt_$( TARGET_ARCH) .bc
2013-03-05 20:07:15 +01:00
RS_PREBUILT_COMPILER_RT := prebuilts/sdk/renderscript/lib/$( TARGET_ARCH) /libcompiler_rt.a
2015-01-08 03:18:41 +01:00
# API Level lists for Renderscript Compat lib.
RSCOMPAT_32BIT_ONLY_API_LEVELS := 8 9 10 11 12 13 14 15 16 17 18 19 20
2014-11-20 20:05:18 +01:00
RSCOMPAT_NO_USAGEIO_API_LEVELS := 8 9 10 11 12 13
2015-01-08 03:18:41 +01:00
2017-10-31 01:31:44 +01:00
APPS_DEFAULT_VERSION_NAME := $( PLATFORM_VERSION)
2017-11-06 19:47:24 +01:00
# ANDROID_WARNING_ALLOWED_PROJECTS is generated by build/soong.
2016-10-12 00:38:39 +02:00
d e f i n e f i n d _ w a r n i n g _ a l l o w e d _ p r o j e c t s
$( filter $( ANDROID_WARNING_ALLOWED_PROJECTS) ,$( 1) /)
e n d e f
2022-04-18 20:32:19 +02:00
GOMA_POOL :=
RBE_POOL :=
GOMA_OR_RBE_POOL :=
# When goma or RBE are 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.
i f n e q ( , $( filter -out false ,$ ( USE_GOMA ) ) )
GOMA_POOL := none
GOMA_OR_RBE_POOL := none
e l s e i f n e q ( , $( filter -out false ,$ ( USE_RBE ) ) )
RBE_POOL := none
GOMA_OR_RBE_POOL := none
e n d i f
.KATI_READONLY := GOMA_POOL RBE_POOL GOMA_OR_RBE_POOL
JAVAC_NINJA_POOL :=
R8_NINJA_POOL :=
D8_NINJA_POOL :=
i f n e q ( $( filter -out false ,$ ( USE_RBE ) ) , )
ifdef RBE_JAVAC
JAVAC_NINJA_POOL := $( RBE_POOL)
endif
ifdef RBE_R8
R8_NINJA_POOL := $( RBE_POOL)
endif
ifdef RBE_D8
D8_NINJA_POOL := $( RBE_POOL)
endif
e n d i f
.KATI_READONLY := JAVAC_NINJA_POOL R8_NINJA_POOL D8_NINJA_POOL
2023-06-03 00:40:32 +02:00
# Soong modules that are known to have broken optional_uses_libs dependencies.
BUILD_WARNING_BAD_OPTIONAL_USES_LIBS_ALLOWLIST := LegacyCamera Gallery2
2016-11-10 01:35:34 +01:00
# These goals don't need to collect and include Android.mks/CleanSpec.mks
# in the source tree.
2022-04-08 20:12:10 +02:00
dont_bother_goals := out product-graph
2016-11-10 01:35:34 +01:00
2024-05-08 04:13:26 +02:00
i n c l u d e $( BUILD_SYSTEM ) / s y s p r o p _ c o n f i g . m k
2021-02-19 10:10:58 +01:00
# Make ANDROID Soong config variables visible to Android.mk files, for
# consistency with those defined in BoardConfig.mk files.
2020-07-23 02:59:34 +02:00
i n c l u d e $( BUILD_SYSTEM ) / a n d r o i d _ s o o n g _ c o n f i g _ v a r s . m k
2021-02-19 10:10:58 +01:00
i f e q ( $( CALLED_FROM_SETUP ) , t r u e )
2016-11-10 02:22:15 +01:00
i n c l u d e $( BUILD_SYSTEM ) / n i n j a _ c o n f i g . m k
i n c l u d e $( BUILD_SYSTEM ) / s o o n g _ c o n f i g . m k
e n d i f
2019-03-14 02:04:05 +01:00
- i n c l u d e e x t e r n a l / l t p / a n d r o i d / l t p _ p a c k a g e _ l i s t . m k
2023-08-31 23:24:30 +02:00
DEFAULT_DATA_OUT_MODULES := ltp $( ltp_packages)
2019-03-25 21:26:03 +01:00
.KATI_READONLY := DEFAULT_DATA_OUT_MODULES
2019-03-14 02:04:05 +01:00
2013-04-06 03:02:16 +02:00
i n c l u d e $( BUILD_SYSTEM ) / d u m p v a r . m k
2023-10-27 02:08:32 +02:00
2024-02-05 03:25:25 +01:00
i f d e f B O A R D _ V N D K _ V E R S I O N
BOARD_VNDK_VERSION =
e n d i f
i f d e f P L A T F O R M _ V N D K _ V E R S I O N
PLATFORM_VNDK_VERSION =
e n d i f
2023-10-27 02:08:32 +02:00
i f e q ( t r u e , $( FULL_SYSTEM_OPTIMIZE_JAVA ) )
2023-10-04 19:51:02 +02:00
i f e q ( f a l s e , $( SYSTEM_OPTIMIZE_JAVA ) )
2023-10-27 02:08:32 +02:00
$( error SYSTEM_OPTIMIZE_JAVA must be enabled when FULL_SYSTEM_OPTIMIZE_JAVA is enabled )
e n d i f
e n d i f