blob: 3cf521ab17c068e01686914945823ce603d5d50f [file] [log] [blame]
The Android Open Source Project88b60792009-03-03 19:28:42 -08001#
2# Copyright (C) 2007 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17#
18# Functions for including AndroidProducts.mk files
Ying Wang157a5e12012-09-27 13:26:25 -070019# PRODUCT_MAKEFILES is set up in AndroidProducts.mks.
20# Format of PRODUCT_MAKEFILES:
21# <product_name>:<path_to_the_product_makefile>
22# If the <product_name> is the same as the base file name (without dir
23# and the .mk suffix) of the product makefile, "<product_name>:" can be
24# omitted.
The Android Open Source Project88b60792009-03-03 19:28:42 -080025
26#
27# Returns the list of all AndroidProducts.mk files.
28# $(call ) isn't necessary.
29#
30define _find-android-products-files
Dan Willemsenb9d63512018-05-01 22:34:03 -070031$(file <$(OUT_DIR)/.module_paths/AndroidProducts.mk.list) \
The Android Open Source Project88b60792009-03-03 19:28:42 -080032 $(SRC_TARGET_DIR)/product/AndroidProducts.mk
33endef
34
35#
Dan Willemsenaf2e1f82018-04-04 15:41:41 -070036# For entries returned by get-product-makefiles, decode an entry to a short
37# product name. These either may be in the form of <name>:path/to/file.mk or
38# path/to/<name>.mk
39# $(1): The entry to decode
40#
41# Returns two words:
42# <name> <file>
43#
44define _decode-product-name
45$(strip \
46 $(eval _cpm_words := $(subst :,$(space),$(1))) \
47 $(if $(word 2,$(_cpm_words)), \
48 $(wordlist 1,2,$(_cpm_words)), \
49 $(basename $(notdir $(1))) $(1)))
50endef
51
52#
53# Validates the new common lunch choices -- ensures that they're in an
54# appropriate form, and are paired with definitions of their products.
55# $(1): The new list of COMMON_LUNCH_CHOICES
56# $(2): The new list of PRODUCT_MAKEFILES
57#
58define _validate-common-lunch-choices
59$(strip $(foreach choice,$(1),\
60 $(eval _parts := $(subst -,$(space),$(choice))) \
61 $(if $(call math_lt,$(words $(_parts)),2), \
62 $(error $(LOCAL_DIR): $(choice): Invalid lunch choice)) \
63 $(if $(call math_gt_or_eq,$(words $(_parts)),4), \
64 $(error $(LOCAL_DIR): $(choice): Invalid lunch choice)) \
65 $(if $(filter-out eng userdebug user,$(word 2,$(_parts))), \
66 $(error $(LOCAL_DIR): $(choice): Invalid variant: $(word 2,$(_parts)))) \
67 $(if $(filter-out $(foreach p,$(2),$(call _decode-product-name,$(p))),$(word 1,$(_parts))), \
68 $(error $(LOCAL_DIR): $(word 1,$(_parts)): Product not defined in this file)) \
69 ))
70endef
71
72#
Ying Wang1a031e42010-05-10 16:35:39 -070073# Returns the sorted concatenation of PRODUCT_MAKEFILES
74# variables set in the given AndroidProducts.mk files.
75# $(1): the list of AndroidProducts.mk files.
The Android Open Source Project88b60792009-03-03 19:28:42 -080076#
Dan Willemsenaf2e1f82018-04-04 15:41:41 -070077# As a side-effect, COMMON_LUNCH_CHOICES will be set to a
78# union of all of the COMMON_LUNCH_CHOICES definitions within
79# each AndroidProducts.mk file.
80#
Ying Wang1a031e42010-05-10 16:35:39 -070081define get-product-makefiles
The Android Open Source Project88b60792009-03-03 19:28:42 -080082$(sort \
Dan Willemsenaf2e1f82018-04-04 15:41:41 -070083 $(eval _COMMON_LUNCH_CHOICES :=) \
Ying Wang1a031e42010-05-10 16:35:39 -070084 $(foreach f,$(1), \
The Android Open Source Project88b60792009-03-03 19:28:42 -080085 $(eval PRODUCT_MAKEFILES :=) \
Dan Willemsenaf2e1f82018-04-04 15:41:41 -070086 $(eval COMMON_LUNCH_CHOICES :=) \
The Android Open Source Project88b60792009-03-03 19:28:42 -080087 $(eval LOCAL_DIR := $(patsubst %/,%,$(dir $(f)))) \
88 $(eval include $(f)) \
Dan Willemsenaf2e1f82018-04-04 15:41:41 -070089 $(call _validate-common-lunch-choices,$(COMMON_LUNCH_CHOICES),$(PRODUCT_MAKEFILES)) \
90 $(eval _COMMON_LUNCH_CHOICES += $(COMMON_LUNCH_CHOICES)) \
The Android Open Source Project88b60792009-03-03 19:28:42 -080091 $(PRODUCT_MAKEFILES) \
92 ) \
93 $(eval PRODUCT_MAKEFILES :=) \
94 $(eval LOCAL_DIR :=) \
Dan Willemsenaf2e1f82018-04-04 15:41:41 -070095 $(eval COMMON_LUNCH_CHOICES := $(sort $(_COMMON_LUNCH_CHOICES) $(LUNCH_MENU_CHOICES))) \
96 $(eval _COMMON_LUNCH_CHOICES :=) \
The Android Open Source Project88b60792009-03-03 19:28:42 -080097 )
98endef
99
100#
Ying Wang1a031e42010-05-10 16:35:39 -0700101# Returns the sorted concatenation of all PRODUCT_MAKEFILES
102# variables set in all AndroidProducts.mk files.
103# $(call ) isn't necessary.
104#
105define get-all-product-makefiles
106$(call get-product-makefiles,$(_find-android-products-files))
107endef
108
109#
The Android Open Source Project88b60792009-03-03 19:28:42 -0800110# Functions for including product makefiles
111#
112
113_product_var_list := \
114 PRODUCT_NAME \
115 PRODUCT_MODEL \
116 PRODUCT_LOCALES \
Ying Wang4f1ab922011-03-15 13:19:30 -0700117 PRODUCT_AAPT_CONFIG \
Dianne Hackborna0f464a2011-10-14 19:37:57 -0700118 PRODUCT_AAPT_PREF_CONFIG \
Ying Wang60686582014-12-10 12:40:09 -0800119 PRODUCT_AAPT_PREBUILT_DPI \
The Android Open Source Project88b60792009-03-03 19:28:42 -0800120 PRODUCT_PACKAGES \
Joe Onoratod7d0afc2012-06-05 15:54:09 -0700121 PRODUCT_PACKAGES_DEBUG \
Zach Riggle9323b7f2018-03-26 16:17:03 -0500122 PRODUCT_PACKAGES_DEBUG_ASAN \
Joe Onoratod7d0afc2012-06-05 15:54:09 -0700123 PRODUCT_PACKAGES_ENG \
124 PRODUCT_PACKAGES_TESTS \
The Android Open Source Project88b60792009-03-03 19:28:42 -0800125 PRODUCT_DEVICE \
126 PRODUCT_MANUFACTURER \
127 PRODUCT_BRAND \
128 PRODUCT_PROPERTY_OVERRIDES \
Mike Lockwood0d23fec2011-06-09 14:54:40 -0700129 PRODUCT_DEFAULT_PROPERTY_OVERRIDES \
Jaekyun Seokb7735d82017-11-27 17:04:47 +0900130 PRODUCT_PRODUCT_PROPERTIES \
Joe Onorato700b88e2010-10-05 17:33:58 -0400131 PRODUCT_CHARACTERISTICS \
The Android Open Source Project88b60792009-03-03 19:28:42 -0800132 PRODUCT_COPY_FILES \
133 PRODUCT_OTA_PUBLIC_KEYS \
Doug Zongker5d4808d2011-03-16 07:49:13 -0700134 PRODUCT_EXTRA_RECOVERY_KEYS \
The Android Open Source Project88b60792009-03-03 19:28:42 -0800135 PRODUCT_PACKAGE_OVERLAYS \
136 DEVICE_PACKAGE_OVERLAYS \
Jaekyun Seokccee95e2017-09-01 17:23:25 +0900137 PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS \
Jaekyun Seok1b224282017-03-30 11:25:02 +0900138 PRODUCT_ENFORCE_RRO_TARGETS \
Ying Wang780128a2014-01-29 13:35:55 -0800139 PRODUCT_SDK_ATREE_FILES \
Joe Onorato214a42b2009-04-09 20:36:06 -0700140 PRODUCT_SDK_ADDON_NAME \
141 PRODUCT_SDK_ADDON_COPY_FILES \
142 PRODUCT_SDK_ADDON_COPY_MODULES \
Ying Wanga032d3d2011-11-11 10:52:12 -0800143 PRODUCT_SDK_ADDON_DOC_MODULES \
Raphael Moll0d7d09a2014-08-21 15:22:08 -0700144 PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP \
Jeff Gaston1fe28d32017-11-21 15:05:07 -0800145 PRODUCT_SOONG_NAMESPACES \
Ying Wang3c21fe52011-10-04 10:50:08 -0700146 PRODUCT_DEFAULT_WIFI_CHANNELS \
147 PRODUCT_DEFAULT_DEV_CERTIFICATE \
Ying Wangdbb31be2011-12-09 15:11:57 -0800148 PRODUCT_RESTRICT_VENDOR_FILES \
Dima Zavinf9269902012-03-16 09:57:11 -0700149 PRODUCT_VENDOR_KERNEL_HEADERS \
Geremy Condrafd6f7512013-06-16 17:26:08 -0700150 PRODUCT_BOOT_JARS \
Sami Tolvanen8b3f08b2015-04-07 15:08:59 +0100151 PRODUCT_SUPPORTS_BOOT_SIGNER \
David Riley17be3d32015-03-03 08:54:11 -0800152 PRODUCT_SUPPORTS_VBOOT \
Geremy Condrafd6f7512013-06-16 17:26:08 -0700153 PRODUCT_SUPPORTS_VERITY \
Sami Tolvanenf99b5312015-05-20 07:30:57 +0100154 PRODUCT_SUPPORTS_VERITY_FEC \
Jeff Sharkey26d22f72014-03-18 17:20:10 -0700155 PRODUCT_OEM_PROPERTIES \
Jaekyun Seokb31b9ba2017-11-03 15:18:55 +0900156 PRODUCT_SYSTEM_DEFAULT_PROPERTIES \
Jeff Sharkey26d22f72014-03-18 17:20:10 -0700157 PRODUCT_SYSTEM_PROPERTY_BLACKLIST \
Ivan Podogovd5726322018-03-29 15:22:33 +0100158 PRODUCT_VENDOR_PROPERTY_BLACKLIST \
Nicolas Geoffrayb08ada12017-03-22 12:36:05 +0000159 PRODUCT_SYSTEM_SERVER_APPS \
Narayan Kamath89ec4962014-08-05 14:51:08 +0100160 PRODUCT_SYSTEM_SERVER_JARS \
Mathieu Chartier55eabd52017-09-15 13:40:48 -0700161 PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK \
Nicolas Geoffray4a0ad4a2017-06-12 15:19:16 +0100162 PRODUCT_DEXPREOPT_SPEED_APPS \
Nicolas Geoffraya95fbd12017-09-19 13:10:31 +0100163 PRODUCT_LOADED_BY_PRIVILEGED_MODULES \
David Riley17be3d32015-03-03 08:54:11 -0800164 PRODUCT_VBOOT_SIGNING_KEY \
Furquan Shaikhe8c21222015-08-07 11:58:05 -0700165 PRODUCT_VBOOT_SIGNING_SUBKEY \
Geremy Condra5b5f4952014-05-05 22:19:37 -0700166 PRODUCT_VERITY_SIGNING_KEY \
Daniel Rosenbergf4eabc32014-07-10 15:42:38 -0700167 PRODUCT_SYSTEM_VERITY_PARTITION \
Ying Wang87557562014-10-09 19:29:53 -0700168 PRODUCT_VENDOR_VERITY_PARTITION \
Jaekyun Seokb7735d82017-11-27 17:04:47 +0900169 PRODUCT_PRODUCT_VERITY_PARTITION \
Mathieu Chartierf0db9082017-06-23 14:47:56 -0700170 PRODUCT_SYSTEM_SERVER_DEBUG_INFO \
Andreas Gampec3e15192018-03-19 14:28:15 -0700171 PRODUCT_OTHER_JAVA_DEBUG_INFO \
Ying Wang20ebd2e2014-10-07 18:07:23 -0700172 PRODUCT_DEX_PREOPT_MODULE_CONFIGS \
Mathieu Chartiere8fb7cf2018-02-15 13:19:38 -0800173 PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER \
Ying Wang20ebd2e2014-10-07 18:07:23 -0700174 PRODUCT_DEX_PREOPT_DEFAULT_FLAGS \
175 PRODUCT_DEX_PREOPT_BOOT_FLAGS \
Mathieu Chartierfcc8d8b2017-05-05 17:22:37 -0700176 PRODUCT_DEX_PREOPT_PROFILE_DIR \
Mathieu Chartiera61acf62017-06-28 18:23:37 -0700177 PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION \
Mathieu Chartier5c658ac2018-02-15 13:19:38 -0800178 PRODUCT_DEX_PREOPT_GENERATE_DM_FILES \
Mathieu Chartiera61acf62017-06-28 18:23:37 -0700179 PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE \
Mathieu Chartier6228ec22017-06-23 10:44:45 -0700180 PRODUCT_SYSTEM_SERVER_COMPILER_FILTER \
Andreas Gampe6b30d772016-06-27 15:15:31 -0700181 PRODUCT_SANITIZER_MODULE_CONFIGS \
Mohamad Ayyash1868a602016-04-22 17:22:07 -0700182 PRODUCT_SYSTEM_BASE_FS_PATH \
183 PRODUCT_VENDOR_BASE_FS_PATH \
Jaekyun Seokb7735d82017-11-27 17:04:47 +0900184 PRODUCT_PRODUCT_BASE_FS_PATH \
Gustav Sennton81ee1862016-05-27 14:07:54 +0100185 PRODUCT_SHIPPING_API_LEVEL \
Hung-ying Tyan3c054d82016-05-20 19:08:30 +0800186 VENDOR_PRODUCT_RESTRICT_VENDOR_FILES \
187 VENDOR_EXCEPTION_MODULES \
188 VENDOR_EXCEPTION_PATHS \
Andreas Gampe831fc712017-06-30 11:36:26 -0700189 PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD \
Hiroshi Yamauchi64594c42016-12-15 16:00:41 -0800190 PRODUCT_ART_USE_READ_BARRIER \
Alex Deymo8fe63c32017-03-02 22:08:41 -0800191 PRODUCT_IOT \
Julius D'souza001c6762017-05-03 13:43:27 -0700192 PRODUCT_SYSTEM_HEADROOM \
Przemyslaw Szczepaniak2e81b3c2017-06-30 14:51:12 +0100193 PRODUCT_MINIMIZE_JAVA_DEBUG_INFO \
Ivan Lozano9a82bfd2017-07-13 14:49:12 -0700194 PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS \
Dan Willemsen0bd79382017-11-03 15:53:52 -0700195 PRODUCT_ADB_KEYS \
Vishwath Mohan23b2d2e2017-10-31 02:25:16 -0700196 PRODUCT_CFI_INCLUDE_PATHS \
197 PRODUCT_CFI_EXCLUDE_PATHS \
Jaekyun Seok0538ff72018-01-16 14:14:59 +0900198 PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE \
199 PRODUCT_ACTIONABLE_COMPATIBLE_PROPERTY_DISABLE \
Yifan Hongef4cd712018-05-18 17:46:04 -0700200 PRODUCT_USE_LOGICAL_PARTITIONS \
Ying Wang20ebd2e2014-10-07 18:07:23 -0700201
The Android Open Source Project88b60792009-03-03 19:28:42 -0800202define dump-product
203$(info ==== $(1) ====)\
204$(foreach v,$(_product_var_list),\
205$(info PRODUCTS.$(1).$(v) := $(PRODUCTS.$(1).$(v))))\
206$(info --------)
207endef
208
209define dump-products
210$(foreach p,$(PRODUCTS),$(call dump-product,$(p)))
211endef
212
213#
214# $(1): product to inherit
215#
Anton Hansson061cbcf2018-05-30 18:24:41 +0100216# To be called from product makefiles, and is later evaluated during the import-nodes
217# call below. It does three things:
The Android Open Source Project6a5f7f02009-03-05 14:34:30 -0800218# 1. Inherits all of the variables from $1.
219# 2. Records the inheritance in the .INHERITS_FROM variable
Anton Hansson061cbcf2018-05-30 18:24:41 +0100220# 3. Records the calling makefile in PARENT_PRODUCT_FILES
221#
222# (2) and (3) can be used together to reconstruct the include hierarchy
223# See e.g. product-graph.mk for an example of this.
The Android Open Source Project6a5f7f02009-03-05 14:34:30 -0800224#
The Android Open Source Project88b60792009-03-03 19:28:42 -0800225define inherit-product
Ying Wanga1742612015-10-28 14:33:40 -0700226 $(if $(findstring ../,$(1)),\
227 $(eval np := $(call normalize-paths,$(1))),\
228 $(eval np := $(strip $(1))))\
The Android Open Source Project88b60792009-03-03 19:28:42 -0800229 $(foreach v,$(_product_var_list), \
Ying Wanga1742612015-10-28 14:33:40 -0700230 $(eval $(v) := $($(v)) $(INHERIT_TAG)$(np))) \
Anton Hansson061cbcf2018-05-30 18:24:41 +0100231 $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
232 $(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \
Ying Wanga1742612015-10-28 14:33:40 -0700233 $(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \
Anton Hansson061cbcf2018-05-30 18:24:41 +0100234 $(eval PARENT_PRODUCT_FILES := $(sort $(PARENT_PRODUCT_FILES) $(current_mk)))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800235endef
236
Anton Hansson837425b2018-06-01 14:18:14 +0100237# Specifies a number of path prefixes, relative to PRODUCT_OUT, where the
238# product makefile hierarchy rooted in the current node places its artifacts.
239# Creating artifacts outside the specified paths will cause a build-time error.
240define require-artifacts-in-path
241 $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
242 $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENTS := $(strip $(1))) \
243 $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_WHITELIST := $(strip $(2))) \
244 $(eval ARTIFACT_PATH_REQUIREMENT_PRODUCTS := \
245 $(sort $(ARTIFACT_PATH_REQUIREMENT_PRODUCTS) $(current_mk)))
246endef
Joe Onorato28a846d2010-02-22 10:33:05 -0800247
248#
249# Do inherit-product only if $(1) exists
250#
251define inherit-product-if-exists
252 $(if $(wildcard $(1)),$(call inherit-product,$(1)),)
253endef
254
The Android Open Source Project88b60792009-03-03 19:28:42 -0800255#
256# $(1): product makefile list
257#
258#TODO: check to make sure that products have all the necessary vars defined
259define import-products
260$(call import-nodes,PRODUCTS,$(1),$(_product_var_list))
261endef
262
263
264#
265# Does various consistency checks on all of the known products.
266# Takes no parameters, so $(call ) is not necessary.
267#
268define check-all-products
269$(if ,, \
270 $(eval _cap_names :=) \
271 $(foreach p,$(PRODUCTS), \
272 $(eval pn := $(strip $(PRODUCTS.$(p).PRODUCT_NAME))) \
273 $(if $(pn),,$(error $(p): PRODUCT_NAME must be defined.)) \
274 $(if $(filter $(pn),$(_cap_names)), \
275 $(error $(p): PRODUCT_NAME must be unique; "$(pn)" already used by $(strip \
276 $(foreach \
277 pp,$(PRODUCTS),
278 $(if $(filter $(pn),$(PRODUCTS.$(pp).PRODUCT_NAME)), \
279 $(pp) \
280 ))) \
281 ) \
282 ) \
283 $(eval _cap_names += $(pn)) \
284 $(if $(call is-c-identifier,$(pn)),, \
285 $(error $(p): PRODUCT_NAME must be a valid C identifier, not "$(pn)") \
286 ) \
287 $(eval pb := $(strip $(PRODUCTS.$(p).PRODUCT_BRAND))) \
288 $(if $(pb),,$(error $(p): PRODUCT_BRAND must be defined.)) \
289 $(foreach cf,$(strip $(PRODUCTS.$(p).PRODUCT_COPY_FILES)), \
Ying Wang4b0486b2012-09-20 16:35:36 -0700290 $(if $(filter 2 3,$(words $(subst :,$(space),$(cf)))),, \
The Android Open Source Project88b60792009-03-03 19:28:42 -0800291 $(error $(p): malformed COPY_FILE "$(cf)") \
292 ) \
293 ) \
294 ) \
295)
296endef
297
298
299#
300# Returns the product makefile path for the product with the provided name
301#
302# $(1): short product name like "generic"
303#
304define _resolve-short-product-name
305 $(eval pn := $(strip $(1)))
306 $(eval p := \
307 $(foreach p,$(PRODUCTS), \
308 $(if $(filter $(pn),$(PRODUCTS.$(p).PRODUCT_NAME)), \
309 $(p) \
310 )) \
311 )
312 $(eval p := $(sort $(p)))
313 $(if $(filter 1,$(words $(p))), \
314 $(p), \
315 $(if $(filter 0,$(words $(p))), \
316 $(error No matches for product "$(pn)"), \
317 $(error Product "$(pn)" ambiguous: matches $(p)) \
318 ) \
319 )
320endef
321define resolve-short-product-name
322$(strip $(call _resolve-short-product-name,$(1)))
323endef
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400324
325
Ying Wangf9953b42010-12-29 14:07:38 -0800326_product_stash_var_list := $(_product_var_list) \
Ying Wang0650d152013-07-23 17:57:38 -0700327 PRODUCT_BOOTCLASSPATH \
Narayan Kamath89ec4962014-08-05 14:51:08 +0100328 PRODUCT_SYSTEM_SERVER_CLASSPATH \
Ying Wangf9953b42010-12-29 14:07:38 -0800329 TARGET_ARCH \
330 TARGET_ARCH_VARIANT \
Ben Cheng7028f5e2013-01-15 14:36:42 -0800331 TARGET_CPU_VARIANT \
Ying Wangf9953b42010-12-29 14:07:38 -0800332 TARGET_BOARD_PLATFORM \
333 TARGET_BOARD_PLATFORM_GPU \
Dima Zavinf9269902012-03-16 09:57:11 -0700334 TARGET_BOARD_KERNEL_HEADERS \
335 TARGET_DEVICE_KERNEL_HEADERS \
336 TARGET_PRODUCT_KERNEL_HEADERS \
Ying Wangf9953b42010-12-29 14:07:38 -0800337 TARGET_BOOTLOADER_BOARD_NAME \
Ying Wangf9953b42010-12-29 14:07:38 -0800338 TARGET_NO_BOOTLOADER \
339 TARGET_NO_KERNEL \
340 TARGET_NO_RECOVERY \
341 TARGET_NO_RADIOIMAGE \
342 TARGET_HARDWARE_3D \
Ying Wangf9953b42010-12-29 14:07:38 -0800343 TARGET_CPU_ABI \
344 TARGET_CPU_ABI2 \
Ying Wangf9953b42010-12-29 14:07:38 -0800345
346
347_product_stash_var_list += \
348 BOARD_WPA_SUPPLICANT_DRIVER \
349 BOARD_WLAN_DEVICE \
350 BOARD_USES_GENERIC_AUDIO \
351 BOARD_KERNEL_CMDLINE \
352 BOARD_KERNEL_BASE \
353 BOARD_HAVE_BLUETOOTH \
Ying Wangf9953b42010-12-29 14:07:38 -0800354 BOARD_VENDOR_USE_AKMD \
355 BOARD_EGL_CFG \
356 BOARD_BOOTIMAGE_PARTITION_SIZE \
357 BOARD_RECOVERYIMAGE_PARTITION_SIZE \
358 BOARD_SYSTEMIMAGE_PARTITION_SIZE \
Mohamad Ayyash68946952015-03-03 12:30:37 -0800359 BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE \
JP Abgrall5bfed5a2014-06-16 14:17:40 -0700360 BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE \
Ying Wangf9953b42010-12-29 14:07:38 -0800361 BOARD_USERDATAIMAGE_PARTITION_SIZE \
Ying Wang9f8e8db2011-11-04 11:37:01 -0700362 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE \
363 BOARD_CACHEIMAGE_PARTITION_SIZE \
Ying Wangf9953b42010-12-29 14:07:38 -0800364 BOARD_FLASH_BLOCK_SIZE \
Daniel Rosenbergdde31842014-05-28 13:51:53 -0700365 BOARD_VENDORIMAGE_PARTITION_SIZE \
366 BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE \
Jaekyun Seokb7735d82017-11-27 17:04:47 +0900367 BOARD_PRODUCTIMAGE_PARTITION_SIZE \
368 BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE \
Ying Wangf9953b42010-12-29 14:07:38 -0800369 BOARD_INSTALLER_CMDLINE \
370
371
Ying Wang3c21fe52011-10-04 10:50:08 -0700372_product_stash_var_list += \
Ying Wang9c440212014-05-01 20:55:30 -0700373 DEFAULT_SYSTEM_DEV_CERTIFICATE \
Alex Light7326f7b2014-08-04 17:09:41 -0700374 WITH_DEXPREOPT \
Mathieu Chartier25942302018-03-06 13:09:01 -0800375 WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY
Ying Wang3c21fe52011-10-04 10:50:08 -0700376
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400377#
Dan Willemsenc1f17ff2016-10-05 16:57:27 -0700378# Mark the variables in _product_stash_var_list as readonly
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400379#
Dan Willemsenc1f17ff2016-10-05 16:57:27 -0700380define readonly-product-vars
Ying Wangf9953b42010-12-29 14:07:38 -0800381$(foreach v,$(_product_stash_var_list), \
Dan Willemsenc1f17ff2016-10-05 16:57:27 -0700382 $(eval $(v) ?=) \
383 $(eval .KATI_READONLY := $(v)) \
Joe Onorato8dc8faa2010-09-14 13:09:48 -0400384 )
385endef
386
Keun young Parkc41c5f42012-05-30 10:22:29 -0700387define add-to-product-copy-files-if-exists
388$(if $(wildcard $(word 1,$(subst :, ,$(1)))),$(1))
389endef
Ying Wang20ebd2e2014-10-07 18:07:23 -0700390
391# whitespace placeholder when we record module's dex-preopt config.
392_PDPMC_SP_PLACE_HOLDER := |@SP@|
393# Set up dex-preopt config for a module.
394# $(1) list of module names
395# $(2) the modules' dex-preopt config
396define add-product-dex-preopt-module-config
397$(eval _c := $(subst $(space),$(_PDPMC_SP_PLACE_HOLDER),$(strip $(2))))\
398$(eval PRODUCT_DEX_PREOPT_MODULE_CONFIGS += \
399 $(foreach m,$(1),$(m)=$(_c)))
400endef
Andreas Gampe6b30d772016-06-27 15:15:31 -0700401
402# whitespace placeholder when we record module's sanitizer config.
403_PSMC_SP_PLACE_HOLDER := |@SP@|
404# Set up sanitizer config for a module.
405# $(1) list of module names
406# $(2) the modules' sanitizer config
407define add-product-sanitizer-module-config
408$(eval _c := $(subst $(space),$(_PSMC_SP_PLACE_HOLDER),$(strip $(2))))\
409$(eval PRODUCT_SANITIZER_MODULE_CONFIGS += \
410 $(foreach m,$(1),$(m)=$(_c)))
411endef