blob: 4141cee457f099af5015d7e339d3278afe734fa6 [file] [log] [blame]
Anton Hanssonbb76ce82019-02-26 12:34:03 +00001#
2# Copyright (C) 2019 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# ###############################################################
18# This file includes BoardConfig.mk for the device being built,
19# and sanity-checks the variable defined therein.
20# ###############################################################
21
Anton Hanssond488d2d2019-02-26 15:49:25 +000022_board_strip_readonly_list := \
23 BOARD_EGL_CFG \
24 BOARD_HAVE_BLUETOOTH \
25 BOARD_INSTALLER_CMDLINE \
26 BOARD_KERNEL_CMDLINE \
27 BOARD_KERNEL_BASE \
28 BOARD_USES_GENERIC_AUDIO \
Yifan Hong8d297372020-01-24 14:28:03 -080029 BOARD_USES_RECOVERY_AS_BOOT \
Anton Hanssond488d2d2019-02-26 15:49:25 +000030 BOARD_VENDOR_USE_AKMD \
31 BOARD_WPA_SUPPLICANT_DRIVER \
32 BOARD_WLAN_DEVICE \
33 TARGET_ARCH \
34 TARGET_ARCH_VARIANT \
35 TARGET_CPU_ABI \
36 TARGET_CPU_ABI2 \
37 TARGET_CPU_VARIANT \
38 TARGET_CPU_VARIANT_RUNTIME \
39 TARGET_2ND_ARCH \
40 TARGET_2ND_ARCH_VARIANT \
41 TARGET_2ND_CPU_ABI \
42 TARGET_2ND_CPU_ABI2 \
43 TARGET_2ND_CPU_VARIANT \
44 TARGET_2ND_CPU_VARIANT_RUNTIME \
45 TARGET_BOARD_PLATFORM \
46 TARGET_BOARD_PLATFORM_GPU \
47 TARGET_BOOTLOADER_BOARD_NAME \
Dan Willemsend32e6d12019-04-10 12:25:07 -070048 TARGET_FS_CONFIG_GEN \
Anton Hanssond488d2d2019-02-26 15:49:25 +000049 TARGET_NO_BOOTLOADER \
50 TARGET_NO_KERNEL \
51 TARGET_NO_RECOVERY \
52 TARGET_NO_RADIOIMAGE \
53 TARGET_HARDWARE_3D \
54 WITH_DEXPREOPT \
55
56# File system variables
57_board_strip_readonly_list += \
58 BOARD_FLASH_BLOCK_SIZE \
59 BOARD_BOOTIMAGE_PARTITION_SIZE \
60 BOARD_RECOVERYIMAGE_PARTITION_SIZE \
61 BOARD_SYSTEMIMAGE_PARTITION_SIZE \
62 BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE \
63 BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE \
64 BOARD_USERDATAIMAGE_PARTITION_SIZE \
65 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE \
66 BOARD_CACHEIMAGE_PARTITION_SIZE \
67 BOARD_VENDORIMAGE_PARTITION_SIZE \
68 BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE \
69 BOARD_PRODUCTIMAGE_PARTITION_SIZE \
70 BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE \
Justin Yun6151e3f2019-06-25 15:58:13 +090071 BOARD_SYSTEM_EXTIMAGE_PARTITION_SIZE \
72 BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE \
Anton Hanssond488d2d2019-02-26 15:49:25 +000073 BOARD_ODMIMAGE_PARTITION_SIZE \
74 BOARD_ODMIMAGE_FILE_SYSTEM_TYPE \
Yifan Hongcfb917a2020-05-07 14:58:20 -070075 BOARD_VENDOR_DLKMIMAGE_PARTITION_SIZE \
76 BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE \
Yifan Hongf496f1b2020-07-15 16:52:59 -070077 BOARD_ODM_DLKMIMAGE_PARTITION_SIZE \
78 BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE \
Anton Hanssond488d2d2019-02-26 15:49:25 +000079
80# Logical partitions related variables.
81_dynamic_partitions_var_list += \
82 BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE \
83 BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE \
84 BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE \
Yifan Hongcfb917a2020-05-07 14:58:20 -070085 BOARD_VENDOR_DLKMIMAGE_PARTITION_RESERVED_SIZE \
Yifan Hongf496f1b2020-07-15 16:52:59 -070086 BOARD_ODM_DLKMIMAGE_PARTITION_RESERVED_SIZE \
Anton Hanssond488d2d2019-02-26 15:49:25 +000087 BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE \
Justin Yun6151e3f2019-06-25 15:58:13 +090088 BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE \
Anton Hanssond488d2d2019-02-26 15:49:25 +000089 BOARD_SUPER_PARTITION_SIZE \
90 BOARD_SUPER_PARTITION_GROUPS \
91
92_board_strip_readonly_list += $(_dynamic_partitions_var_list)
93
94_build_broken_var_list := \
Anton Hanssond488d2d2019-02-26 15:49:25 +000095 BUILD_BROKEN_DUP_RULES \
Yo Chiang0b49c032020-03-17 17:49:49 +080096 BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES \
Yifan Hong5e57a772020-01-09 16:15:11 -080097 BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS \
Logan Chien2a880752019-09-17 09:45:09 -070098 BUILD_BROKEN_PREBUILT_ELF_FILES \
Inseob Kim5d60c8a2019-10-17 10:32:59 +000099 BUILD_BROKEN_TREBLE_SYSPROP_NEVERALLOW \
Dan Willemsen0586c652019-04-09 09:56:48 -0700100 BUILD_BROKEN_USES_NETWORK \
Yifan Hong5e57a772020-01-09 16:15:11 -0800101 BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES \
Jiyong Park0b4fccb2020-06-26 17:38:00 +0900102 BUILD_BROKEN_DUP_SYSPROP \
Anton Hanssond488d2d2019-02-26 15:49:25 +0000103
Dan Willemsen695849e2019-04-17 12:25:09 -0700104_build_broken_var_list += \
105 $(foreach m,$(AVAILABLE_BUILD_MODULE_TYPES) \
106 $(DEFAULT_WARNING_BUILD_MODULE_TYPES) \
107 $(DEFAULT_ERROR_BUILD_MODULE_TYPES), \
108 BUILD_BROKEN_USES_$(m))
109
Anton Hanssond488d2d2019-02-26 15:49:25 +0000110_board_true_false_vars := $(_build_broken_var_list)
Dan Willemsen26076252020-01-02 20:08:10 -0800111_board_strip_readonly_list += $(_build_broken_var_list) \
112 BUILD_BROKEN_NINJA_USES_ENV_VARS
Anton Hanssond488d2d2019-02-26 15:49:25 +0000113
Anton Hansson74dc00b2019-02-27 14:38:27 +0000114# Conditional to building on linux, as dex2oat currently does not work on darwin.
115ifeq ($(HOST_OS),linux)
116 WITH_DEXPREOPT := true
117endif
118
Anton Hanssonb9544692019-02-26 13:37:28 +0000119# ###############################################################
120# Broken build defaults
121# ###############################################################
Dan Willemsen0586c652019-04-09 09:56:48 -0700122$(foreach v,$(_build_broken_var_list),$(eval $(v) :=))
Dan Willemsen26076252020-01-02 20:08:10 -0800123BUILD_BROKEN_NINJA_USES_ENV_VARS :=
Anton Hanssonb9544692019-02-26 13:37:28 +0000124
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000125# Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)
126# or under vendor/*/$(TARGET_DEVICE). Search in both places, but
127# make sure only one exists.
128# Real boards should always be associated with an OEM vendor.
129ifdef TARGET_DEVICE_DIR
130 ifneq ($(origin TARGET_DEVICE_DIR),command line)
131 $(error TARGET_DEVICE_DIR may not be set manually)
132 endif
133 board_config_mk := $(TARGET_DEVICE_DIR)/BoardConfig.mk
134else
135 board_config_mk := \
136 $(strip $(sort $(wildcard \
137 $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \
138 $(shell test -d device && find -L device -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
139 $(shell test -d vendor && find -L vendor -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
140 )))
141 ifeq ($(board_config_mk),)
142 $(error No config file found for TARGET_DEVICE $(TARGET_DEVICE))
143 endif
144 ifneq ($(words $(board_config_mk)),1)
145 $(error Multiple board config files for TARGET_DEVICE $(TARGET_DEVICE): $(board_config_mk))
146 endif
147 TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk)))
148 .KATI_READONLY := TARGET_DEVICE_DIR
149endif
150include $(board_config_mk)
151ifeq ($(TARGET_ARCH),)
152 $(error TARGET_ARCH not defined by board config: $(board_config_mk))
153endif
154ifneq ($(MALLOC_IMPL),)
155 $(warning *** Unsupported option MALLOC_IMPL defined by board config: $(board_config_mk).)
156 $(error Use `MALLOC_SVELTE := true` to configure jemalloc for low-memory)
157endif
158board_config_mk :=
159
Anton Hanssond488d2d2019-02-26 15:49:25 +0000160# Clean up and verify BoardConfig variables
161$(foreach var,$(_board_strip_readonly_list),$(eval $(var) := $$(strip $$($(var)))))
162$(foreach var,$(_board_true_false_vars), \
163 $(if $(filter-out true false,$($(var))), \
164 $(error Valid values of $(var) are "true", "false", and "". Not "$($(var))")))
Anton Hanssonb9544692019-02-26 13:37:28 +0000165
166# Default *_CPU_VARIANT_RUNTIME to CPU_VARIANT if unspecified.
167TARGET_CPU_VARIANT_RUNTIME := $(or $(TARGET_CPU_VARIANT_RUNTIME),$(TARGET_CPU_VARIANT))
168TARGET_2ND_CPU_VARIANT_RUNTIME := $(or $(TARGET_2ND_CPU_VARIANT_RUNTIME),$(TARGET_2ND_CPU_VARIANT))
169
Anton Hansson19279852019-02-28 17:15:57 +0000170# The combo makefiles sanity-check and set defaults for various CPU configuration
171combo_target := TARGET_
172combo_2nd_arch_prefix :=
173include $(BUILD_SYSTEM)/combo/select.mk
174
175ifdef TARGET_2ND_ARCH
176 combo_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
177 include $(BUILD_SYSTEM)/combo/select.mk
178endif
179
Anton Hanssond488d2d2019-02-26 15:49:25 +0000180.KATI_READONLY := $(_board_strip_readonly_list)
181
182INTERNAL_KERNEL_CMDLINE := $(BOARD_KERNEL_CMDLINE)
Anton Hanssonb9544692019-02-26 13:37:28 +0000183ifeq ($(TARGET_CPU_ABI),)
184 $(error No TARGET_CPU_ABI defined by board config: $(board_config_mk))
185endif
186ifneq ($(filter %64,$(TARGET_ARCH)),)
187 TARGET_IS_64_BIT := true
188endif
189
190ifeq (,$(filter true,$(TARGET_SUPPORTS_32_BIT_APPS) $(TARGET_SUPPORTS_64_BIT_APPS)))
191 TARGET_SUPPORTS_32_BIT_APPS := true
192endif
193
194# Sanity check to warn about likely cryptic errors later in the build.
195ifeq ($(TARGET_IS_64_BIT),true)
196 ifeq (,$(filter true false,$(TARGET_SUPPORTS_64_BIT_APPS)))
Anton Hansson6d25fc62019-05-10 15:29:28 +0100197 $(error Building a 32-bit-app-only product on a 64-bit device. \
Anton Hanssonb9544692019-02-26 13:37:28 +0000198 If this is intentional, set TARGET_SUPPORTS_64_BIT_APPS := false)
199 endif
200endif
201
202# "ro.product.cpu.abilist32" and "ro.product.cpu.abilist64" are
203# comma separated lists of the 32 and 64 bit ABIs (in order of
204# preference) that the target supports. If TARGET_CPU_ABI_LIST_{32,64}_BIT
205# are defined by the board config, we use them. Else, we construct
206# these lists based on whether TARGET_IS_64_BIT is set.
207#
208# Note that this assumes that the 2ND_CPU_ABI for a 64 bit target
209# is always 32 bits. If this isn't the case, these variables should
210# be overriden in the board configuration.
Evgeny Eltsin28fbe7f2019-07-29 16:23:19 +0200211#
212# Similarly, TARGET_NATIVE_BRIDGE_2ND_ABI for a 64 bit target is always
213# 32 bits. Note that all CPU_ABIs are preferred over all NATIVE_BRIDGE_ABIs.
214_target_native_bridge_abi_list_32_bit :=
215_target_native_bridge_abi_list_64_bit :=
216
Anton Hanssonb9544692019-02-26 13:37:28 +0000217ifeq (,$(TARGET_CPU_ABI_LIST_64_BIT))
218 ifeq (true|true,$(TARGET_IS_64_BIT)|$(TARGET_SUPPORTS_64_BIT_APPS))
219 TARGET_CPU_ABI_LIST_64_BIT := $(TARGET_CPU_ABI) $(TARGET_CPU_ABI2)
Evgeny Eltsin28fbe7f2019-07-29 16:23:19 +0200220 _target_native_bridge_abi_list_64_bit := $(TARGET_NATIVE_BRIDGE_ABI)
Anton Hanssonb9544692019-02-26 13:37:28 +0000221 endif
222endif
223
Peter Collingbourne6aea25d2019-05-16 14:09:35 -0700224# "arm64-v8a-hwasan", the ABI for libraries compiled with HWASAN, is supported
225# in all builds with SANITIZE_TARGET=hwaddress.
226ifneq ($(filter hwaddress,$(SANITIZE_TARGET)),)
227 ifneq ($(filter arm64-v8a,$(TARGET_CPU_ABI_LIST_64_BIT)),)
228 TARGET_CPU_ABI_LIST_64_BIT := arm64-v8a-hwasan $(TARGET_CPU_ABI_LIST_64_BIT)
229 endif
230endif
231
Anton Hanssonb9544692019-02-26 13:37:28 +0000232ifeq (,$(TARGET_CPU_ABI_LIST_32_BIT))
233 ifneq (true,$(TARGET_IS_64_BIT))
234 TARGET_CPU_ABI_LIST_32_BIT := $(TARGET_CPU_ABI) $(TARGET_CPU_ABI2)
Evgeny Eltsin28fbe7f2019-07-29 16:23:19 +0200235 _target_native_bridge_abi_list_32_bit := $(TARGET_NATIVE_BRIDGE_ABI)
Anton Hanssonb9544692019-02-26 13:37:28 +0000236 else
237 ifeq (true,$(TARGET_SUPPORTS_32_BIT_APPS))
238 # For a 64 bit target, assume that the 2ND_CPU_ABI
239 # is a 32 bit ABI.
240 TARGET_CPU_ABI_LIST_32_BIT := $(TARGET_2ND_CPU_ABI) $(TARGET_2ND_CPU_ABI2)
Evgeny Eltsin28fbe7f2019-07-29 16:23:19 +0200241 _target_native_bridge_abi_list_32_bit := $(TARGET_NATIVE_BRIDGE_2ND_ABI)
Anton Hanssonb9544692019-02-26 13:37:28 +0000242 endif
243 endif
244endif
245
246# "ro.product.cpu.abilist" is a comma separated list of ABIs (in order
247# of preference) that the target supports. If a TARGET_CPU_ABI_LIST
248# is specified by the board configuration, we use that. If not, we
249# build a list out of the TARGET_CPU_ABIs specified by the config.
Evgeny Eltsin28fbe7f2019-07-29 16:23:19 +0200250# Add NATIVE_BRIDGE_ABIs at the end to keep order of preference.
Anton Hanssonb9544692019-02-26 13:37:28 +0000251ifeq (,$(TARGET_CPU_ABI_LIST))
Elliott Hughes9b824d52020-04-17 15:46:55 -0700252 TARGET_CPU_ABI_LIST := $(TARGET_CPU_ABI_LIST_64_BIT) $(TARGET_CPU_ABI_LIST_32_BIT) \
253 $(_target_native_bridge_abi_list_64_bit) $(_target_native_bridge_abi_list_32_bit)
Anton Hanssonb9544692019-02-26 13:37:28 +0000254endif
255
Evgeny Eltsin28fbe7f2019-07-29 16:23:19 +0200256# Add NATIVE_BRIDGE_ABIs at the end of 32 and 64 bit CPU_ABIs to keep order of preference.
257TARGET_CPU_ABI_LIST_32_BIT += $(_target_native_bridge_abi_list_32_bit)
258TARGET_CPU_ABI_LIST_64_BIT += $(_target_native_bridge_abi_list_64_bit)
259
Anton Hanssonb9544692019-02-26 13:37:28 +0000260# Strip whitespace from the ABI list string.
261TARGET_CPU_ABI_LIST := $(subst $(space),$(comma),$(strip $(TARGET_CPU_ABI_LIST)))
262TARGET_CPU_ABI_LIST_32_BIT := $(subst $(space),$(comma),$(strip $(TARGET_CPU_ABI_LIST_32_BIT)))
263TARGET_CPU_ABI_LIST_64_BIT := $(subst $(space),$(comma),$(strip $(TARGET_CPU_ABI_LIST_64_BIT)))
264
Jeongik Chabb688a92019-07-12 12:51:37 +0900265# Check if config about image building is valid or not.
266define check_image_config
267 $(eval _uc_name := $(call to-upper,$(1))) \
268 $(eval _lc_name := $(call to-lower,$(1))) \
269 $(if $(filter $(_lc_name),$(TARGET_COPY_OUT_$(_uc_name))), \
270 $(if $(BOARD_USES_$(_uc_name)IMAGE),, \
271 $(error If TARGET_COPY_OUT_$(_uc_name) is '$(_lc_name)', either BOARD_PREBUILT_$(_uc_name)IMAGE or BOARD_$(_uc_name)IMAGE_FILE_SYSTEM_TYPE must be set)), \
272 $(if $(BOARD_USES_$(_uc_name)IMAGE), \
273 $(error TARGET_COPY_OUT_$(_uc_name) must be set to '$(_lc_name)' to use a $(_lc_name) image))) \
274 $(eval _uc_name :=) \
275 $(eval _lc_name :=)
276endef
277
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000278###########################################
279# Now we can substitute with the real value of TARGET_COPY_OUT_RAMDISK
280ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
281TARGET_COPY_OUT_RAMDISK := $(TARGET_COPY_OUT_ROOT)
282endif
283
284###########################################
Bowgo Tsai0013f552019-03-20 17:59:52 +0800285# Now we can substitute with the real value of TARGET_COPY_OUT_DEBUG_RAMDISK
286ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
287TARGET_COPY_OUT_DEBUG_RAMDISK := debug_ramdisk/first_stage_ramdisk
Bowgo Tsai6a683672020-02-14 19:00:15 +0800288TARGET_COPY_OUT_VENDOR_DEBUG_RAMDISK := vendor_debug_ramdisk/first_stage_ramdisk
Bowgo Tsai5c40c712019-10-08 10:22:19 +0800289TARGET_COPY_OUT_TEST_HARNESS_RAMDISK := test_harness_ramdisk/first_stage_ramdisk
Bowgo Tsai0013f552019-03-20 17:59:52 +0800290endif
291
292###########################################
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000293# Configure whether we're building the system image
294BUILDING_SYSTEM_IMAGE := true
295ifeq ($(PRODUCT_BUILD_SYSTEM_IMAGE),)
296 ifndef PRODUCT_USE_DYNAMIC_PARTITION_SIZE
297 ifndef BOARD_SYSTEMIMAGE_PARTITION_SIZE
298 BUILDING_SYSTEM_IMAGE :=
299 endif
300 endif
301else ifeq ($(PRODUCT_BUILD_SYSTEM_IMAGE),false)
302 BUILDING_SYSTEM_IMAGE :=
303endif
304.KATI_READONLY := BUILDING_SYSTEM_IMAGE
305
306# Are we building a system_other image
307BUILDING_SYSTEM_OTHER_IMAGE :=
308ifeq ($(PRODUCT_BUILD_SYSTEM_OTHER_IMAGE),)
309 ifdef BUILDING_SYSTEM_IMAGE
310 ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true)
311 BUILDING_SYSTEM_OTHER_IMAGE := true
312 endif
313 endif
314else ifeq ($(PRODUCT_BUILD_SYSTEM_OTHER_IMAGE),true)
315 BUILDING_SYSTEM_OTHER_IMAGE := true
316 ifndef BUILDING_SYSTEM_IMAGE
317 $(error PRODUCT_BUILD_SYSTEM_OTHER_IMAGE = true requires building the system image)
318 endif
319endif
320.KATI_READONLY := BUILDING_SYSTEM_OTHER_IMAGE
321
322# Are we building a cache image
323BUILDING_CACHE_IMAGE :=
324ifeq ($(PRODUCT_BUILD_CACHE_IMAGE),)
325 ifdef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE
326 BUILDING_CACHE_IMAGE := true
327 endif
328else ifeq ($(PRODUCT_BUILD_CACHE_IMAGE),true)
329 BUILDING_CACHE_IMAGE := true
330 ifndef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE
331 $(error PRODUCT_BUILD_CACHE_IMAGE set to true, but BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE not defined)
332 endif
333endif
334.KATI_READONLY := BUILDING_CACHE_IMAGE
335
Chris Grossa784ef12019-04-22 11:09:57 -0700336# Are we building a boot image
337BUILDING_BOOT_IMAGE :=
338ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
339 BUILDING_BOOT_IMAGE :=
340else ifeq ($(PRODUCT_BUILD_BOOT_IMAGE),)
341 ifdef BOARD_BOOTIMAGE_PARTITION_SIZE
342 BUILDING_BOOT_IMAGE := true
343 endif
344else ifeq ($(PRODUCT_BUILD_BOOT_IMAGE),true)
345 BUILDING_BOOT_IMAGE := true
346endif
347.KATI_READONLY := BUILDING_BOOT_IMAGE
348
349# Are we building a recovery image
350BUILDING_RECOVERY_IMAGE :=
351ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
352 BUILDING_RECOVERY_IMAGE := true
353else ifeq ($(PRODUCT_BUILD_RECOVERY_IMAGE),)
354 ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE
355 ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY)))
356 BUILDING_RECOVERY_IMAGE := true
357 endif
358 endif
359else ifeq ($(PRODUCT_BUILD_RECOVERY_IMAGE),true)
360 BUILDING_RECOVERY_IMAGE := true
361endif
362.KATI_READONLY := BUILDING_RECOVERY_IMAGE
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000363
Steve Mucklee1b10862019-07-10 10:49:37 -0700364# Are we building a vendor boot image
365BUILDING_VENDOR_BOOT_IMAGE :=
366ifdef BOARD_BOOT_HEADER_VERSION
367 ifneq ($(call math_gt_or_eq,$(BOARD_BOOT_HEADER_VERSION),3),)
Steve Muckle3363a0b2020-02-12 13:38:28 -0800368 ifneq ($(TARGET_NO_VENDOR_BOOT),true)
369 BUILDING_VENDOR_BOOT_IMAGE := true
370 endif
Steve Mucklee1b10862019-07-10 10:49:37 -0700371 endif
372endif
373.KATI_READONLY := BUILDING_VENDOR_BOOT_IMAGE
374
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000375# Are we building a ramdisk image
376BUILDING_RAMDISK_IMAGE := true
377ifeq ($(PRODUCT_BUILD_RAMDISK_IMAGE),)
378 # TODO: Be smarter about this. This probably only needs to happen when one of the follow is true:
379 # BUILDING_BOOT_IMAGE
380 # BUILDING_RECOVERY_IMAGE
381else ifeq ($(PRODUCT_BUILD_RAMDISK_IMAGE),false)
382 BUILDING_RAMDISK_IMAGE :=
383endif
384.KATI_READONLY := BUILDING_RAMDISK_IMAGE
385
386# Are we building a userdata image
387BUILDING_USERDATA_IMAGE :=
388ifeq ($(PRODUCT_BUILD_USERDATA_IMAGE),)
389 ifdef BOARD_USERDATAIMAGE_PARTITION_SIZE
390 BUILDING_USERDATA_IMAGE := true
391 endif
392else ifeq ($(PRODUCT_BUILD_USERDATA_IMAGE),true)
393 BUILDING_USERDATA_IMAGE := true
394endif
395.KATI_READONLY := BUILDING_USERDATA_IMAGE
396
Paul Trautrim4e143232019-08-13 16:30:57 +0900397# Are we building a vbmeta image
398BUILDING_VBMETA_IMAGE := true
399ifeq ($(PRODUCT_BUILD_VBMETA_IMAGE),false)
400 BUILDING_VBMETA_IMAGE :=
401endif
402.KATI_READONLY := BUILDING_VBMETA_IMAGE
403
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000404###########################################
405# Now we can substitute with the real value of TARGET_COPY_OUT_VENDOR
406ifeq ($(TARGET_COPY_OUT_VENDOR),$(_vendor_path_placeholder))
407 TARGET_COPY_OUT_VENDOR := system/vendor
408else ifeq ($(filter vendor system/vendor,$(TARGET_COPY_OUT_VENDOR)),)
409 $(error TARGET_COPY_OUT_VENDOR must be either 'vendor' or 'system/vendor', seeing '$(TARGET_COPY_OUT_VENDOR)'.)
410endif
411PRODUCT_COPY_FILES := $(subst $(_vendor_path_placeholder),$(TARGET_COPY_OUT_VENDOR),$(PRODUCT_COPY_FILES))
412
413BOARD_USES_VENDORIMAGE :=
414ifdef BOARD_PREBUILT_VENDORIMAGE
415 BOARD_USES_VENDORIMAGE := true
416endif
417ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
418 BOARD_USES_VENDORIMAGE := true
419endif
Jeongik Chabb688a92019-07-12 12:51:37 +0900420# TODO(b/137169253): For now, some AOSP targets build with prebuilt vendor image.
421# But target's BOARD_PREBUILT_VENDORIMAGE is not filled.
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000422ifeq ($(TARGET_COPY_OUT_VENDOR),vendor)
423 BOARD_USES_VENDORIMAGE := true
424else ifdef BOARD_USES_VENDORIMAGE
425 $(error TARGET_COPY_OUT_VENDOR must be set to 'vendor' to use a vendor image)
426endif
427.KATI_READONLY := BOARD_USES_VENDORIMAGE
428
429BUILDING_VENDOR_IMAGE :=
430ifeq ($(PRODUCT_BUILD_VENDOR_IMAGE),)
431 ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
432 BUILDING_VENDOR_IMAGE := true
433 endif
434else ifeq ($(PRODUCT_BUILD_VENDOR_IMAGE),true)
435 BUILDING_VENDOR_IMAGE := true
436 ifndef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
437 $(error PRODUCT_BUILD_VENDOR_IMAGE set to true, but BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE not defined)
438 endif
439endif
440ifdef BOARD_PREBUILT_VENDORIMAGE
441 BUILDING_VENDOR_IMAGE :=
442endif
443.KATI_READONLY := BUILDING_VENDOR_IMAGE
444
445###########################################
446# Now we can substitute with the real value of TARGET_COPY_OUT_PRODUCT
447ifeq ($(TARGET_COPY_OUT_PRODUCT),$(_product_path_placeholder))
448TARGET_COPY_OUT_PRODUCT := system/product
449else ifeq ($(filter product system/product,$(TARGET_COPY_OUT_PRODUCT)),)
450$(error TARGET_COPY_OUT_PRODUCT must be either 'product' or 'system/product', seeing '$(TARGET_COPY_OUT_PRODUCT)'.)
451endif
452PRODUCT_COPY_FILES := $(subst $(_product_path_placeholder),$(TARGET_COPY_OUT_PRODUCT),$(PRODUCT_COPY_FILES))
453
454BOARD_USES_PRODUCTIMAGE :=
455ifdef BOARD_PREBUILT_PRODUCTIMAGE
456 BOARD_USES_PRODUCTIMAGE := true
457endif
458ifdef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
459 BOARD_USES_PRODUCTIMAGE := true
460endif
Jeongik Chabb688a92019-07-12 12:51:37 +0900461$(call check_image_config,product)
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000462.KATI_READONLY := BOARD_USES_PRODUCTIMAGE
463
464BUILDING_PRODUCT_IMAGE :=
465ifeq ($(PRODUCT_BUILD_PRODUCT_IMAGE),)
466 ifdef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
467 BUILDING_PRODUCT_IMAGE := true
468 endif
469else ifeq ($(PRODUCT_BUILD_PRODUCT_IMAGE),true)
470 BUILDING_PRODUCT_IMAGE := true
471 ifndef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
472 $(error PRODUCT_BUILD_PRODUCT_IMAGE set to true, but BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE not defined)
473 endif
474endif
475ifdef BOARD_PREBUILT_PRODUCTIMAGE
476 BUILDING_PRODUCT_IMAGE :=
477endif
478.KATI_READONLY := BUILDING_PRODUCT_IMAGE
479
480###########################################
Justin Yun6151e3f2019-06-25 15:58:13 +0900481# TODO(b/135957588) TARGET_COPY_OUT_PRODUCT_SERVICES will be set to
482# TARGET_COPY_OUT_PRODUCT as a workaround.
483TARGET_COPY_OUT_PRODUCT_SERVICES := $(TARGET_COPY_OUT_PRODUCT)
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000484
Justin Yun6151e3f2019-06-25 15:58:13 +0900485###########################################
486# Now we can substitute with the real value of TARGET_COPY_OUT_SYSTEM_EXT
487ifeq ($(TARGET_COPY_OUT_SYSTEM_EXT),$(_system_ext_path_placeholder))
488TARGET_COPY_OUT_SYSTEM_EXT := system/system_ext
489else ifeq ($(filter system_ext system/system_ext,$(TARGET_COPY_OUT_SYSTEM_EXT)),)
490$(error TARGET_COPY_OUT_SYSTEM_EXT must be either 'system_ext' or 'system/system_ext', seeing '$(TARGET_COPY_OUT_SYSTEM_EXT)'.)
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000491endif
Justin Yun6151e3f2019-06-25 15:58:13 +0900492PRODUCT_COPY_FILES := $(subst $(_system_ext_path_placeholder),$(TARGET_COPY_OUT_SYSTEM_EXT),$(PRODUCT_COPY_FILES))
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000493
Justin Yun6151e3f2019-06-25 15:58:13 +0900494BOARD_USES_SYSTEM_EXTIMAGE :=
495ifdef BOARD_PREBUILT_SYSTEM_EXTIMAGE
496 BOARD_USES_SYSTEM_EXTIMAGE := true
497endif
498ifdef BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE
499 BOARD_USES_SYSTEM_EXTIMAGE := true
500endif
Jeongik Chabb688a92019-07-12 12:51:37 +0900501$(call check_image_config,system_ext)
Justin Yun6151e3f2019-06-25 15:58:13 +0900502.KATI_READONLY := BOARD_USES_SYSTEM_EXTIMAGE
503
504BUILDING_SYSTEM_EXT_IMAGE :=
505ifeq ($(PRODUCT_BUILD_SYSTEM_EXT_IMAGE),)
506 ifdef BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE
507 BUILDING_SYSTEM_EXT_IMAGE := true
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000508 endif
Justin Yun6151e3f2019-06-25 15:58:13 +0900509else ifeq ($(PRODUCT_BUILD_SYSTEM_EXT_IMAGE),true)
510 BUILDING_SYSTEM_EXT_IMAGE := true
511 ifndef BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE
512 $(error PRODUCT_BUILD_SYSTEM_EXT_IMAGE set to true, but BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE not defined)
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000513 endif
514endif
Justin Yun6151e3f2019-06-25 15:58:13 +0900515ifdef BOARD_PREBUILT_SYSTEM_EXTIMAGE
516 BUILDING_SYSTEM_EXT_IMAGE :=
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000517endif
Justin Yun6151e3f2019-06-25 15:58:13 +0900518.KATI_READONLY := BUILDING_SYSTEM_EXT_IMAGE
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000519
520###########################################
Yifan Hongcfb917a2020-05-07 14:58:20 -0700521# Now we can substitute with the real value of TARGET_COPY_OUT_VENDOR_DLKM
522ifeq ($(TARGET_COPY_OUT_VENDOR_DLKM),$(_vendor_dlkm_path_placeholder))
523 TARGET_COPY_OUT_VENDOR_DLKM := $(TARGET_COPY_OUT_VENDOR)/vendor_dlkm
524else ifeq ($(filter vendor_dlkm system/vendor/vendor_dlkm vendor/vendor_dlkm,$(TARGET_COPY_OUT_VENDOR_DLKM)),)
525 $(error TARGET_COPY_OUT_VENDOR_DLKM must be either 'vendor_dlkm', 'system/vendor/vendor_dlkm' or 'vendor/vendor_dlkm', seeing '$(TARGET_COPY_OUT_VENDOR_DLKM)'.)
526endif
527PRODUCT_COPY_FILES := $(subst $(_vendor_dlkm_path_placeholder),$(TARGET_COPY_OUT_VENDOR_DLKM),$(PRODUCT_COPY_FILES))
528
529BOARD_USES_VENDOR_DLKMIMAGE :=
530ifdef BOARD_PREBUILT_VENDOR_DLKMIMAGE
531 BOARD_USES_VENDOR_DLKMIMAGE := true
532endif
533ifdef BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE
534 BOARD_USES_VENDOR_DLKMIMAGE := true
535endif
536$(call check_image_config,vendor_dlkm)
537
538BUILDING_VENDOR_DLKM_IMAGE :=
539ifeq ($(PRODUCT_BUILD_VENDOR_DLKM_IMAGE),)
540 ifdef BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE
541 BUILDING_VENDOR_DLKM_IMAGE := true
542 endif
543else ifeq ($(PRODUCT_BUILD_VENDOR_DLKM_IMAGE),true)
544 BUILDING_VENDOR_DLKM_IMAGE := true
545 ifndef BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE
546 $(error PRODUCT_BUILD_VENDOR_DLKM_IMAGE set to true, but BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE not defined)
547 endif
548endif
549ifdef BOARD_PREBUILT_VENDOR_DLKMIMAGE
550 BUILDING_VENDOR_DLKM_IMAGE :=
551endif
552.KATI_READONLY := BUILDING_VENDOR_DLKM_IMAGE
553
554###########################################
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000555# Now we can substitute with the real value of TARGET_COPY_OUT_ODM
556ifeq ($(TARGET_COPY_OUT_ODM),$(_odm_path_placeholder))
dianlujitao339ef4c2019-10-10 09:26:00 +0800557 TARGET_COPY_OUT_ODM := $(TARGET_COPY_OUT_VENDOR)/odm
558else ifeq ($(filter odm system/vendor/odm vendor/odm,$(TARGET_COPY_OUT_ODM)),)
559 $(error TARGET_COPY_OUT_ODM must be either 'odm', 'system/vendor/odm' or 'vendor/odm', seeing '$(TARGET_COPY_OUT_ODM)'.)
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000560endif
561PRODUCT_COPY_FILES := $(subst $(_odm_path_placeholder),$(TARGET_COPY_OUT_ODM),$(PRODUCT_COPY_FILES))
562
563BOARD_USES_ODMIMAGE :=
564ifdef BOARD_PREBUILT_ODMIMAGE
565 BOARD_USES_ODMIMAGE := true
566endif
567ifdef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE
568 BOARD_USES_ODMIMAGE := true
569endif
Jeongik Chabb688a92019-07-12 12:51:37 +0900570$(call check_image_config,odm)
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000571
572BUILDING_ODM_IMAGE :=
Dan Willemsen25a69372019-04-19 15:00:12 -0700573ifeq ($(PRODUCT_BUILD_ODM_IMAGE),)
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000574 ifdef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE
575 BUILDING_ODM_IMAGE := true
576 endif
577else ifeq ($(PRODUCT_BUILD_ODM_IMAGE),true)
578 BUILDING_ODM_IMAGE := true
579 ifndef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE
580 $(error PRODUCT_BUILD_ODM_IMAGE set to true, but BOARD_ODMIMAGE_FILE_SYSTEM_TYPE not defined)
581 endif
582endif
583ifdef BOARD_PREBUILT_ODMIMAGE
584 BUILDING_ODM_IMAGE :=
585endif
586.KATI_READONLY := BUILDING_ODM_IMAGE
587
Yifan Hongf496f1b2020-07-15 16:52:59 -0700588
589###########################################
590# Now we can substitute with the real value of TARGET_COPY_OUT_ODM_DLKM
591ifeq ($(TARGET_COPY_OUT_ODM_DLKM),$(_odm_dlkm_path_placeholder))
592 TARGET_COPY_OUT_ODM_DLKM := $(TARGET_COPY_OUT_VENDOR)/odm_dlkm
593else ifeq ($(filter odm_dlkm system/vendor/odm_dlkm vendor/odm_dlkm,$(TARGET_COPY_OUT_ODM_DLKM)),)
594 $(error TARGET_COPY_OUT_ODM_DLKM must be either 'odm_dlkm', 'system/vendor/odm_dlkm' or 'vendor/odm_dlkm', seeing '$(TARGET_COPY_OUT_ODM_DLKM)'.)
595endif
596PRODUCT_COPY_FILES := $(subst $(_odm_dlkm_path_placeholder),$(TARGET_COPY_OUT_ODM_DLKM),$(PRODUCT_COPY_FILES))
597
598BOARD_USES_ODM_DLKMIMAGE :=
599ifdef BOARD_PREBUILT_ODM_DLKMIMAGE
600 BOARD_USES_ODM_DLKMIMAGE := true
601endif
602ifdef BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE
603 BOARD_USES_ODM_DLKMIMAGE := true
604endif
605$(call check_image_config,odm_dlkm)
606
607BUILDING_ODM_DLKM_IMAGE :=
608ifeq ($(PRODUCT_BUILD_ODM_DLKM_IMAGE),)
609 ifdef BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE
610 BUILDING_ODM_DLKM_IMAGE := true
611 endif
612else ifeq ($(PRODUCT_BUILD_ODM_DLKM_IMAGE),true)
613 BUILDING_ODM_DLKM_IMAGE := true
614 ifndef BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE
615 $(error PRODUCT_BUILD_ODM_DLKM_IMAGE set to true, but BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE not defined)
616 endif
617endif
618ifdef BOARD_PREBUILT_ODM_DLKMIMAGE
619 BUILDING_ODM_DLKM_IMAGE :=
620endif
621.KATI_READONLY := BUILDING_ODM_DLKM_IMAGE
622
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000623###########################################
Yifan Hong65afc072020-04-17 10:08:10 -0700624# Ensure consistency among TARGET_RECOVERY_UPDATER_LIBS, AB_OTA_UPDATER, and PRODUCT_OTA_FORCE_NON_AB_PACKAGE.
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000625TARGET_RECOVERY_UPDATER_LIBS ?=
626AB_OTA_UPDATER ?=
627.KATI_READONLY := TARGET_RECOVERY_UPDATER_LIBS AB_OTA_UPDATER
Yifan Hong65afc072020-04-17 10:08:10 -0700628
629# Ensure that if PRODUCT_OTA_FORCE_NON_AB_PACKAGE == true, then AB_OTA_UPDATER must be true
630ifeq ($(PRODUCT_OTA_FORCE_NON_AB_PACKAGE),true)
631 ifneq ($(AB_OTA_UPDATER),true)
632 $(error AB_OTA_UPDATER must be set to true when PRODUCT_OTA_FORCE_NON_AB_PACKAGE is true)
633 endif
634endif
635
636# In some configurations, A/B and non-A/B may coexist. Check TARGET_OTA_ALLOW_NON_AB
637# to see if non-A/B is supported.
638TARGET_OTA_ALLOW_NON_AB := false
639ifneq ($(AB_OTA_UPDATER),true)
640 TARGET_OTA_ALLOW_NON_AB := true
641else ifeq ($(PRODUCT_OTA_FORCE_NON_AB_PACKAGE),true)
642 TARGET_OTA_ALLOW_NON_AB := true
643endif
644.KATI_READONLY := TARGET_OTA_ALLOW_NON_AB
645
646ifneq ($(TARGET_OTA_ALLOW_NON_AB),true)
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000647 ifneq ($(strip $(TARGET_RECOVERY_UPDATER_LIBS)),)
Yifan Hong65afc072020-04-17 10:08:10 -0700648 $(error Do not use TARGET_RECOVERY_UPDATER_LIBS when using TARGET_OTA_ALLOW_NON_AB)
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000649 endif
650endif
651
Tao Bao9be20c72019-04-08 21:11:59 -0700652# Sanity check for building generic OTA packages. Currently it only supports A/B OTAs.
653ifeq ($(PRODUCT_BUILD_GENERIC_OTA_PACKAGE),true)
654 ifneq ($(AB_OTA_UPDATER),true)
655 $(error PRODUCT_BUILD_GENERIC_OTA_PACKAGE with 'AB_OTA_UPDATER != true' is not supported)
656 endif
657endif
658
Hridya Valsaraju59eaef02019-05-20 11:10:24 -0700659ifdef BOARD_PREBUILT_DTBIMAGE_DIR
660 ifneq ($(BOARD_INCLUDE_DTB_IN_BOOTIMG),true)
661 $(error BOARD_PREBUILT_DTBIMAGE_DIR with 'BOARD_INCLUDE_DTB_IN_BOOTIMG != true' is not supported)
662 endif
663endif
664
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000665# Check BOARD_VNDK_VERSION
666define check_vndk_version
667 $(eval vndk_path := prebuilts/vndk/v$(1)) \
668 $(if $(wildcard $(vndk_path)/*/Android.bp),,$(error VNDK version $(1) not found))
669endef
670
671ifdef BOARD_VNDK_VERSION
Inseob Kim2b0b3d12020-06-25 22:19:29 +0900672 ifeq ($(BOARD_VNDK_VERSION),$(PLATFORM_VNDK_VERSION))
673 $(error BOARD_VNDK_VERSION is equal to PLATFORM_VNDK_VERSION; use BOARD_VNDK_VERSION := current))
674 endif
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000675 ifneq ($(BOARD_VNDK_VERSION),current)
Inseob Kimf0cec692019-12-03 15:09:44 +0900676 $(call check_vndk_version,$(BOARD_VNDK_VERSION))
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000677 endif
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000678 TARGET_VENDOR_TEST_SUFFIX := /vendor
679else
680 TARGET_VENDOR_TEST_SUFFIX :=
681endif
682
Jiyong Park02426e62019-05-08 20:23:42 +0900683###########################################
684# APEXes are by default flattened, i.e. non-updatable.
685# It can be unflattened (and updatable) by inheriting from
686# updatable_apex.mk
Roland Levillainb3a503d2019-10-04 14:06:26 +0100687#
688# APEX flattening can also be forcibly enabled (resp. disabled) by
689# setting OVERRIDE_TARGET_FLATTEN_APEX to true (resp. false), e.g. by
690# setting the OVERRIDE_TARGET_FLATTEN_APEX environment variable.
691ifdef OVERRIDE_TARGET_FLATTEN_APEX
692 TARGET_FLATTEN_APEX := $(OVERRIDE_TARGET_FLATTEN_APEX)
693else
694 ifeq (,$(TARGET_FLATTEN_APEX))
695 TARGET_FLATTEN_APEX := true
696 endif
Jiyong Park02426e62019-05-08 20:23:42 +0900697endif
698
Martin Stjernholm7a430fd2020-06-04 15:16:39 +0100699ifeq (,$(TARGET_BUILD_UNBUNDLED))
Anton Hanssonbb76ce82019-02-26 12:34:03 +0000700ifdef PRODUCT_EXTRA_VNDK_VERSIONS
701 $(foreach v,$(PRODUCT_EXTRA_VNDK_VERSIONS),$(call check_vndk_version,$(v)))
702endif
703endif
704
705# Ensure that BOARD_SYSTEMSDK_VERSIONS are all within PLATFORM_SYSTEMSDK_VERSIONS
706_unsupported_systemsdk_versions := $(filter-out $(PLATFORM_SYSTEMSDK_VERSIONS),$(BOARD_SYSTEMSDK_VERSIONS))
707ifneq (,$(_unsupported_systemsdk_versions))
708 $(error System SDK versions '$(_unsupported_systemsdk_versions)' in BOARD_SYSTEMSDK_VERSIONS are not supported.\
709 Supported versions are $(PLATFORM_SYSTEMSDK_VERSIONS))
710endif
Dan Willemsen695849e2019-04-17 12:25:09 -0700711
712###########################################
713# Handle BUILD_BROKEN_USES_BUILD_*
714
Dan Willemsen97ec8122020-02-19 18:06:54 -0800715$(foreach m,$(DEFAULT_WARNING_BUILD_MODULE_TYPES),\
Dan Willemsen695849e2019-04-17 12:25:09 -0700716 $(if $(filter false,$(BUILD_BROKEN_USES_$(m))),\
717 $(KATI_obsolete_var $(m),Please convert to Soong),\
718 $(KATI_deprecated_var $(m),Please convert to Soong)))
719
Dan Willemsen97ec8122020-02-19 18:06:54 -0800720$(if $(filter true,$(BUILD_BROKEN_USES_BUILD_COPY_HEADERS)),\
721 $(KATI_deprecated_var BUILD_COPY_HEADERS,See $(CHANGES_URL)#copy_headers),\
722 $(KATI_obsolete_var BUILD_COPY_HEADERS,See $(CHANGES_URL)#copy_headers))
Dan Willemsen66d21d42020-01-27 19:26:02 -0800723
Dan Willemsen97ec8122020-02-19 18:06:54 -0800724$(foreach m,$(filter-out BUILD_COPY_HEADERS,$(DEFAULT_ERROR_BUILD_MODULE_TYPES)),\
Dan Willemsen695849e2019-04-17 12:25:09 -0700725 $(if $(filter true,$(BUILD_BROKEN_USES_$(m))),\
726 $(KATI_deprecated_var $(m),Please convert to Soong),\
727 $(KATI_obsolete_var $(m),Please convert to Soong)))