1 # This is included by the top-level Makefile. 2 # It sets up standard variables based on the 3 # current configuration and platform, which 4 # are not specific to what is being built. 5 6 ifndef KATI 7 $(warning Directly using config.mk from make is no longer supported.) 8 $(warning ) 9 $(warning If you are just attempting to build, you probably need to re-source envsetup.sh:) 10 $(warning ) 11 $(warning $$ source build/envsetup.sh) 12 $(warning ) 13 $(warning If you are attempting to emulate get_build_var, use one of the following:) 14 $(warning $$ build/soong/soong_ui.bash --dumpvar-mode) 15 $(warning $$ build/soong/soong_ui.bash --dumpvars-mode) 16 $(warning ) 17 $(error done) 18 endif 19 20 BUILD_SYSTEM :=$= build/make/core 21 BUILD_SYSTEM_COMMON :=$= build/make/common 22 23 include $(BUILD_SYSTEM_COMMON)/core.mk 24 25 # Mark variables that should be coming as environment variables from soong_ui 26 # as readonly 27 .KATI_READONLY := OUT_DIR TMPDIR BUILD_DATETIME_FILE 28 ifdef CALLED_FROM_SETUP 29 .KATI_READONLY := CALLED_FROM_SETUP 30 endif 31 ifdef KATI_PACKAGE_MK_DIR 32 .KATI_READONLY := KATI_PACKAGE_MK_DIR 33 endif 34 35 # Mark variables deprecated/obsolete 36 CHANGES_URL := https://android.googlesource.com/platform/build/+/master/Changes.md 37 .KATI_READONLY := CHANGES_URL 38 $(KATI_obsolete_var PATH,Do not use PATH directly. See $(CHANGES_URL)#PATH) 39 $(KATI_obsolete_var PYTHONPATH,Do not use PYTHONPATH directly. See $(CHANGES_URL)#PYTHONPATH) 40 $(KATI_obsolete_var OUT,Use OUT_DIR instead. See $(CHANGES_URL)#OUT) 41 $(KATI_obsolete_var ANDROID_HOST_OUT,Use HOST_OUT instead. See $(CHANGES_URL)#ANDROID_HOST_OUT) 42 $(KATI_obsolete_var ANDROID_PRODUCT_OUT,Use PRODUCT_OUT instead. See $(CHANGES_URL)#ANDROID_PRODUCT_OUT) 43 $(KATI_obsolete_var ANDROID_HOST_OUT_TESTCASES,Use HOST_OUT_TESTCASES instead. See $(CHANGES_URL)#ANDROID_HOST_OUT_TESTCASES) 44 $(KATI_obsolete_var ANDROID_TARGET_OUT_TESTCASES,Use TARGET_OUT_TESTCASES instead. See $(CHANGES_URL)#ANDROID_TARGET_OUT_TESTCASES) 45 $(KATI_obsolete_var ANDROID_BUILD_TOP,Use '.' instead. See $(CHANGES_URL)#ANDROID_BUILD_TOP) 46 $(KATI_obsolete_var \ 47 ANDROID_TOOLCHAIN \ 48 ANDROID_TOOLCHAIN_2ND_ARCH \ 49 ANDROID_DEV_SCRIPTS \ 50 ANDROID_EMULATOR_PREBUILTS \ 51 ANDROID_PRE_BUILD_PATHS \ 52 ,See $(CHANGES_URL)#other_envsetup_variables) 53 $(KATI_obsolete_var PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE,Set FCM Version in device manifest instead. See $(CHANGES_URL)#PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE) 54 $(KATI_obsolete_var USE_CLANG_PLATFORM_BUILD,Clang is the only supported Android compiler. See $(CHANGES_URL)#USE_CLANG_PLATFORM_BUILD) 55 $(KATI_obsolete_var BUILD_DROIDDOC,Droiddoc is only supported in Soong. See details on build/soong/java/droiddoc.go) 56 $(KATI_obsolete_var BUILD_APIDIFF,Apidiff is only supported in Soong. See details on build/soong/java/droiddoc.go) 57 $(KATI_obsolete_var \ 58 DEFAULT_GCC_CPP_STD_VERSION \ 59 HOST_GLOBAL_CFLAGS 2ND_HOST_GLOBAL_CFLAGS \ 60 HOST_GLOBAL_CONLYFLAGS 2ND_HOST_GLOBAL_CONLYFLAGS \ 61 HOST_GLOBAL_CPPFLAGS 2ND_HOST_GLOBAL_CPPFLAGS \ 62 HOST_GLOBAL_LDFLAGS 2ND_HOST_GLOBAL_LDFLAGS \ 63 HOST_GLOBAL_LLDFLAGS 2ND_HOST_GLOBAL_LLDFLAGS \ 64 HOST_CLANG_SUPPORTED 2ND_HOST_CLANG_SUPPORTED \ 65 HOST_CC 2ND_HOST_CC \ 66 HOST_CXX 2ND_HOST_CXX \ 67 HOST_CROSS_GLOBAL_CFLAGS 2ND_HOST_CROSS_GLOBAL_CFLAGS \ 68 HOST_CROSS_GLOBAL_CONLYFLAGS 2ND_HOST_CROSS_GLOBAL_CONLYFLAGS \ 69 HOST_CROSS_GLOBAL_CPPFLAGS 2ND_HOST_CROSS_GLOBAL_CPPFLAGS \ 70 HOST_CROSS_GLOBAL_LDFLAGS 2ND_HOST_CROSS_GLOBAL_LDFLAGS \ 71 HOST_CROSS_GLOBAL_LLDFLAGS 2ND_HOST_CROSS_GLOBAL_LLDFLAGS \ 72 HOST_CROSS_CLANG_SUPPORTED 2ND_HOST_CROSS_CLANG_SUPPORTED \ 73 HOST_CROSS_CC 2ND_HOST_CROSS_CC \ 74 HOST_CROSS_CXX 2ND_HOST_CROSS_CXX \ 75 TARGET_GLOBAL_CFLAGS 2ND_TARGET_GLOBAL_CFLAGS \ 76 TARGET_GLOBAL_CONLYFLAGS 2ND_TARGET_GLOBAL_CONLYFLAGS \ 77 TARGET_GLOBAL_CPPFLAGS 2ND_TARGET_GLOBAL_CPPFLAGS \ 78 TARGET_GLOBAL_LDFLAGS 2ND_TARGET_GLOBAL_LDFLAGS \ 79 TARGET_GLOBAL_LLDFLAGS 2ND_TARGET_GLOBAL_LLDFLAGS \ 80 TARGET_CLANG_SUPPORTED 2ND_TARGET_CLANG_SUPPORTED \ 81 TARGET_CC 2ND_TARGET_CC \ 82 TARGET_CXX 2ND_TARGET_CXX \ 83 TARGET_TOOLCHAIN_ROOT 2ND_TARGET_TOOLCHAIN_ROOT \ 84 HOST_TOOLCHAIN_ROOT 2ND_HOST_TOOLCHAIN_ROOT \ 85 HOST_CROSS_TOOLCHAIN_ROOT 2ND_HOST_CROSS_TOOLCHAIN_ROOT \ 86 HOST_TOOLS_PREFIX 2ND_HOST_TOOLS_PREFIX \ 87 HOST_CROSS_TOOLS_PREFIX 2ND_HOST_CROSS_TOOLS_PREFIX \ 88 HOST_GCC_VERSION 2ND_HOST_GCC_VERSION \ 89 HOST_CROSS_GCC_VERSION 2ND_HOST_CROSS_GCC_VERSION \ 90 TARGET_NDK_GCC_VERSION 2ND_TARGET_NDK_GCC_VERSION \ 91 GLOBAL_CFLAGS_NO_OVERRIDE GLOBAL_CPPFLAGS_NO_OVERRIDE \ 92 ,GCC support has been removed. Use Clang instead) 93 $(KATI_obsolete_var DIST_DIR dist_goal,Use dist-for-goals instead. See $(CHANGES_URL)#dist) 94 $(KATI_obsolete_var TARGET_ANDROID_FILESYSTEM_CONFIG_H,Use TARGET_FS_CONFIG_GEN instead) 95 $(KATI_deprecated_var USER,Use BUILD_USERNAME instead. See $(CHANGES_URL)#USER) 96 97 # This is marked as obsolete in envsetup.mk after reading the BoardConfig.mk 98 $(KATI_deprecate_export It is a global setting. See $(CHANGES_URL)#export_keyword) 99 100 # Used to force goals to build. Only use for conditionally defined goals. 101 .PHONY: FORCE 102 FORCE: 103 104 ORIGINAL_MAKECMDGOALS := $(MAKECMDGOALS) 105 106 UNAME := $(shell uname -sm) 107 108 SRC_TARGET_DIR := $(TOPDIR)build/target 109 110 # Some specific paths to tools 111 SRC_DROIDDOC_DIR := $(TOPDIR)build/make/tools/droiddoc 112 113 # Mark some inputs as readonly 114 ifdef TARGET_DEVICE_DIR 115 .KATI_READONLY := TARGET_DEVICE_DIR 116 endif 117 118 # Set up efficient math functions which are used in make. 119 # Here since this file is included by envsetup as well as during build. 120 include $(BUILD_SYSTEM_COMMON)/math.mk 121 122 include $(BUILD_SYSTEM_COMMON)/strings.mk 123 124 include $(BUILD_SYSTEM_COMMON)/json.mk 125 126 # Various mappings to avoid hard-coding paths all over the place 127 include $(BUILD_SYSTEM)/pathmap.mk 128 129 # Allow projects to define their own globally-available variables 130 include $(BUILD_SYSTEM)/project_definitions.mk 131 132 # ############################################################### 133 # Build system internal files 134 # ############################################################### 135 136 BUILD_COMBOS:= $(BUILD_SYSTEM)/combo 137 138 CLEAR_VARS:= $(BUILD_SYSTEM)/clear_vars.mk 139 BUILD_HOST_STATIC_LIBRARY:= $(BUILD_SYSTEM)/host_static_library.mk 140 BUILD_HOST_SHARED_LIBRARY:= $(BUILD_SYSTEM)/host_shared_library.mk 141 BUILD_STATIC_LIBRARY:= $(BUILD_SYSTEM)/static_library.mk 142 BUILD_HEADER_LIBRARY:= $(BUILD_SYSTEM)/header_library.mk 143 BUILD_AUX_STATIC_LIBRARY:= $(BUILD_SYSTEM)/aux_static_library.mk 144 BUILD_AUX_EXECUTABLE:= $(BUILD_SYSTEM)/aux_executable.mk 145 BUILD_SHARED_LIBRARY:= $(BUILD_SYSTEM)/shared_library.mk 146 BUILD_EXECUTABLE:= $(BUILD_SYSTEM)/executable.mk 147 BUILD_HOST_EXECUTABLE:= $(BUILD_SYSTEM)/host_executable.mk 148 BUILD_PACKAGE:= $(BUILD_SYSTEM)/package.mk 149 BUILD_PHONY_PACKAGE:= $(BUILD_SYSTEM)/phony_package.mk 150 BUILD_RRO_PACKAGE:= $(BUILD_SYSTEM)/build_rro_package.mk 151 BUILD_HOST_PREBUILT:= $(BUILD_SYSTEM)/host_prebuilt.mk 152 BUILD_PREBUILT:= $(BUILD_SYSTEM)/prebuilt.mk 153 BUILD_MULTI_PREBUILT:= $(BUILD_SYSTEM)/multi_prebuilt.mk 154 BUILD_JAVA_LIBRARY:= $(BUILD_SYSTEM)/java_library.mk 155 BUILD_STATIC_JAVA_LIBRARY:= $(BUILD_SYSTEM)/static_java_library.mk 156 BUILD_HOST_JAVA_LIBRARY:= $(BUILD_SYSTEM)/host_java_library.mk 157 BUILD_COPY_HEADERS := $(BUILD_SYSTEM)/copy_headers.mk 158 BUILD_NATIVE_TEST := $(BUILD_SYSTEM)/native_test.mk 159 BUILD_NATIVE_BENCHMARK := $(BUILD_SYSTEM)/native_benchmark.mk 160 BUILD_HOST_NATIVE_TEST := $(BUILD_SYSTEM)/host_native_test.mk 161 BUILD_FUZZ_TEST := $(BUILD_SYSTEM)/fuzz_test.mk 162 BUILD_HOST_FUZZ_TEST := $(BUILD_SYSTEM)/host_fuzz_test.mk 163 164 BUILD_SHARED_TEST_LIBRARY := $(BUILD_SYSTEM)/shared_test_lib.mk 165 BUILD_HOST_SHARED_TEST_LIBRARY := $(BUILD_SYSTEM)/host_shared_test_lib.mk 166 BUILD_STATIC_TEST_LIBRARY := $(BUILD_SYSTEM)/static_test_lib.mk 167 BUILD_HOST_STATIC_TEST_LIBRARY := $(BUILD_SYSTEM)/host_static_test_lib.mk 168 169 BUILD_NOTICE_FILE := $(BUILD_SYSTEM)/notice_files.mk 170 BUILD_HOST_DALVIK_JAVA_LIBRARY := $(BUILD_SYSTEM)/host_dalvik_java_library.mk 171 BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY := $(BUILD_SYSTEM)/host_dalvik_static_java_library.mk 172 173 BUILD_HOST_TEST_CONFIG := $(BUILD_SYSTEM)/host_test_config.mk 174 BUILD_TARGET_TEST_CONFIG := $(BUILD_SYSTEM)/target_test_config.mk 175 176 # ############################################################### 177 # Parse out any modifier targets. 178 # ############################################################### 179 180 hide := @ 181 182 ################################################################ 183 # Tools needed in product configuration makefiles. 184 ################################################################ 185 NORMALIZE_PATH := build/make/tools/normalize_path.py 186 187 # $(1): the paths to be normalized 188 define normalize-paths 189 $(if $(1),$(shell $(NORMALIZE_PATH) $(1))) 190 endef 191 192 # ############################################################### 193 # Set common values 194 # ############################################################### 195 196 # Initialize SOONG_CONFIG_NAMESPACES so that it isn't recursive. 197 SOONG_CONFIG_NAMESPACES := 198 199 # Set the extensions used for various packages 200 COMMON_PACKAGE_SUFFIX := .zip 201 COMMON_JAVA_PACKAGE_SUFFIX := .jar 202 COMMON_ANDROID_PACKAGE_SUFFIX := .apk 203 204 ifdef TMPDIR 205 JAVA_TMPDIR_ARG := -Djava.io.tmpdir=$(TMPDIR) 206 else 207 JAVA_TMPDIR_ARG := 208 endif 209 210 # ############################################################### 211 # Include sub-configuration files 212 # ############################################################### 213 214 # --------------------------------------------------------------- 215 # Try to include buildspec.mk, which will try to set stuff up. 216 # If this file doesn't exist, the environment variables will 217 # be used, and if that doesn't work, then the default is an 218 # arm build 219 ifndef ANDROID_BUILDSPEC 220 ANDROID_BUILDSPEC := $(TOPDIR)buildspec.mk 221 endif 222 -include $(ANDROID_BUILDSPEC) 223 224 # --------------------------------------------------------------- 225 # Define most of the global variables. These are the ones that 226 # are specific to the user's build configuration. 227 include $(BUILD_SYSTEM)/envsetup.mk 228 229 # Pruned directory options used when using findleaves.py 230 # See envsetup.mk for a description of SCAN_EXCLUDE_DIRS 231 FIND_LEAVES_EXCLUDES := $(addprefix --prune=, $(SCAN_EXCLUDE_DIRS) .repo .git) 232 233 # The build system exposes several variables for where to find the kernel 234 # headers: 235 # TARGET_DEVICE_KERNEL_HEADERS is automatically created for the current 236 # device being built. It is set as $(TARGET_DEVICE_DIR)/kernel-headers, 237 # e.g. device/samsung/tuna/kernel-headers. This directory is not 238 # explicitly set by anyone, the build system always adds this subdir. 239 # 240 # TARGET_BOARD_KERNEL_HEADERS is specified by the BoardConfig.mk file 241 # to allow other directories to be included. This is useful if there's 242 # some common place where a few headers are being kept for a group 243 # of devices. For example, device/<vendor>/common/kernel-headers could 244 # contain some headers for several of <vendor>'s devices. 245 # 246 # TARGET_PRODUCT_KERNEL_HEADERS is generated by the product inheritance 247 # graph. This allows architecture products to provide headers for the 248 # devices using that architecture. For example, 249 # hardware/ti/omap4xxx/omap4.mk will specify 250 # PRODUCT_VENDOR_KERNEL_HEADERS variable that specify where the omap4 251 # specific headers are, e.g. hardware/ti/omap4xxx/kernel-headers. 252 # The build system then combines all the values specified by all the 253 # PRODUCT_VENDOR_KERNEL_HEADERS directives in the product inheritance 254 # tree and then exports a TARGET_PRODUCT_KERNEL_HEADERS variable. 255 # 256 # The layout of subdirs in any of the kernel-headers dir should mirror the 257 # layout of the kernel include/ directory. For example, 258 # device/samsung/tuna/kernel-headers/linux/, 259 # hardware/ti/omap4xxx/kernel-headers/media/, 260 # etc. 261 # 262 # NOTE: These directories MUST contain post-processed headers using the 263 # bionic/libc/kernel/tools/clean_header.py tool. Additionally, the original 264 # kernel headers must also be checked in, but in a different subdirectory. By 265 # convention, the originals should be checked into original-kernel-headers 266 # directory of the same parent dir. For example, 267 # device/samsung/tuna/kernel-headers <----- post-processed 268 # device/samsung/tuna/original-kernel-headers <----- originals 269 # 270 TARGET_DEVICE_KERNEL_HEADERS := $(strip $(wildcard $(TARGET_DEVICE_DIR)/kernel-headers)) 271 272 define validate-kernel-headers 273 $(if $(firstword $(foreach hdr_dir,$(1),\ 274 $(filter-out kernel-headers,$(notdir $(hdr_dir))))),\ 275 $(error Kernel header dirs must be end in kernel-headers: $(1))) 276 endef 277 # also allow the board config to provide additional directories since 278 # there could be device/oem/base_hw and device/oem/derived_hw 279 # that both are valid devices but derived_hw needs to use kernel headers 280 # from base_hw. 281 TARGET_BOARD_KERNEL_HEADERS := $(strip $(wildcard $(TARGET_BOARD_KERNEL_HEADERS))) 282 TARGET_BOARD_KERNEL_HEADERS := $(patsubst %/,%,$(TARGET_BOARD_KERNEL_HEADERS)) 283 $(call validate-kernel-headers,$(TARGET_BOARD_KERNEL_HEADERS)) 284 285 # then add product-inherited includes, to allow for 286 # hardware/sivendor/chip/chip.mk to include their own headers 287 TARGET_PRODUCT_KERNEL_HEADERS := $(strip $(wildcard $(PRODUCT_VENDOR_KERNEL_HEADERS))) 288 TARGET_PRODUCT_KERNEL_HEADERS := $(patsubst %/,%,$(TARGET_PRODUCT_KERNEL_HEADERS)) 289 $(call validate-kernel-headers,$(TARGET_PRODUCT_KERNEL_HEADERS)) 290 .KATI_READONLY := TARGET_DEVICE_KERNEL_HEADERS TARGET_BOARD_KERNEL_HEADERS TARGET_PRODUCT_KERNEL_HEADERS 291 292 # Commands to generate .toc file common to ELF .so files. 293 define _gen_toc_command_for_elf 294 $(hide) ($($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)READELF) -d $(1) | grep SONAME || echo "No SONAME for $1") > $(2) 295 $(hide) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)READELF) --dyn-syms $(1) | awk '{$$2=""; $$3=""; print}' >> $(2) 296 endef 297 298 # Commands to generate .toc file from Darwin dynamic library. 299 define _gen_toc_command_for_macho 300 $(hide) $(HOST_OTOOL) -l $(1) | grep LC_ID_DYLIB -A 5 > $(2) 301 $(hide) $(HOST_NM) -gP $(1) | cut -f1-2 -d" " | (grep -v U$$ >> $(2) || true) 302 endef 303 304 ifeq ($(CALLED_FROM_SETUP),true) 305 include $(BUILD_SYSTEM)/ccache.mk 306 include $(BUILD_SYSTEM)/goma.mk 307 endif 308 309 ifdef TARGET_PREFER_32_BIT 310 TARGET_PREFER_32_BIT_APPS := true 311 TARGET_PREFER_32_BIT_EXECUTABLES := true 312 endif 313 314 # GCC version selection 315 TARGET_GCC_VERSION := 4.9 316 ifdef TARGET_2ND_ARCH 317 2ND_TARGET_GCC_VERSION := 4.9 318 endif 319 320 # Normalize WITH_STATIC_ANALYZER 321 ifeq ($(strip $(WITH_STATIC_ANALYZER)),0) 322 WITH_STATIC_ANALYZER := 323 endif 324 325 # Unset WITH_TIDY_ONLY if global WITH_TIDY_ONLY is not true nor 1. 326 ifeq (,$(filter 1 true,$(WITH_TIDY_ONLY))) 327 WITH_TIDY_ONLY := 328 endif 329 330 # Pick a Java compiler. 331 include $(BUILD_SYSTEM)/combo/javac.mk 332 333 # --------------------------------------------------------------- 334 # Check that the configuration is current. We check that 335 # BUILD_ENV_SEQUENCE_NUMBER is current against this value. 336 # Don't fail if we're called from envsetup, so they have a 337 # chance to update their environment. 338 339 ifeq (,$(strip $(CALLED_FROM_SETUP))) 340 ifneq (,$(strip $(BUILD_ENV_SEQUENCE_NUMBER))) 341 ifneq ($(BUILD_ENV_SEQUENCE_NUMBER),$(CORRECT_BUILD_ENV_SEQUENCE_NUMBER)) 342 $(warning BUILD_ENV_SEQUENCE_NUMBER is set incorrectly.) 343 $(info *** If you use envsetup/lunch/choosecombo:) 344 $(info *** - Re-execute envsetup (". envsetup.sh")) 345 $(info *** - Re-run lunch or choosecombo) 346 $(info *** If you use buildspec.mk:) 347 $(info *** - Look at buildspec.mk.default to see what has changed) 348 $(info *** - Update BUILD_ENV_SEQUENCE_NUMBER to "$(CORRECT_BUILD_ENV_SEQUENCE_NUMBER)") 349 $(error bailing..) 350 endif 351 endif 352 endif 353 354 # Set up PDK so we can use TARGET_BUILD_PDK to select prebuilt tools below 355 .PHONY: pdk fusion 356 pdk fusion: $(DEFAULT_GOAL) 357 358 # What to build: 359 # pdk fusion if: 360 # 1) PDK_FUSION_PLATFORM_ZIP / PDK_FUSION_PLATFORM_DIR is passed in from the environment 361 # or 362 # 2) the platform.zip / pdk.mk exists in the default location 363 # or 364 # 3) fusion is a command line build goal, 365 # PDK_FUSION_PLATFORM_ZIP is needed anyway, then do we need the 'fusion' goal? 366 # otherwise pdk only if: 367 # 1) pdk is a command line build goal 368 # or 369 # 2) TARGET_BUILD_PDK is passed in from the environment 370 371 # if PDK_FUSION_PLATFORM_ZIP or PDK_FUSION_PLATFORM_DIR is specified, do not override. 372 ifeq (,$(strip $(PDK_FUSION_PLATFORM_ZIP)$(PDK_FUSION_PLATFORM_DIR))) 373 # Most PDK project paths should be using vendor/pdk/TARGET_DEVICE 374 # but some legacy ones (e.g. mini_armv7a_neon generic PDK) were setup 375 # with vendor/pdk/TARGET_PRODUCT. 376 # Others are set up with vendor/pdk/TARGET_DEVICE/TARGET_DEVICE-userdebug 377 _pdk_fusion_search_paths := \ 378 vendor/pdk/$(TARGET_DEVICE)/$(TARGET_DEVICE)-$(TARGET_BUILD_VARIANT)/platform \ 379 vendor/pdk/$(TARGET_DEVICE)/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)/platform \ 380 vendor/pdk/$(TARGET_DEVICE)/$(patsubst aosp_%,full_%,$(TARGET_PRODUCT))-$(TARGET_BUILD_VARIANT)/platform \ 381 vendor/pdk/$(TARGET_PRODUCT)/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)/platform \ 382 vendor/pdk/$(TARGET_PRODUCT)/$(patsubst aosp_%,full_%,$(TARGET_PRODUCT))-$(TARGET_BUILD_VARIANT)/platform 383 384 _pdk_fusion_default_platform_zip := $(strip $(foreach p,$(_pdk_fusion_search_paths),$(wildcard $(p)/platform.zip))) 385 ifneq (,$(_pdk_fusion_default_platform_zip)) 386 PDK_FUSION_PLATFORM_ZIP := $(word 1, $(_pdk_fusion_default_platform_zip)) 387 _pdk_fusion_default_platform_zip := 388 else 389 _pdk_fusion_default_platform_mk := $(strip $(foreach p,$(_pdk_fusion_search_paths),$(wildcard $(p)/pdk.mk))) 390 ifneq (,$(_pdk_fusion_default_platform_mk)) 391 PDK_FUSION_PLATFORM_DIR := $(dir $(word 1,$(_pdk_fusion_default_platform_mk))) 392 _pdk_fusion_default_platform_mk := 393 endif 394 endif # _pdk_fusion_default_platform_zip 395 _pdk_fusion_search_paths := 396 endif # !PDK_FUSION_PLATFORM_ZIP && !PDK_FUSION_PLATFORM_DIR 397 398 ifneq (,$(PDK_FUSION_PLATFORM_ZIP)) 399 ifneq (,$(PDK_FUSION_PLATFORM_DIR)) 400 $(error Only one of PDK_FUSION_PLATFORM_ZIP or PDK_FUSION_PLATFORM_DIR may be specified) 401 endif 402 endif 403 404 ifneq (,$(filter pdk fusion, $(MAKECMDGOALS))) 405 TARGET_BUILD_PDK := true 406 ifneq (,$(filter fusion, $(MAKECMDGOALS))) 407 ifeq (,$(strip $(PDK_FUSION_PLATFORM_ZIP)$(PDK_FUSION_PLATFORM_DIR))) 408 $(error Specify PDK_FUSION_PLATFORM_ZIP or PDK_FUSION_PLATFORM_DIR to do a PDK fusion.) 409 endif 410 endif # fusion 411 endif # pdk or fusion 412 413 ifdef PDK_FUSION_PLATFORM_ZIP 414 TARGET_BUILD_PDK := true 415 ifeq (,$(wildcard $(PDK_FUSION_PLATFORM_ZIP))) 416 ifneq (,$(wildcard $(patsubst %.zip,%,$(PDK_FUSION_PLATFORM_ZIP))/pdk.mk)) 417 PDK_FUSION_PLATFORM_DIR := $(patsubst %.zip,%,$(PDK_FUSION_PLATFORM_ZIP)) 418 PDK_FUSION_PLATFORM_ZIP := 419 else 420 $(error Cannot find file $(PDK_FUSION_PLATFORM_ZIP).) 421 endif 422 endif 423 endif 424 425 ifdef PDK_FUSION_PLATFORM_DIR 426 TARGET_BUILD_PDK := true 427 ifeq (,$(wildcard $(PDK_FUSION_PLATFORM_DIR)/pdk.mk)) 428 $(error Cannot find file $(PDK_FUSION_PLATFORM_DIR)/pdk.mk.) 429 endif 430 endif 431 432 BUILD_PLATFORM_ZIP := $(filter platform platform-java,$(MAKECMDGOALS)) 433 434 # --------------------------------------------------------------- 435 # Whether we can expect a full build graph 436 ALLOW_MISSING_DEPENDENCIES := $(filter true,$(ALLOW_MISSING_DEPENDENCIES)) 437 ifneq ($(TARGET_BUILD_APPS),) 438 ALLOW_MISSING_DEPENDENCIES := true 439 endif 440 ifeq ($(TARGET_BUILD_PDK),true) 441 ALLOW_MISSING_DEPENDENCIES := true 442 endif 443 ifneq ($(filter true,$(SOONG_ALLOW_MISSING_DEPENDENCIES)),) 444 ALLOW_MISSING_DEPENDENCIES := true 445 endif 446 ifneq ($(ONE_SHOT_MAKEFILE),) 447 ALLOW_MISSING_DEPENDENCIES := true 448 endif 449 .KATI_READONLY := ALLOW_MISSING_DEPENDENCIES 450 451 TARGET_BUILD_APPS_USE_PREBUILT_SDK := 452 ifdef TARGET_BUILD_APPS 453 ifndef UNBUNDLED_BUILD_SDKS_FROM_SOURCE 454 TARGET_BUILD_APPS_USE_PREBUILT_SDK := true 455 endif 456 endif 457 458 prebuilt_sdk_tools := prebuilts/sdk/tools 459 prebuilt_sdk_tools_bin := $(prebuilt_sdk_tools)/$(HOST_OS)/bin 460 461 # Always use prebuilts for ckati and makeparallel 462 prebuilt_build_tools := prebuilts/build-tools 463 prebuilt_build_tools_wrappers := prebuilts/build-tools/common/bin 464 prebuilt_build_tools_jars := prebuilts/build-tools/common/framework 465 prebuilt_build_tools_bin_noasan := $(prebuilt_build_tools)/$(HOST_PREBUILT_TAG)/bin 466 ifeq ($(filter address,$(SANITIZE_HOST)),) 467 prebuilt_build_tools_bin := $(prebuilt_build_tools_bin_noasan) 468 else 469 prebuilt_build_tools_bin := $(prebuilt_build_tools)/$(HOST_PREBUILT_TAG)/asan/bin 470 endif 471 472 USE_PREBUILT_SDK_TOOLS_IN_PLACE := true 473 474 # Work around for b/68406220 475 # This should match the soong version. 476 USE_D8 := true 477 .KATI_READONLY := USE_D8 478 479 # 480 # Tools that are prebuilts for TARGET_BUILD_APPS 481 # 482 ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) 483 AIDL := $(HOST_OUT_EXECUTABLES)/aidl 484 AAPT := $(HOST_OUT_EXECUTABLES)/aapt 485 AAPT2 := $(HOST_OUT_EXECUTABLES)/aapt2 486 MAINDEXCLASSES := $(HOST_OUT_EXECUTABLES)/mainDexClasses 487 SIGNAPK_JAR := $(HOST_OUT_JAVA_LIBRARIES)/signapk$(COMMON_JAVA_PACKAGE_SUFFIX) 488 SIGNAPK_JNI_LIBRARY_PATH := $(HOST_OUT_SHARED_LIBRARIES) 489 ZIPALIGN := $(HOST_OUT_EXECUTABLES)/zipalign 490 491 else # TARGET_BUILD_APPS || TARGET_BUILD_PDK 492 AIDL := $(prebuilt_build_tools_bin)/aidl 493 AAPT := $(prebuilt_sdk_tools_bin)/aapt 494 AAPT2 := $(prebuilt_sdk_tools_bin)/aapt2 495 MAINDEXCLASSES := $(prebuilt_sdk_tools)/mainDexClasses 496 SIGNAPK_JAR := $(prebuilt_sdk_tools)/lib/signapk$(COMMON_JAVA_PACKAGE_SUFFIX) 497 SIGNAPK_JNI_LIBRARY_PATH := $(prebuilt_sdk_tools)/$(HOST_OS)/lib64 498 ZIPALIGN := $(prebuilt_build_tools_bin)/zipalign 499 endif # TARGET_BUILD_APPS || TARGET_BUILD_PDK 500 501 ifeq (,$(TARGET_BUILD_APPS)) 502 # Use RenderScript prebuilts for unbundled builds but not PDK builds 503 LLVM_RS_CC := $(HOST_OUT_EXECUTABLES)/llvm-rs-cc 504 BCC_COMPAT := $(HOST_OUT_EXECUTABLES)/bcc_compat 505 else 506 LLVM_RS_CC := $(prebuilt_sdk_tools_bin)/llvm-rs-cc 507 BCC_COMPAT := $(prebuilt_sdk_tools_bin)/bcc_compat 508 endif # TARGET_BUILD_PDK 509 510 prebuilt_sdk_tools := 511 prebuilt_sdk_tools_bin := 512 513 ACP := $(prebuilt_build_tools_bin)/acp 514 CKATI := $(prebuilt_build_tools_bin)/ckati 515 DEPMOD := $(HOST_OUT_EXECUTABLES)/depmod 516 FILESLIST := $(SOONG_HOST_OUT_EXECUTABLES)/fileslist 517 HOST_INIT_VERIFIER := $(HOST_OUT_EXECUTABLES)/host_init_verifier 518 MAKEPARALLEL := $(prebuilt_build_tools_bin)/makeparallel 519 SOONG_JAVAC_WRAPPER := $(SOONG_HOST_OUT_EXECUTABLES)/soong_javac_wrapper 520 SOONG_ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/soong_zip 521 MERGE_ZIPS := $(SOONG_HOST_OUT_EXECUTABLES)/merge_zips 522 XMLLINT := $(SOONG_HOST_OUT_EXECUTABLES)/xmllint 523 ZIP2ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/zip2zip 524 ZIPTIME := $(prebuilt_build_tools_bin)/ziptime 525 526 # --------------------------------------------------------------- 527 # Generic tools. 528 529 LEX := $(prebuilt_build_tools_bin_noasan)/flex 530 # The default PKGDATADIR built in the prebuilt bison is a relative path 531 # prebuilts/build-tools/common/bison. 532 # To run bison from elsewhere you need to set up enviromental variable 533 # BISON_PKGDATADIR. 534 BISON_PKGDATADIR := $(PWD)/prebuilts/build-tools/common/bison 535 BISON := $(prebuilt_build_tools_bin_noasan)/bison 536 YACC := $(BISON) -d 537 BISON_DATA := $(wildcard $(BISON_PKGDATADIR)/* $(BISON_PKGDATADIR)/*/*) 538 539 YASM := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/yasm/yasm 540 541 DOXYGEN:= doxygen 542 ifeq ($(HOST_OS),linux) 543 BREAKPAD_DUMP_SYMS := $(HOST_OUT_EXECUTABLES)/dump_syms 544 else 545 # For non-supported hosts, do not generate breakpad symbols. 546 BREAKPAD_GENERATE_SYMBOLS := false 547 endif 548 PROTOC := $(HOST_OUT_EXECUTABLES)/aprotoc$(HOST_EXECUTABLE_SUFFIX) 549 NANOPB_SRCS := $(HOST_OUT_EXECUTABLES)/protoc-gen-nanopb 550 VTSC := $(HOST_OUT_EXECUTABLES)/vtsc$(HOST_EXECUTABLE_SUFFIX) 551 MKBOOTFS := $(HOST_OUT_EXECUTABLES)/mkbootfs$(HOST_EXECUTABLE_SUFFIX) 552 MINIGZIP := $(HOST_OUT_EXECUTABLES)/minigzip$(HOST_EXECUTABLE_SUFFIX) 553 BROTLI := $(HOST_OUT_EXECUTABLES)/brotli$(HOST_EXECUTABLE_SUFFIX) 554 ifeq (,$(strip $(BOARD_CUSTOM_MKBOOTIMG))) 555 MKBOOTIMG := $(HOST_OUT_EXECUTABLES)/mkbootimg$(HOST_EXECUTABLE_SUFFIX) 556 else 557 MKBOOTIMG := $(BOARD_CUSTOM_MKBOOTIMG) 558 endif 559 ifeq (,$(strip $(BOARD_CUSTOM_BPTTOOL))) 560 BPTTOOL := $(HOST_OUT_EXECUTABLES)/bpttool$(HOST_EXECUTABLE_SUFFIX) 561 else 562 BPTTOOL := $(BOARD_CUSTOM_BPTTOOL) 563 endif 564 ifeq (,$(strip $(BOARD_CUSTOM_AVBTOOL))) 565 AVBTOOL := $(HOST_OUT_EXECUTABLES)/avbtool$(HOST_EXECUTABLE_SUFFIX) 566 else 567 AVBTOOL := $(BOARD_CUSTOM_AVBTOOL) 568 endif 569 APICHECK := $(HOST_OUT_JAVA_LIBRARIES)/metalava$(COMMON_JAVA_PACKAGE_SUFFIX) 570 FS_GET_STATS := $(HOST_OUT_EXECUTABLES)/fs_get_stats$(HOST_EXECUTABLE_SUFFIX) 571 MAKE_EXT4FS := $(HOST_OUT_EXECUTABLES)/mke2fs$(HOST_EXECUTABLE_SUFFIX) 572 MKEXTUSERIMG := $(HOST_OUT_EXECUTABLES)/mkuserimg_mke2fs 573 MKE2FS_CONF := system/extras/ext4_utils/mke2fs.conf 574 BLK_ALLOC_TO_BASE_FS := $(HOST_OUT_EXECUTABLES)/blk_alloc_to_base_fs$(HOST_EXECUTABLE_SUFFIX) 575 MAKE_SQUASHFS := $(HOST_OUT_EXECUTABLES)/mksquashfs$(HOST_EXECUTABLE_SUFFIX) 576 MKSQUASHFSUSERIMG := $(HOST_OUT_EXECUTABLES)/mksquashfsimage.sh 577 MAKE_F2FS := $(HOST_OUT_EXECUTABLES)/make_f2fs$(HOST_EXECUTABLE_SUFFIX) 578 MKF2FSUSERIMG := $(HOST_OUT_EXECUTABLES)/mkf2fsuserimg.sh 579 SIMG2IMG := $(HOST_OUT_EXECUTABLES)/simg2img$(HOST_EXECUTABLE_SUFFIX) 580 IMG2SIMG := $(HOST_OUT_EXECUTABLES)/img2simg$(HOST_EXECUTABLE_SUFFIX) 581 E2FSCK := $(HOST_OUT_EXECUTABLES)/e2fsck$(HOST_EXECUTABLE_SUFFIX) 582 MKTARBALL := build/make/tools/mktarball.sh 583 TUNE2FS := $(HOST_OUT_EXECUTABLES)/tune2fs$(HOST_EXECUTABLE_SUFFIX) 584 JARJAR := $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar 585 DATA_BINDING_COMPILER := $(HOST_OUT_JAVA_LIBRARIES)/databinding-compiler.jar 586 FAT16COPY := build/make/tools/fat16copy.py 587 CHECK_LINK_TYPE := build/make/tools/check_link_type.py 588 CHECK_ELF_FILE := build/make/tools/check_elf_file.py 589 LPMAKE := $(HOST_OUT_EXECUTABLES)/lpmake$(HOST_EXECUTABLE_SUFFIX) 590 BUILD_SUPER_IMAGE := build/make/tools/releasetools/build_super_image.py 591 592 PROGUARD_HOME := external/proguard 593 PROGUARD := $(PROGUARD_HOME)/bin/proguard.sh 594 PROGUARD_DEPS := $(PROGUARD) $(PROGUARD_HOME)/lib/proguard.jar 595 JAVATAGS := build/make/tools/java-event-log-tags.py 596 MERGETAGS := build/make/tools/merge-event-log-tags.py 597 BUILD_IMAGE_SRCS := $(wildcard build/make/tools/releasetools/*.py) 598 APPEND2SIMG := $(HOST_OUT_EXECUTABLES)/append2simg 599 VERITY_SIGNER := $(HOST_OUT_EXECUTABLES)/verity_signer 600 BUILD_VERITY_METADATA := $(HOST_OUT_EXECUTABLES)/build_verity_metadata.py 601 BUILD_VERITY_TREE := $(HOST_OUT_EXECUTABLES)/build_verity_tree 602 BOOT_SIGNER := $(HOST_OUT_EXECUTABLES)/boot_signer 603 FUTILITY := $(HOST_OUT_EXECUTABLES)/futility-host 604 VBOOT_SIGNER := prebuilts/misc/scripts/vboot_signer/vboot_signer.sh 605 FEC := $(HOST_OUT_EXECUTABLES)/fec 606 BRILLO_UPDATE_PAYLOAD := $(HOST_OUT_EXECUTABLES)/brillo_update_payload 607 608 DEXDUMP := $(HOST_OUT_EXECUTABLES)/dexdump2$(BUILD_EXECUTABLE_SUFFIX) 609 PROFMAN := $(HOST_OUT_EXECUTABLES)/profman 610 611 FINDBUGS_DIR := external/owasp/sanitizer/tools/findbugs/bin 612 FINDBUGS := $(FINDBUGS_DIR)/findbugs 613 614 JETIFIER := prebuilts/sdk/tools/jetifier/jetifier-standalone/bin/jetifier-standalone 615 616 EXTRACT_KERNEL := build/make/tools/extract_kernel.py 617 618 USE_OPENJDK9 := true 619 620 ifeq ($(EXPERIMENTAL_USE_OPENJDK9),) 621 TARGET_OPENJDK9 := 622 else ifeq ($(EXPERIMENTAL_USE_OPENJDK9),1.8) 623 TARGET_OPENJDK9 := 624 else ifeq ($(EXPERIMENTAL_USE_OPENJDK9),true) 625 TARGET_OPENJDK9 := true 626 endif 627 628 # Path to tools.jar 629 HOST_JDK_TOOLS_JAR := $(ANDROID_JAVA8_HOME)/lib/tools.jar 630 631 # It's called md5 on Mac OS and md5sum on Linux 632 ifeq ($(HOST_OS),darwin) 633 MD5SUM:=md5 -q 634 else 635 MD5SUM:=md5sum 636 endif 637 638 APICHECK_COMMAND := $(JAVA) -Xmx4g -jar $(APICHECK) --no-banner --compatible-output=yes 639 640 # Boolean variable determining if the whitelist for compatible properties is enabled 641 PRODUCT_COMPATIBLE_PROPERTY := false 642 ifneq ($(PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE),) 643 PRODUCT_COMPATIBLE_PROPERTY := $(PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE) 644 else ifeq ($(PRODUCT_SHIPPING_API_LEVEL),) 645 #$(warning no product shipping level defined) 646 else ifneq ($(call math_lt,27,$(PRODUCT_SHIPPING_API_LEVEL)),) 647 PRODUCT_COMPATIBLE_PROPERTY := true 648 endif 649 650 .KATI_READONLY := \ 651 PRODUCT_COMPATIBLE_PROPERTY 652 653 # Boolean variable determining if Treble is fully enabled 654 PRODUCT_FULL_TREBLE := false 655 ifneq ($(PRODUCT_FULL_TREBLE_OVERRIDE),) 656 PRODUCT_FULL_TREBLE := $(PRODUCT_FULL_TREBLE_OVERRIDE) 657 else ifeq ($(PRODUCT_SHIPPING_API_LEVEL),) 658 #$(warning no product shipping level defined) 659 else ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),26),) 660 PRODUCT_FULL_TREBLE := true 661 endif 662 663 # TODO(b/69865032): Make PRODUCT_NOTICE_SPLIT the default behavior and remove 664 # references to it here and below. 665 ifdef PRODUCT_NOTICE_SPLIT_OVERRIDE 666 $(error PRODUCT_NOTICE_SPLIT_OVERRIDE cannot be set.) 667 endif 668 669 requirements := \ 670 PRODUCT_TREBLE_LINKER_NAMESPACES \ 671 PRODUCT_SEPOLICY_SPLIT \ 672 PRODUCT_ENFORCE_VINTF_MANIFEST \ 673 PRODUCT_NOTICE_SPLIT 674 675 # If it is overriden, then the requirement override is taken, otherwise it's 676 # PRODUCT_FULL_TREBLE 677 $(foreach req,$(requirements),$(eval \ 678 $(req) := $(if $($(req)_OVERRIDE),$($(req)_OVERRIDE),$(PRODUCT_FULL_TREBLE)))) 679 # If the requirement is false for any reason, then it's not PRODUCT_FULL_TREBLE 680 $(foreach req,$(requirements),$(eval \ 681 PRODUCT_FULL_TREBLE := $(if $(filter false,$($(req))),false,$(PRODUCT_FULL_TREBLE)))) 682 683 PRODUCT_FULL_TREBLE_OVERRIDE ?= 684 $(foreach req,$(requirements),$(eval $(req)_OVERRIDE ?=)) 685 686 # TODO(b/114488870): disallow PRODUCT_FULL_TREBLE_OVERRIDE from being used. 687 .KATI_READONLY := \ 688 PRODUCT_FULL_TREBLE_OVERRIDE \ 689 $(foreach req,$(requirements),$(req)_OVERRIDE) \ 690 $(requirements) \ 691 PRODUCT_FULL_TREBLE \ 692 693 $(KATI_obsolete_var $(foreach req,$(requirements),$(req)_OVERRIDE) \ 694 ,This should be referenced without the _OVERRIDE suffix.) 695 696 requirements := 697 698 # BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED can be true only if early-mount of 699 # partitions is supported. But the early-mount must be supported for full 700 # treble products, and so BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED should be set 701 # by default for full treble products. 702 ifeq ($(PRODUCT_FULL_TREBLE),true) 703 BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED ?= true 704 endif 705 706 # If PRODUCT_USE_VNDK is true and BOARD_VNDK_VERSION is not defined yet, 707 # BOARD_VNDK_VERSION will be set to "current" as default. 708 # PRODUCT_USE_VNDK will be true in Android-P or later launching devices. 709 PRODUCT_USE_VNDK := false 710 ifneq ($(PRODUCT_USE_VNDK_OVERRIDE),) 711 PRODUCT_USE_VNDK := $(PRODUCT_USE_VNDK_OVERRIDE) 712 else ifeq ($(PRODUCT_SHIPPING_API_LEVEL),) 713 # No shipping level defined 714 else ifeq ($(call math_gt_or_eq,27,$(PRODUCT_SHIPPING_API_LEVEL)),) 715 PRODUCT_USE_VNDK := $(PRODUCT_FULL_TREBLE) 716 endif 717 718 ifeq ($(PRODUCT_USE_VNDK),true) 719 ifndef BOARD_VNDK_VERSION 720 BOARD_VNDK_VERSION := current 721 endif 722 endif 723 724 $(KATI_obsolete_var PRODUCT_USE_VNDK_OVERRIDE,Use PRODUCT_USE_VNDK instead) 725 .KATI_READONLY := \ 726 PRODUCT_USE_VNDK 727 728 # Set BOARD_SYSTEMSDK_VERSIONS to the latest SystemSDK version starting from P-launching 729 # devices if unset. 730 ifndef BOARD_SYSTEMSDK_VERSIONS 731 ifdef PRODUCT_SHIPPING_API_LEVEL 732 ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),28),) 733 ifeq (REL,$(PLATFORM_VERSION_CODENAME)) 734 BOARD_SYSTEMSDK_VERSIONS := $(PLATFORM_SDK_VERSION) 735 else 736 BOARD_SYSTEMSDK_VERSIONS := $(PLATFORM_VERSION_CODENAME) 737 endif 738 endif 739 endif 740 endif 741 742 743 ifdef PRODUCT_SHIPPING_API_LEVEL 744 ifneq ($(call numbers_less_than,$(PRODUCT_SHIPPING_API_LEVEL),$(BOARD_SYSTEMSDK_VERSIONS)),) 745 $(error BOARD_SYSTEMSDK_VERSIONS ($(BOARD_SYSTEMSDK_VERSIONS)) must all be greater than or equal to PRODUCT_SHIPPING_API_LEVEL ($(PRODUCT_SHIPPING_API_LEVEL))) 746 endif 747 ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),28),) 748 ifneq ($(TARGET_IS_64_BIT), true) 749 ifneq ($(TARGET_USES_64_BIT_BINDER), true) 750 $(error When PRODUCT_SHIPPING_API_LEVEL >= 28, TARGET_USES_64_BIT_BINDER must be true) 751 endif 752 endif 753 endif 754 ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),29),) 755 ifneq ($(BOARD_OTA_FRAMEWORK_VBMETA_VERSION_OVERRIDE),) 756 $(error When PRODUCT_SHIPPING_API_LEVEL >= 29, BOARD_OTA_FRAMEWORK_VBMETA_VERSION_OVERRIDE cannot be set) 757 endif 758 endif 759 endif 760 761 # The default key if not set as LOCAL_CERTIFICATE 762 ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE 763 DEFAULT_SYSTEM_DEV_CERTIFICATE := $(PRODUCT_DEFAULT_DEV_CERTIFICATE) 764 else 765 DEFAULT_SYSTEM_DEV_CERTIFICATE := build/target/product/security/testkey 766 endif 767 .KATI_READONLY := DEFAULT_SYSTEM_DEV_CERTIFICATE 768 769 BUILD_NUMBER_FROM_FILE := $$(cat $(OUT_DIR)/build_number.txt) 770 BUILD_DATETIME_FROM_FILE := $$(cat $(BUILD_DATETIME_FILE)) 771 772 # SEPolicy versions 773 774 # PLATFORM_SEPOLICY_VERSION is a number of the form "NN.m" with "NN" mapping to 775 # PLATFORM_SDK_VERSION and "m" as a minor number which allows for SELinux 776 # changes independent of PLATFORM_SDK_VERSION. This value will be set to 777 # 10000.0 to represent tip-of-tree development that is inherently unstable and 778 # thus designed not to work with any shipping vendor policy. This is similar in 779 # spirit to how DEFAULT_APP_TARGET_SDK is set. 780 # The minor version ('m' component) must be updated every time a platform release 781 # is made which breaks compatibility with the previous platform sepolicy version, 782 # not just on every increase in PLATFORM_SDK_VERSION. The minor version should 783 # be reset to 0 on every bump of the PLATFORM_SDK_VERSION. 784 sepolicy_major_vers := 29 785 sepolicy_minor_vers := 0 786 787 ifneq ($(sepolicy_major_vers), $(PLATFORM_SDK_VERSION)) 788 $(error sepolicy_major_version does not match PLATFORM_SDK_VERSION, please update.) 789 endif 790 791 TOT_SEPOLICY_VERSION := 10000.0 792 ifneq (REL,$(PLATFORM_VERSION_CODENAME)) 793 PLATFORM_SEPOLICY_VERSION := $(TOT_SEPOLICY_VERSION) 794 else 795 PLATFORM_SEPOLICY_VERSION := $(join $(addsuffix .,$(sepolicy_major_vers)), $(sepolicy_minor_vers)) 796 endif 797 sepolicy_major_vers := 798 sepolicy_minor_vers := 799 800 # A list of SEPolicy versions, besides PLATFORM_SEPOLICY_VERSION, that the framework supports. 801 PLATFORM_SEPOLICY_COMPAT_VERSIONS := \ 802 26.0 \ 803 27.0 \ 804 28.0 \ 805 806 .KATI_READONLY := \ 807 PLATFORM_SEPOLICY_COMPAT_VERSIONS \ 808 PLATFORM_SEPOLICY_VERSION \ 809 TOT_SEPOLICY_VERSION \ 810 811 ifeq ($(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS),true) 812 ifneq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) 813 $(error PRODUCT_USE_DYNAMIC_PARTITIONS must be true when PRODUCT_RETROFIT_DYNAMIC_PARTITIONS \ 814 is set) 815 endif 816 ifdef PRODUCT_SHIPPING_API_LEVEL 817 ifeq (true,$(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),29)) 818 $(error Devices with shipping API level $(PRODUCT_SHIPPING_API_LEVEL) must not set \ 819 PRODUCT_RETROFIT_DYNAMIC_PARTITIONS) 820 endif 821 endif 822 endif 823 824 ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) 825 ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) 826 $(error BOARD_BUILD_SYSTEM_ROOT_IMAGE cannot be true for devices with dynamic partitions) 827 endif 828 ifneq ($(PRODUCT_USE_DYNAMIC_PARTITION_SIZE),true) 829 $(error PRODUCT_USE_DYNAMIC_PARTITION_SIZE must be true for devices with dynamic partitions) 830 endif 831 endif 832 833 ifeq ($(PRODUCT_BUILD_SUPER_PARTITION),true) 834 ifneq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) 835 $(error Can only build super partition for devices with dynamic partitions) 836 endif 837 endif 838 839 840 ifeq ($(PRODUCT_USE_DYNAMIC_PARTITION_SIZE),true) 841 842 ifneq ($(BOARD_SYSTEMIMAGE_PARTITION_SIZE),) 843 ifneq ($(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),) 844 $(error Should not define BOARD_SYSTEMIMAGE_PARTITION_SIZE and \ 845 BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE together) 846 endif 847 endif 848 849 ifneq ($(BOARD_VENDORIMAGE_PARTITION_SIZE),) 850 ifneq ($(BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE),) 851 $(error Should not define BOARD_VENDORIMAGE_PARTITION_SIZE and \ 852 BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE together) 853 endif 854 endif 855 856 ifneq ($(BOARD_ODMIMAGE_PARTITION_SIZE),) 857 ifneq ($(BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE),) 858 $(error Should not define BOARD_ODMIMAGE_PARTITION_SIZE and \ 859 BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE together) 860 endif 861 endif 862 863 ifneq ($(BOARD_PRODUCTIMAGE_PARTITION_SIZE),) 864 ifneq ($(BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE),) 865 $(error Should not define BOARD_PRODUCTIMAGE_PARTITION_SIZE and \ 866 BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE together) 867 endif 868 endif 869 870 ifneq ($(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE),) 871 ifneq ($(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_RESERVED_SIZE),) 872 $(error Should not define BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE and \ 873 BOARD_PRODUCT_SERVICESIMAGE_PARTITION_RESERVED_SIZE together) 874 endif 875 endif 876 877 endif # PRODUCT_USE_DYNAMIC_PARTITION_SIZE 878 879 ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) 880 881 # BOARD_SUPER_PARTITION_GROUPS defines a list of "updatable groups". Each updatable group is a 882 # group of partitions that share the same pool of free spaces. 883 # For each group in BOARD_SUPER_PARTITION_GROUPS, a BOARD_{GROUP}_SIZE and 884 # BOARD_{GROUP}_PARTITION_PARTITION_LIST may be defined. 885 # - BOARD_{GROUP}_SIZE: The maximum sum of sizes of all partitions in the group. 886 # Must not be empty. 887 # - BOARD_{GROUP}_PARTITION_PARTITION_LIST: the list of partitions that belongs to this group. 888 # If empty, no partitions belong to this group, and the sum of sizes is effectively 0. 889 $(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \ 890 $(eval BOARD_$(group)_PARTITION_LIST ?=) \ 891 $(eval .KATI_READONLY := BOARD_$(group)_PARTITION_LIST) \ 892 ) 893 ifeq ($(PRODUCT_BUILD_SUPER_PARTITION),true) 894 $(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \ 895 $(eval BOARD_$(group)_SIZE := $(strip $(BOARD_$(group)_SIZE))) \ 896 $(if $(BOARD_$(group)_SIZE),,$(error BOARD_$(group)_SIZE must not be empty)) \ 897 $(eval .KATI_READONLY := BOARD_$(group)_SIZE) \ 898 ) 899 endif # PRODUCT_BUILD_SUPER_PARTITION 900 901 # BOARD_*_PARTITION_LIST: a list of the following tokens 902 valid_super_partition_list := system vendor product product_services odm 903 $(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \ 904 $(if $(filter-out $(valid_super_partition_list),$(BOARD_$(group)_PARTITION_LIST)), \ 905 $(error BOARD_$(group)_PARTITION_LIST contains invalid partition name \ 906 $(filter-out $(valid_super_partition_list),$(BOARD_$(group)_PARTITION_LIST)). \ 907 Valid names are $(valid_super_partition_list)))) 908 valid_super_partition_list := 909 910 911 # Define BOARD_SUPER_PARTITION_PARTITION_LIST, the sum of all BOARD_*_PARTITION_LIST 912 ifdef BOARD_SUPER_PARTITION_PARTITION_LIST 913 $(error BOARD_SUPER_PARTITION_PARTITION_LIST should not be defined, but computed from \ 914 BOARD_SUPER_PARTITION_GROUPS and BOARD_*_PARTITION_LIST) 915 endif 916 BOARD_SUPER_PARTITION_PARTITION_LIST := \ 917 $(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \ 918 $(BOARD_$(group)_PARTITION_LIST)) 919 .KATI_READONLY := BOARD_SUPER_PARTITION_PARTITION_LIST 920 921 endif # PRODUCT_USE_DYNAMIC_PARTITIONS 922 923 ifeq ($(PRODUCT_BUILD_SUPER_PARTITION),true) 924 925 ifneq ($(BOARD_SUPER_PARTITION_SIZE),) 926 ifeq ($(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS),true) 927 928 # The metadata device must be specified manually for retrofitting. 929 ifeq ($(BOARD_SUPER_PARTITION_METADATA_DEVICE),) 930 $(error Must specify BOARD_SUPER_PARTITION_METADATA_DEVICE if PRODUCT_RETROFIT_DYNAMIC_PARTITIONS=true.) 931 endif 932 933 # The super partition block device list must be specified manually for retrofitting. 934 ifeq ($(BOARD_SUPER_PARTITION_BLOCK_DEVICES),) 935 $(error Must specify BOARD_SUPER_PARTITION_BLOCK_DEVICES if PRODUCT_RETROFIT_DYNAMIC_PARTITIONS=true.) 936 endif 937 938 # The metadata device must be included in the super partition block device list. 939 ifeq (,$(filter $(BOARD_SUPER_PARTITION_METADATA_DEVICE),$(BOARD_SUPER_PARTITION_BLOCK_DEVICES))) 940 $(error BOARD_SUPER_PARTITION_METADATA_DEVICE is not listed in BOARD_SUPER_PARTITION_BLOCK_DEVICES.) 941 endif 942 943 # The metadata device must be supplied to init via the kernel command-line. 944 INTERNAL_KERNEL_CMDLINE += androidboot.super_partition=$(BOARD_SUPER_PARTITION_METADATA_DEVICE) 945 946 BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE := true 947 948 # If "vendor" is listed as one of the dynamic partitions but without its image available (e.g. an 949 # AOSP target built without vendor image), don't build the retrofit full OTA package. Because we 950 # won't be able to build meaningful super_* images for retrofitting purpose. 951 ifneq (,$(filter vendor,$(BOARD_SUPER_PARTITION_PARTITION_LIST))) 952 ifndef BUILDING_VENDOR_IMAGE 953 ifndef BOARD_PREBUILT_VENDORIMAGE 954 BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE := 955 endif # BOARD_PREBUILT_VENDORIMAGE 956 endif # BUILDING_VENDOR_IMAGE 957 endif # BOARD_SUPER_PARTITION_PARTITION_LIST 958 959 else # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS 960 961 # For normal devices, we populate BOARD_SUPER_PARTITION_BLOCK_DEVICES so the 962 # build can handle both cases consistently. 963 ifeq ($(BOARD_SUPER_PARTITION_METADATA_DEVICE),) 964 BOARD_SUPER_PARTITION_METADATA_DEVICE := super 965 endif 966 967 ifeq ($(BOARD_SUPER_PARTITION_BLOCK_DEVICES),) 968 BOARD_SUPER_PARTITION_BLOCK_DEVICES := $(BOARD_SUPER_PARTITION_METADATA_DEVICE) 969 endif 970 971 # If only one super block device, default to super partition size. 972 ifeq ($(word 2,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),) 973 BOARD_SUPER_PARTITION_$(call to-upper,$(strip $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)))_DEVICE_SIZE ?= \ 974 $(BOARD_SUPER_PARTITION_SIZE) 975 endif 976 977 ifneq ($(BOARD_SUPER_PARTITION_METADATA_DEVICE),super) 978 INTERNAL_KERNEL_CMDLINE += androidboot.super_partition=$(BOARD_SUPER_PARTITION_METADATA_DEVICE) 979 endif 980 BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE := 981 982 endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS 983 endif # BOARD_SUPER_PARTITION_SIZE 984 .KATI_READONLY := BOARD_SUPER_PARTITION_BLOCK_DEVICES 985 .KATI_READONLY := BOARD_SUPER_PARTITION_METADATA_DEVICE 986 .KATI_READONLY := BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE 987 988 $(foreach device,$(call to-upper,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)), \ 989 $(eval BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE := $(strip $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE))) \ 990 $(if $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE),, \ 991 $(error BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE must not be empty)) \ 992 $(eval .KATI_READONLY := BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE)) 993 994 endif # PRODUCT_BUILD_SUPER_PARTITION 995 996 # ############################################################### 997 # Set up final options. 998 # ############################################################### 999 1000 # We run gcc/clang with PWD=/proc/self/cwd to remove the $TOP 1001 # from the debug output. That way two builds in two different 1002 # directories will create the same output. 1003 # /proc doesn't exist on Darwin. 1004 ifeq ($(HOST_OS),linux) 1005 RELATIVE_PWD := PWD=/proc/self/cwd 1006 else 1007 RELATIVE_PWD := 1008 endif 1009 1010 TARGET_PROJECT_INCLUDES := 1011 TARGET_PROJECT_SYSTEM_INCLUDES := \ 1012 $(TARGET_DEVICE_KERNEL_HEADERS) $(TARGET_BOARD_KERNEL_HEADERS) \ 1013 $(TARGET_PRODUCT_KERNEL_HEADERS) 1014 1015 ifdef TARGET_2ND_ARCH 1016 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_PROJECT_INCLUDES := $(TARGET_PROJECT_INCLUDES) 1017 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_PROJECT_SYSTEM_INCLUDES := $(TARGET_PROJECT_SYSTEM_INCLUDES) 1018 endif 1019 1020 # Flags for DEX2OAT 1021 first_non_empty_of_three = $(if $(1),$(1),$(if $(2),$(2),$(3))) 1022 DEX2OAT_TARGET_ARCH := $(TARGET_ARCH) 1023 DEX2OAT_TARGET_CPU_VARIANT := $(call first_non_empty_of_three,$(TARGET_CPU_VARIANT),$(TARGET_ARCH_VARIANT),default) 1024 DEX2OAT_TARGET_CPU_VARIANT_RUNTIME := $(call first_non_empty_of_three,$(TARGET_CPU_VARIANT_RUNTIME),$(TARGET_ARCH_VARIANT),default) 1025 DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := default 1026 1027 ifdef TARGET_2ND_ARCH 1028 $(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH := $(TARGET_2ND_ARCH) 1029 $(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT := $(call first_non_empty_of_three,$(TARGET_2ND_CPU_VARIANT),$(TARGET_2ND_ARCH_VARIANT),default) 1030 $(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) 1031 $(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := default 1032 endif 1033 1034 # ############################################################### 1035 # Collect a list of the SDK versions that we could compile against 1036 # For use with the LOCAL_SDK_VERSION variable for include $(BUILD_PACKAGE) 1037 # ############################################################### 1038 1039 HISTORICAL_SDK_VERSIONS_ROOT := $(TOPDIR)prebuilts/sdk 1040 HISTORICAL_NDK_VERSIONS_ROOT := $(TOPDIR)prebuilts/ndk 1041 1042 # The path where app can reference the support library resources. 1043 ifdef TARGET_BUILD_APPS 1044 SUPPORT_LIBRARY_ROOT := $(HISTORICAL_SDK_VERSIONS_ROOT)/current/support 1045 else 1046 SUPPORT_LIBRARY_ROOT := frameworks/support 1047 endif 1048 1049 get-sdk-version = $(if $(findstring _,$(1)),$(subst core_,,$(subst system_,,$(subst test_,,$(1)))),$(1)) 1050 get-sdk-api = $(if $(findstring _,$(1)),$(patsubst %_$(call get-sdk-version,$(1)),%,$(1)),public) 1051 get-prebuilt-sdk-dir = $(HISTORICAL_SDK_VERSIONS_ROOT)/$(call get-sdk-version,$(1))/$(call get-sdk-api,$(1)) 1052 1053 # Resolve LOCAL_SDK_VERSION to prebuilt module name, e.g.: 1054 # 23 -> sdk_public_23_android 1055 # system_current -> sdk_system_current_android 1056 # $(1): An sdk version (LOCAL_SDK_VERSION) 1057 # $(2): optional library name (default: android) 1058 define resolve-prebuilt-sdk-module 1059 $(if $(findstring _,$(1)),\ 1060 sdk_$(1)_$(or $(2),android),\ 1061 sdk_public_$(1)_$(or $(2),android)) 1062 endef 1063 1064 # Resolve LOCAL_SDK_VERSION to prebuilt android.jar 1065 # $(1): LOCAL_SDK_VERSION 1066 resolve-prebuilt-sdk-jar-path = $(call get-prebuilt-sdk-dir,$(1))/android.jar 1067 1068 # Resolve LOCAL_SDK_VERSION to prebuilt framework.aidl 1069 # $(1): An sdk version (LOCAL_SDK_VERSION) 1070 resolve-prebuilt-sdk-aidl-path = $(call get-prebuilt-sdk-dir,$(call get-sdk-version,$(1)))/framework.aidl 1071 1072 # Historical SDK version N is stored in $(HISTORICAL_SDK_VERSIONS_ROOT)/N. 1073 # The 'current' version is whatever this source tree is. 1074 # 1075 # sgrax is the opposite of xargs. It takes the list of args and puts them 1076 # on each line for sort to process. 1077 # sort -g is a numeric sort, so 1 2 3 10 instead of 1 10 2 3. 1078 1079 # Numerically sort a list of numbers 1080 # $(1): the list of numbers to be sorted 1081 define numerically_sort 1082 $(shell function sgrax() { \ 1083 while [ -n "$$1" ] ; do echo $$1 ; shift ; done \ 1084 } ; \ 1085 ( sgrax $(1) | sort -g ) ) 1086 endef 1087 1088 # This produces a list like "current/core current/public current/system 4/public" 1089 TARGET_AVAILABLE_SDK_VERSIONS := $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/*/android.jar) 1090 TARGET_AVAILABLE_SDK_VERSIONS := $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/android.jar,%,$(TARGET_AVAILABLE_SDK_VERSIONS)) 1091 # Strips and reorganizes the "public", "core" and "system" subdirs. 1092 TARGET_AVAILABLE_SDK_VERSIONS := $(subst /public,,$(TARGET_AVAILABLE_SDK_VERSIONS)) 1093 TARGET_AVAILABLE_SDK_VERSIONS := $(patsubst %/core,core_%,$(TARGET_AVAILABLE_SDK_VERSIONS)) 1094 TARGET_AVAILABLE_SDK_VERSIONS := $(patsubst %/system,system_%,$(TARGET_AVAILABLE_SDK_VERSIONS)) 1095 # No prebuilt for test_current. 1096 TARGET_AVAILABLE_SDK_VERSIONS += test_current 1097 TARGET_AVAIALBLE_SDK_VERSIONS := $(call numerically_sort,$(TARGET_AVAILABLE_SDK_VERSIONS)) 1098 1099 TARGET_SDK_VERSIONS_WITHOUT_JAVA_18_SUPPORT := $(call numbers_less_than,24,$(TARGET_AVAILABLE_SDK_VERSIONS)) 1100 TARGET_SDK_VERSIONS_WITHOUT_JAVA_19_SUPPORT := $(call numbers_less_than,27,$(TARGET_AVAILABLE_SDK_VERSIONS)) 1101 1102 ifndef INTERNAL_PLATFORM_PRIVATE_API_FILE 1103 INTERNAL_PLATFORM_PRIVATE_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/private.txt 1104 endif 1105 ifndef INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE 1106 INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/private-dex.txt 1107 endif 1108 ifndef INTERNAL_PLATFORM_SYSTEM_PRIVATE_API_FILE 1109 INTERNAL_PLATFORM_SYSTEM_PRIVATE_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/system-private.txt 1110 endif 1111 ifndef INTERNAL_PLATFORM_SYSTEM_PRIVATE_DEX_API_FILE 1112 INTERNAL_PLATFORM_SYSTEM_PRIVATE_DEX_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/system-private-dex.txt 1113 endif 1114 1115 # Missing optional uses-libraries so that the platform doesn't create build rules that depend on 1116 # them. See setup_one_odex.mk. 1117 INTERNAL_PLATFORM_MISSING_USES_LIBRARIES := com.google.android.ble com.google.android.wearable 1118 1119 # This is the standard way to name a directory containing prebuilt target 1120 # objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so 1121 TARGET_PREBUILT_TAG := android-$(TARGET_ARCH) 1122 ifdef TARGET_2ND_ARCH 1123 TARGET_2ND_PREBUILT_TAG := android-$(TARGET_2ND_ARCH) 1124 endif 1125 1126 # Set up RS prebuilt variables for compatibility library 1127 1128 RS_PREBUILT_CLCORE := prebuilts/sdk/renderscript/lib/$(TARGET_ARCH)/librsrt_$(TARGET_ARCH).bc 1129 RS_PREBUILT_COMPILER_RT := prebuilts/sdk/renderscript/lib/$(TARGET_ARCH)/libcompiler_rt.a 1130 1131 # API Level lists for Renderscript Compat lib. 1132 RSCOMPAT_32BIT_ONLY_API_LEVELS := 8 9 10 11 12 13 14 15 16 17 18 19 20 1133 RSCOMPAT_NO_USAGEIO_API_LEVELS := 8 9 10 11 12 13 1134 1135 # Add BUILD_NUMBER to apps default version name if it's unbundled build. 1136 ifdef TARGET_BUILD_APPS 1137 TARGET_BUILD_WITH_APPS_VERSION_NAME := true 1138 endif 1139 1140 ifdef TARGET_BUILD_WITH_APPS_VERSION_NAME 1141 APPS_DEFAULT_VERSION_NAME := $(PLATFORM_VERSION)-$(BUILD_NUMBER_FROM_FILE) 1142 else 1143 APPS_DEFAULT_VERSION_NAME := $(PLATFORM_VERSION) 1144 endif 1145 1146 # ANDROID_WARNING_ALLOWED_PROJECTS is generated by build/soong. 1147 define find_warning_allowed_projects 1148 $(filter $(ANDROID_WARNING_ALLOWED_PROJECTS),$(1)/) 1149 endef 1150 1151 # These goals don't need to collect and include Android.mks/CleanSpec.mks 1152 # in the source tree. 1153 dont_bother_goals := out \ 1154 snod systemimage-nodeps \ 1155 stnod systemtarball-nodeps \ 1156 userdataimage-nodeps userdatatarball-nodeps \ 1157 cacheimage-nodeps \ 1158 bptimage-nodeps \ 1159 vnod vendorimage-nodeps \ 1160 pnod productimage-nodeps \ 1161 psnod productservicesimage-nodeps \ 1162 onod odmimage-nodeps \ 1163 systemotherimage-nodeps \ 1164 ramdisk-nodeps \ 1165 ramdisk_debug-nodeps \ 1166 bootimage-nodeps \ 1167 bootimage_debug-nodeps \ 1168 recoveryimage-nodeps \ 1169 vbmetaimage-nodeps \ 1170 product-graph dump-products 1171 1172 ifeq ($(CALLED_FROM_SETUP),true) 1173 include $(BUILD_SYSTEM)/ninja_config.mk 1174 include $(BUILD_SYSTEM)/soong_config.mk 1175 endif 1176 1177 -include external/linux-kselftest/android/kselftest_test_list.mk 1178 -include external/ltp/android/ltp_package_list.mk 1179 DEFAULT_DATA_OUT_MODULES := ltp $(ltp_packages) $(kselftest_modules) 1180 .KATI_READONLY := DEFAULT_DATA_OUT_MODULES 1181 1182 include $(BUILD_SYSTEM)/dumpvar.mk 1183