The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | # |
| 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 Wang | 157a5e1 | 2012-09-27 13:26:25 -0700 | [diff] [blame] | 19 | # 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 Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 25 | |
| 26 | # |
| 27 | # Returns the list of all AndroidProducts.mk files. |
| 28 | # $(call ) isn't necessary. |
| 29 | # |
| 30 | define _find-android-products-files |
Dan Willemsen | b9d6351 | 2018-05-01 22:34:03 -0700 | [diff] [blame] | 31 | $(file <$(OUT_DIR)/.module_paths/AndroidProducts.mk.list) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 32 | $(SRC_TARGET_DIR)/product/AndroidProducts.mk |
| 33 | endef |
| 34 | |
| 35 | # |
Dan Willemsen | af2e1f8 | 2018-04-04 15:41:41 -0700 | [diff] [blame] | 36 | # 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 | # |
| 44 | define _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))) |
| 50 | endef |
| 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 | # |
| 58 | define _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 | )) |
| 70 | endef |
| 71 | |
| 72 | # |
Ying Wang | 1a031e4 | 2010-05-10 16:35:39 -0700 | [diff] [blame] | 73 | # 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 Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 76 | # |
Dan Willemsen | af2e1f8 | 2018-04-04 15:41:41 -0700 | [diff] [blame] | 77 | # 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 Wang | 1a031e4 | 2010-05-10 16:35:39 -0700 | [diff] [blame] | 81 | define get-product-makefiles |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 82 | $(sort \ |
Dan Willemsen | af2e1f8 | 2018-04-04 15:41:41 -0700 | [diff] [blame] | 83 | $(eval _COMMON_LUNCH_CHOICES :=) \ |
Ying Wang | 1a031e4 | 2010-05-10 16:35:39 -0700 | [diff] [blame] | 84 | $(foreach f,$(1), \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 85 | $(eval PRODUCT_MAKEFILES :=) \ |
Dan Willemsen | af2e1f8 | 2018-04-04 15:41:41 -0700 | [diff] [blame] | 86 | $(eval COMMON_LUNCH_CHOICES :=) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 87 | $(eval LOCAL_DIR := $(patsubst %/,%,$(dir $(f)))) \ |
| 88 | $(eval include $(f)) \ |
Dan Willemsen | af2e1f8 | 2018-04-04 15:41:41 -0700 | [diff] [blame] | 89 | $(call _validate-common-lunch-choices,$(COMMON_LUNCH_CHOICES),$(PRODUCT_MAKEFILES)) \ |
| 90 | $(eval _COMMON_LUNCH_CHOICES += $(COMMON_LUNCH_CHOICES)) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 91 | $(PRODUCT_MAKEFILES) \ |
| 92 | ) \ |
| 93 | $(eval PRODUCT_MAKEFILES :=) \ |
| 94 | $(eval LOCAL_DIR :=) \ |
Dan Willemsen | 5436c7e | 2019-02-11 21:31:47 -0800 | [diff] [blame] | 95 | $(eval COMMON_LUNCH_CHOICES := $(sort $(_COMMON_LUNCH_CHOICES))) \ |
Dan Willemsen | af2e1f8 | 2018-04-04 15:41:41 -0700 | [diff] [blame] | 96 | $(eval _COMMON_LUNCH_CHOICES :=) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 97 | ) |
| 98 | endef |
| 99 | |
| 100 | # |
Ying Wang | 1a031e4 | 2010-05-10 16:35:39 -0700 | [diff] [blame] | 101 | # Returns the sorted concatenation of all PRODUCT_MAKEFILES |
| 102 | # variables set in all AndroidProducts.mk files. |
| 103 | # $(call ) isn't necessary. |
| 104 | # |
| 105 | define get-all-product-makefiles |
| 106 | $(call get-product-makefiles,$(_find-android-products-files)) |
| 107 | endef |
| 108 | |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 109 | # Variables that are meant to hold only a single value. |
| 110 | # - The value set in the current makefile takes precedence over inherited values |
| 111 | # - If multiple inherited makefiles set the var, the first-inherited value wins |
| 112 | _product_single_value_vars := |
| 113 | |
| 114 | # Variables that are lists of values. |
| 115 | _product_list_vars := |
| 116 | |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 117 | _product_single_value_vars += PRODUCT_NAME |
| 118 | _product_single_value_vars += PRODUCT_MODEL |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 119 | |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 120 | # The resoure configuration options to use for this product. |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 121 | _product_list_vars += PRODUCT_LOCALES |
| 122 | _product_list_vars += PRODUCT_AAPT_CONFIG |
Sasha Smundak | 0301d64 | 2020-11-11 14:41:08 -0800 | [diff] [blame] | 123 | _product_single_value_vars += PRODUCT_AAPT_PREF_CONFIG |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 124 | _product_list_vars += PRODUCT_AAPT_PREBUILT_DPI |
| 125 | _product_list_vars += PRODUCT_HOST_PACKAGES |
| 126 | _product_list_vars += PRODUCT_PACKAGES |
| 127 | _product_list_vars += PRODUCT_PACKAGES_DEBUG |
| 128 | _product_list_vars += PRODUCT_PACKAGES_DEBUG_ASAN |
Kavi Gupta | 7185f8c | 2019-06-11 10:27:47 -0700 | [diff] [blame] | 129 | # Packages included only for eng/userdebug builds, when building with EMMA_INSTRUMENT=true |
| 130 | _product_list_vars += PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 131 | _product_list_vars += PRODUCT_PACKAGES_ENG |
| 132 | _product_list_vars += PRODUCT_PACKAGES_TESTS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 133 | |
| 134 | # The device that this product maps to. |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 135 | _product_single_value_vars += PRODUCT_DEVICE |
| 136 | _product_single_value_vars += PRODUCT_MANUFACTURER |
| 137 | _product_single_value_vars += PRODUCT_BRAND |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 138 | |
| 139 | # These PRODUCT_SYSTEM_* flags, if defined, are used in place of the |
| 140 | # corresponding PRODUCT_* flags for the sysprops on /system. |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 141 | _product_single_value_vars += \ |
Anton Hansson | ee4c970 | 2018-12-21 15:36:00 +0000 | [diff] [blame] | 142 | PRODUCT_SYSTEM_NAME \ |
| 143 | PRODUCT_SYSTEM_MODEL \ |
| 144 | PRODUCT_SYSTEM_DEVICE \ |
| 145 | PRODUCT_SYSTEM_BRAND \ |
| 146 | PRODUCT_SYSTEM_MANUFACTURER \ |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 147 | |
Jiyong Park | eb49b34 | 2020-05-29 17:50:03 +0900 | [diff] [blame] | 148 | # PRODUCT_<PARTITION>_PROPERTIES are lists of property assignments |
| 149 | # that go to <partition>/build.prop. Each property assignment is |
| 150 | # "key = value" with zero or more whitespace characters on either |
| 151 | # side of the '='. |
| 152 | _product_list_vars += \ |
| 153 | PRODUCT_SYSTEM_PROPERTIES \ |
| 154 | PRODUCT_SYSTEM_EXT_PROPERTIES \ |
| 155 | PRODUCT_VENDOR_PROPERTIES \ |
| 156 | PRODUCT_ODM_PROPERTIES \ |
| 157 | PRODUCT_PRODUCT_PROPERTIES |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 158 | |
Jiyong Park | eb49b34 | 2020-05-29 17:50:03 +0900 | [diff] [blame] | 159 | # TODO(b/117892318) deprecate these: |
| 160 | # ... in favor or PRODUCT_SYSTEM_PROPERTIES |
| 161 | _product_list_vars += PRODUCT_SYSTEM_DEFAULT_PROPERTIES |
| 162 | # ... in favor of PRODUCT_VENDOR_PROPERTIES |
| 163 | _product_list_vars += PRODUCT_PROPERTY_OVERRIDES |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 164 | _product_list_vars += PRODUCT_DEFAULT_PROPERTY_OVERRIDES |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 165 | |
Jiyong Park | eb49b34 | 2020-05-29 17:50:03 +0900 | [diff] [blame] | 166 | # TODO(b/117892318) consider deprecating these too |
| 167 | _product_list_vars += PRODUCT_SYSTEM_PROPERTY_BLACKLIST |
| 168 | _product_list_vars += PRODUCT_VENDOR_PROPERTY_BLACKLIST |
Anton Hansson | 879b007 | 2019-05-13 18:06:45 +0100 | [diff] [blame] | 169 | |
| 170 | # The characteristics of the product, which among other things is passed to aapt |
| 171 | _product_single_value_vars += PRODUCT_CHARACTERISTICS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 172 | |
| 173 | # A list of words like <source path>:<destination path>[:<owner>]. |
| 174 | # The file at the source path should be copied to the destination path |
| 175 | # when building this product. <destination path> is relative to |
| 176 | # $(PRODUCT_OUT), so it should look like, e.g., "system/etc/file.xml". |
| 177 | # The rules for these copy steps are defined in build/make/core/Makefile. |
| 178 | # The optional :<owner> is used to indicate the owner of a vendor file. |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 179 | _product_list_vars += PRODUCT_COPY_FILES |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 180 | |
| 181 | # The OTA key(s) specified by the product config, if any. The names |
| 182 | # of these keys are stored in the target-files zip so that post-build |
| 183 | # signing tools can substitute them for the test key embedded by |
| 184 | # default. |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 185 | _product_list_vars += PRODUCT_OTA_PUBLIC_KEYS |
| 186 | _product_list_vars += PRODUCT_EXTRA_RECOVERY_KEYS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 187 | |
| 188 | # Should we use the default resources or add any product specific overlays |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 189 | _product_list_vars += PRODUCT_PACKAGE_OVERLAYS |
| 190 | _product_list_vars += DEVICE_PACKAGE_OVERLAYS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 191 | |
| 192 | # Resource overlay list which must be excluded from enforcing RRO. |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 193 | _product_list_vars += PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 194 | |
| 195 | # Package list to apply enforcing RRO. |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 196 | _product_list_vars += PRODUCT_ENFORCE_RRO_TARGETS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 197 | |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 198 | _product_list_vars += PRODUCT_SDK_ATREE_FILES |
| 199 | _product_list_vars += PRODUCT_SDK_ADDON_NAME |
| 200 | _product_list_vars += PRODUCT_SDK_ADDON_COPY_FILES |
| 201 | _product_list_vars += PRODUCT_SDK_ADDON_COPY_MODULES |
| 202 | _product_list_vars += PRODUCT_SDK_ADDON_DOC_MODULES |
| 203 | _product_list_vars += PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 204 | |
| 205 | # which Soong namespaces to export to Make |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 206 | _product_list_vars += PRODUCT_SOONG_NAMESPACES |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 207 | |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 208 | _product_list_vars += PRODUCT_DEFAULT_WIFI_CHANNELS |
Sasha Smundak | 0301d64 | 2020-11-11 14:41:08 -0800 | [diff] [blame] | 209 | _product_single_value_vars += PRODUCT_DEFAULT_DEV_CERTIFICATE |
Remi NGUYEN VAN | 87d0f27 | 2019-08-07 18:13:33 +0900 | [diff] [blame] | 210 | _product_list_vars += PRODUCT_MAINLINE_SEPOLICY_DEV_CERTIFICATES |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 211 | _product_list_vars += PRODUCT_RESTRICT_VENDOR_FILES |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 212 | |
| 213 | # The list of product-specific kernel header dirs |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 214 | _product_list_vars += PRODUCT_VENDOR_KERNEL_HEADERS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 215 | |
Martin Stjernholm | 743513c | 2021-07-05 20:53:57 +0100 | [diff] [blame] | 216 | # A list of module names in BOOTCLASSPATH (jar files). Each module may be |
| 217 | # prefixed with "<apex>:", which identifies the APEX that provides it. APEXes |
| 218 | # are identified by their "variant" names, i.e. their `apex_name` values in |
| 219 | # Soong, which default to the `name` values. The prefix can also be "platform:" |
| 220 | # or "system_ext:", and defaults to "platform:" if left out. See the long |
| 221 | # comment in build/soong/java/dexprepopt_bootjars.go for details. |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 222 | _product_list_vars += PRODUCT_BOOT_JARS |
Po Hu | 012118d | 2020-03-13 14:14:27 +0800 | [diff] [blame] | 223 | |
Martin Stjernholm | 743513c | 2021-07-05 20:53:57 +0100 | [diff] [blame] | 224 | # A list of extra BOOTCLASSPATH jars (to be appended after common jars), |
| 225 | # following the same format as PRODUCT_BOOT_JARS. Products that include |
| 226 | # device-specific makefiles before AOSP makefiles should use this instead of |
| 227 | # PRODUCT_BOOT_JARS, so that device-specific jars go after common jars. |
Po Hu | 012118d | 2020-03-13 14:14:27 +0800 | [diff] [blame] | 228 | _product_list_vars += PRODUCT_BOOT_JARS_EXTRA |
| 229 | |
Sasha Smundak | 94da140 | 2021-02-10 22:27:36 -0800 | [diff] [blame] | 230 | _product_single_value_vars += PRODUCT_SUPPORTS_BOOT_SIGNER |
| 231 | _product_single_value_vars += PRODUCT_SUPPORTS_VBOOT |
| 232 | _product_single_value_vars += PRODUCT_SUPPORTS_VERITY |
| 233 | _product_single_value_vars += PRODUCT_SUPPORTS_VERITY_FEC |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 234 | _product_list_vars += PRODUCT_SYSTEM_SERVER_APPS |
Jiakai Zhang | 44ffb21 | 2021-10-28 14:37:20 +0000 | [diff] [blame^] | 235 | # List of system_server classpath jars on the platform. |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 236 | _product_list_vars += PRODUCT_SYSTEM_SERVER_JARS |
Jiakai Zhang | 44ffb21 | 2021-10-28 14:37:20 +0000 | [diff] [blame^] | 237 | # List of system_server classpath jars delivered via apex. Format = <apex name>:<jar name>. |
satayev | a85d522 | 2021-07-27 12:32:40 +0100 | [diff] [blame] | 238 | _product_list_vars += PRODUCT_APEX_SYSTEM_SERVER_JARS |
Jiakai Zhang | 44ffb21 | 2021-10-28 14:37:20 +0000 | [diff] [blame^] | 239 | # List of jars on the platform that system_server loads dynamically using separate classloaders. |
| 240 | _product_list_vars += PRODUCT_STANDALONE_SYSTEM_SERVER_JARS |
| 241 | # List of jars delivered via apex that system_server loads dynamically using separate classloaders. |
| 242 | # Format = <apex name>:<jar name> |
| 243 | _product_list_vars += PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS |
Ulya Trafimovich | 40e55c2 | 2020-03-27 12:12:59 +0000 | [diff] [blame] | 244 | # If true, then suboptimal order of system server jars does not cause an error. |
Sasha Smundak | 0301d64 | 2020-11-11 14:41:08 -0800 | [diff] [blame] | 245 | _product_single_value_vars += PRODUCT_BROKEN_SUBOPTIMAL_ORDER_OF_SYSTEM_SERVER_JARS |
Ulya Trafimovich | 7693ec7 | 2021-10-26 12:50:27 +0100 | [diff] [blame] | 246 | # If true, then system server jars defined in Android.mk are supported. |
| 247 | _product_single_value_vars += PRODUCT_BROKEN_DEPRECATED_MK_SYSTEM_SERVER_JARS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 248 | |
Rock.Yeh | 2a703ce | 2020-04-22 17:01:10 +0800 | [diff] [blame] | 249 | # Additional system server jars to be appended at the end of the common list. |
| 250 | # This is necessary to avoid jars reordering due to makefile inheritance order. |
| 251 | _product_list_vars += PRODUCT_SYSTEM_SERVER_JARS_EXTRA |
| 252 | |
Ulya Trafimovich | 1a3b145 | 2021-03-22 17:24:18 +0000 | [diff] [blame] | 253 | # Set to true to disable <uses-library> checks for a product. |
| 254 | _product_list_vars += PRODUCT_BROKEN_VERIFY_USES_LIBRARIES |
| 255 | |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 256 | # All of the apps that we force preopt, this overrides WITH_DEXPREOPT. |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 257 | _product_list_vars += PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK |
| 258 | _product_list_vars += PRODUCT_DEXPREOPT_SPEED_APPS |
| 259 | _product_list_vars += PRODUCT_LOADED_BY_PRIVILEGED_MODULES |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 260 | _product_single_value_vars += PRODUCT_VBOOT_SIGNING_KEY |
| 261 | _product_single_value_vars += PRODUCT_VBOOT_SIGNING_SUBKEY |
| 262 | _product_single_value_vars += PRODUCT_VERITY_SIGNING_KEY |
| 263 | _product_single_value_vars += PRODUCT_SYSTEM_VERITY_PARTITION |
| 264 | _product_single_value_vars += PRODUCT_VENDOR_VERITY_PARTITION |
| 265 | _product_single_value_vars += PRODUCT_PRODUCT_VERITY_PARTITION |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 266 | _product_single_value_vars += PRODUCT_SYSTEM_EXT_VERITY_PARTITION |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 267 | _product_single_value_vars += PRODUCT_ODM_VERITY_PARTITION |
Yifan Hong | cfb917a | 2020-05-07 14:58:20 -0700 | [diff] [blame] | 268 | _product_single_value_vars += PRODUCT_VENDOR_DLKM_VERITY_PARTITION |
Yifan Hong | f496f1b | 2020-07-15 16:52:59 -0700 | [diff] [blame] | 269 | _product_single_value_vars += PRODUCT_ODM_DLKM_VERITY_PARTITION |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 270 | _product_single_value_vars += PRODUCT_SYSTEM_SERVER_DEBUG_INFO |
| 271 | _product_single_value_vars += PRODUCT_OTHER_JAVA_DEBUG_INFO |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 272 | |
| 273 | # Per-module dex-preopt configs. |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 274 | _product_list_vars += PRODUCT_DEX_PREOPT_MODULE_CONFIGS |
Sasha Smundak | 0301d64 | 2020-11-11 14:41:08 -0800 | [diff] [blame] | 275 | _product_single_value_vars += PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 276 | _product_list_vars += PRODUCT_DEX_PREOPT_DEFAULT_FLAGS |
Sasha Smundak | 0301d64 | 2020-11-11 14:41:08 -0800 | [diff] [blame] | 277 | _product_single_value_vars += PRODUCT_DEX_PREOPT_BOOT_FLAGS |
| 278 | _product_single_value_vars += PRODUCT_DEX_PREOPT_PROFILE_DIR |
| 279 | _product_single_value_vars += PRODUCT_DEX_PREOPT_GENERATE_DM_FILES |
| 280 | _product_single_value_vars += PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING |
| 281 | _product_single_value_vars += PRODUCT_DEX_PREOPT_RESOLVE_STARTUP_STRINGS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 282 | |
| 283 | # Boot image options. |
Martin Stjernholm | 91964c8 | 2021-11-05 18:00:22 +0000 | [diff] [blame] | 284 | _product_list_vars += PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 285 | _product_single_value_vars += \ |
Howard Chen | 95339b0 | 2021-09-29 17:28:48 +0800 | [diff] [blame] | 286 | PRODUCT_EXPORT_BOOT_IMAGE_TO_DIST \ |
Mathieu Chartier | a61acf6 | 2017-06-28 18:23:37 -0700 | [diff] [blame] | 287 | PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE \ |
Calin Juravle | cdff6b1 | 2019-05-01 15:34:47 -0700 | [diff] [blame] | 288 | PRODUCT_USES_DEFAULT_ART_CONFIG \ |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 289 | |
Sasha Smundak | 0301d64 | 2020-11-11 14:41:08 -0800 | [diff] [blame] | 290 | _product_single_value_vars += PRODUCT_SYSTEM_SERVER_COMPILER_FILTER |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 291 | # Per-module sanitizer configs |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 292 | _product_list_vars += PRODUCT_SANITIZER_MODULE_CONFIGS |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 293 | _product_single_value_vars += PRODUCT_SYSTEM_BASE_FS_PATH |
| 294 | _product_single_value_vars += PRODUCT_VENDOR_BASE_FS_PATH |
| 295 | _product_single_value_vars += PRODUCT_PRODUCT_BASE_FS_PATH |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 296 | _product_single_value_vars += PRODUCT_SYSTEM_EXT_BASE_FS_PATH |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 297 | _product_single_value_vars += PRODUCT_ODM_BASE_FS_PATH |
Yifan Hong | cfb917a | 2020-05-07 14:58:20 -0700 | [diff] [blame] | 298 | _product_single_value_vars += PRODUCT_VENDOR_DLKM_BASE_FS_PATH |
Yifan Hong | f496f1b | 2020-07-15 16:52:59 -0700 | [diff] [blame] | 299 | _product_single_value_vars += PRODUCT_ODM_DLKM_BASE_FS_PATH |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 300 | |
| 301 | # The first API level this product shipped with |
| 302 | _product_single_value_vars += PRODUCT_SHIPPING_API_LEVEL |
| 303 | |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 304 | _product_list_vars += VENDOR_PRODUCT_RESTRICT_VENDOR_FILES |
| 305 | _product_list_vars += VENDOR_EXCEPTION_MODULES |
| 306 | _product_list_vars += VENDOR_EXCEPTION_PATHS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 307 | # Whether the product wants to ship libartd. For rules and meaning, see art/Android.mk. |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 308 | _product_single_value_vars += PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 309 | |
| 310 | # Make this art variable visible to soong_config.mk. |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 311 | _product_single_value_vars += PRODUCT_ART_USE_READ_BARRIER |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 312 | |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 313 | # Add reserved headroom to a system image. |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 314 | _product_single_value_vars += PRODUCT_SYSTEM_HEADROOM |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 315 | |
| 316 | # Whether to save disk space by minimizing java debug info |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 317 | _product_single_value_vars += PRODUCT_MINIMIZE_JAVA_DEBUG_INFO |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 318 | |
| 319 | # Whether any paths are excluded from sanitization when SANITIZE_TARGET=integer_overflow |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 320 | _product_list_vars += PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 321 | |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 322 | _product_single_value_vars += PRODUCT_ADB_KEYS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 323 | |
| 324 | # Whether any paths should have CFI enabled for components |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 325 | _product_list_vars += PRODUCT_CFI_INCLUDE_PATHS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 326 | |
| 327 | # Whether any paths are excluded from sanitization when SANITIZE_TARGET=cfi |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 328 | _product_list_vars += PRODUCT_CFI_EXCLUDE_PATHS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 329 | |
| 330 | # Whether the Scudo hardened allocator is disabled platform-wide |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 331 | _product_single_value_vars += PRODUCT_DISABLE_SCUDO |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 332 | |
Isaac Chen | e972350 | 2019-05-06 16:55:48 +0800 | [diff] [blame] | 333 | # List of extra VNDK versions to be included |
| 334 | _product_list_vars += PRODUCT_EXTRA_VNDK_VERSIONS |
| 335 | |
Mohammad Samiul Islam | c87781a | 2020-11-25 16:00:38 +0000 | [diff] [blame] | 336 | # Whether APEX should be compressed or not |
| 337 | _product_single_value_vars += PRODUCT_COMPRESSED_APEX |
| 338 | |
Justin Yun | f19d840 | 2019-11-18 19:43:41 +0900 | [diff] [blame] | 339 | # VNDK version of product partition. It can be 'current' if the product |
| 340 | # partitions uses PLATFORM_VNDK_VERSION. |
GeQi | 6e44e3d | 2020-09-04 13:44:09 +0800 | [diff] [blame] | 341 | _product_single_value_vars += PRODUCT_PRODUCT_VNDK_VERSION |
Justin Yun | f19d840 | 2019-11-18 19:43:41 +0900 | [diff] [blame] | 342 | |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 343 | _product_single_value_vars += PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS |
| 344 | _product_single_value_vars += PRODUCT_ENFORCE_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT |
Colin Cross | c3ad804 | 2020-06-11 11:25:05 -0700 | [diff] [blame] | 345 | _product_list_vars += PRODUCT_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT_ALLOW_LIST |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 346 | _product_list_vars += PRODUCT_ARTIFACT_PATH_REQUIREMENT_HINT |
Colin Cross | c3ad804 | 2020-06-11 11:25:05 -0700 | [diff] [blame] | 347 | _product_list_vars += PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 348 | |
| 349 | # List of modules that should be forcefully unmarked from being LOCAL_PRODUCT_MODULE, and hence |
| 350 | # installed on /system directory by default. |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 351 | _product_list_vars += PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 352 | |
| 353 | # When this is true, dynamic partitions is retrofitted on a device that has |
| 354 | # already been launched without dynamic partitions. Otherwise, the device |
| 355 | # is launched with dynamic partitions. |
| 356 | # This flag implies PRODUCT_USE_DYNAMIC_PARTITIONS. |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 357 | _product_single_value_vars += PRODUCT_RETROFIT_DYNAMIC_PARTITIONS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 358 | |
Hridya Valsaraju | b39ec70 | 2021-03-31 21:28:02 -0700 | [diff] [blame] | 359 | # When this is true, various build time as well as runtime debugfs restrictions are enabled. |
| 360 | _product_single_value_vars += PRODUCT_SET_DEBUGFS_RESTRICTIONS |
| 361 | |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 362 | # Other dynamic partition feature flags.PRODUCT_USE_DYNAMIC_PARTITION_SIZE and |
| 363 | # PRODUCT_BUILD_SUPER_PARTITION default to the value of PRODUCT_USE_DYNAMIC_PARTITIONS. |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 364 | _product_single_value_vars += \ |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 365 | PRODUCT_USE_DYNAMIC_PARTITIONS \ |
Yifan Hong | 2dae572 | 2018-07-31 12:47:27 -0700 | [diff] [blame] | 366 | PRODUCT_USE_DYNAMIC_PARTITION_SIZE \ |
| 367 | PRODUCT_BUILD_SUPER_PARTITION \ |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 368 | |
| 369 | # If set, kernel configuration requirements are present in OTA package (and will be enforced |
| 370 | # during OTA). Otherwise, kernel configuration requirements are enforced in VTS. |
| 371 | # Devices that checks the running kernel (instead of the kernel in OTA package) should not |
| 372 | # set this variable to prevent OTA failures. |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 373 | _product_list_vars += PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 374 | |
Tao Bao | 9be20c7 | 2019-04-08 21:11:59 -0700 | [diff] [blame] | 375 | # If set to true, this product builds a generic OTA package, which installs generic system images |
| 376 | # onto matching devices. The product may only build a subset of system images (e.g. only |
| 377 | # system.img), so devices need to install the package in a system-only OTA manner. |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 378 | _product_single_value_vars += PRODUCT_BUILD_GENERIC_OTA_PACKAGE |
Tao Bao | 9be20c7 | 2019-04-08 21:11:59 -0700 | [diff] [blame] | 379 | |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 380 | _product_list_vars += PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES |
| 381 | _product_list_vars += PRODUCT_PACKAGE_NAME_OVERRIDES |
| 382 | _product_list_vars += PRODUCT_CERTIFICATE_OVERRIDES |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 383 | |
| 384 | # Controls for whether different partitions are built for the current product. |
| 385 | _product_single_value_vars += PRODUCT_BUILD_SYSTEM_IMAGE |
| 386 | _product_single_value_vars += PRODUCT_BUILD_SYSTEM_OTHER_IMAGE |
| 387 | _product_single_value_vars += PRODUCT_BUILD_VENDOR_IMAGE |
| 388 | _product_single_value_vars += PRODUCT_BUILD_PRODUCT_IMAGE |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 389 | _product_single_value_vars += PRODUCT_BUILD_SYSTEM_EXT_IMAGE |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 390 | _product_single_value_vars += PRODUCT_BUILD_ODM_IMAGE |
Yifan Hong | cfb917a | 2020-05-07 14:58:20 -0700 | [diff] [blame] | 391 | _product_single_value_vars += PRODUCT_BUILD_VENDOR_DLKM_IMAGE |
Yifan Hong | f496f1b | 2020-07-15 16:52:59 -0700 | [diff] [blame] | 392 | _product_single_value_vars += PRODUCT_BUILD_ODM_DLKM_IMAGE |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 393 | _product_single_value_vars += PRODUCT_BUILD_CACHE_IMAGE |
| 394 | _product_single_value_vars += PRODUCT_BUILD_RAMDISK_IMAGE |
| 395 | _product_single_value_vars += PRODUCT_BUILD_USERDATA_IMAGE |
Chris Gross | a784ef1 | 2019-04-22 11:09:57 -0700 | [diff] [blame] | 396 | _product_single_value_vars += PRODUCT_BUILD_RECOVERY_IMAGE |
| 397 | _product_single_value_vars += PRODUCT_BUILD_BOOT_IMAGE |
Yi-Yo Chiang | 4d7c613 | 2021-09-29 19:41:11 +0800 | [diff] [blame] | 398 | _product_single_value_vars += PRODUCT_BUILD_DEBUG_BOOT_IMAGE |
Daniel Norman | 42879ff | 2020-10-06 11:09:56 -0700 | [diff] [blame] | 399 | _product_single_value_vars += PRODUCT_BUILD_VENDOR_BOOT_IMAGE |
Yi-Yo Chiang | 4d7c613 | 2021-09-29 19:41:11 +0800 | [diff] [blame] | 400 | _product_single_value_vars += PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE |
Paul Trautrim | 4e14323 | 2019-08-13 16:30:57 +0900 | [diff] [blame] | 401 | _product_single_value_vars += PRODUCT_BUILD_VBMETA_IMAGE |
Yo Chiang | e86bab4 | 2021-03-25 10:12:28 +0000 | [diff] [blame] | 402 | _product_single_value_vars += PRODUCT_BUILD_SUPER_EMPTY_IMAGE |
Pierre-Clément Tosi | fa8193c | 2021-09-24 15:49:00 +0200 | [diff] [blame] | 403 | _product_single_value_vars += PRODUCT_BUILD_PVMFW_IMAGE |
Anton Hansson | c1c4c0b | 2019-05-06 15:09:19 +0100 | [diff] [blame] | 404 | |
Martin Stjernholm | 743513c | 2021-07-05 20:53:57 +0100 | [diff] [blame] | 405 | # List of boot jars delivered via updatable APEXes, following the same format as |
| 406 | # PRODUCT_BOOT_JARS. |
satayev | 65e68bb | 2021-07-15 18:19:56 +0100 | [diff] [blame] | 407 | _product_list_vars += PRODUCT_APEX_BOOT_JARS |
Chris Gross | a784ef1 | 2019-04-22 11:09:57 -0700 | [diff] [blame] | 408 | |
Yifan Hong | 7d37b40 | 2019-07-23 14:20:29 -0700 | [diff] [blame] | 409 | # If set, device uses virtual A/B. |
| 410 | _product_single_value_vars += PRODUCT_VIRTUAL_AB_OTA |
| 411 | |
Kelvin Zhang | 239a79a | 2021-01-15 13:47:52 -0500 | [diff] [blame] | 412 | # If set, device uses virtual A/B Compression. |
| 413 | _product_single_value_vars += PRODUCT_VIRTUAL_AB_COMPRESSION |
| 414 | |
Yifan Hong | 7d37b40 | 2019-07-23 14:20:29 -0700 | [diff] [blame] | 415 | # If set, device retrofits virtual A/B. |
| 416 | _product_single_value_vars += PRODUCT_VIRTUAL_AB_OTA_RETROFIT |
| 417 | |
Yifan Hong | 65afc07 | 2020-04-17 10:08:10 -0700 | [diff] [blame] | 418 | # If set, forcefully generate a non-A/B update package. |
| 419 | # Note: A device configuration should inherit from virtual_ab_ota_plus_non_ab.mk |
| 420 | # instead of setting this variable directly. |
| 421 | # Note: Use TARGET_OTA_ALLOW_NON_AB in the build system because |
| 422 | # TARGET_OTA_ALLOW_NON_AB takes the value of AB_OTA_UPDATER into account. |
| 423 | _product_single_value_vars += PRODUCT_OTA_FORCE_NON_AB_PACKAGE |
| 424 | |
Jeongik Cha | 7452979 | 2019-07-19 13:40:18 +0900 | [diff] [blame] | 425 | # If set, Java module in product partition cannot use hidden APIs. |
| 426 | _product_single_value_vars += PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE |
| 427 | |
JaeMan Park | 33d9aad | 2020-12-02 16:34:12 +0900 | [diff] [blame] | 428 | # If set, only java_sdk_library can be used at inter-partition dependency. |
| 429 | # Note: Build error if BOARD_VNDK_VERSION is not set while |
| 430 | # PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY is true, because |
| 431 | # PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY has no meaning if |
| 432 | # BOARD_VNDK_VERSION is not set. |
| 433 | # Note: When PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE is not set, there are |
| 434 | # no restrictions at dependency between system and product partition. |
| 435 | _product_single_value_vars += PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY |
| 436 | |
| 437 | # Allowlist for PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY option. |
| 438 | # Listed modules are allowed at inter-partition dependency even if it isn't |
| 439 | # a java_sdk_library module. |
| 440 | _product_list_vars += PRODUCT_INTER_PARTITION_JAVA_LIBRARY_ALLOWLIST |
| 441 | |
Jooyung Han | 9efe534 | 2019-12-05 16:14:18 +0900 | [diff] [blame] | 442 | _product_single_value_vars += PRODUCT_INSTALL_EXTRA_FLATTENED_APEXES |
| 443 | |
Yi-Yo Chiang | f63bd5d | 2021-09-23 14:14:16 +0000 | [diff] [blame] | 444 | # Install a copy of the debug policy to the system_ext partition, and allow |
| 445 | # init-second-stage to load debug policy from system_ext. |
| 446 | # This option is only meant to be set by GSI products. |
| 447 | _product_single_value_vars += PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT |
| 448 | |
Inseob Kim | 9cda397 | 2021-10-12 22:59:12 +0900 | [diff] [blame] | 449 | # If set, metadata files for the following artifacts will be generated. |
| 450 | # - system/framework/*.jar |
| 451 | # - system/framework/oat/<arch>/*.{oat,vdex,art} |
| 452 | # - system/etc/boot-image.prof |
| 453 | # - system/etc/dirty-image-objects |
| 454 | # One fsverity metadata container file per one input file will be generated in |
| 455 | # system.img, with a suffix ".fsv_meta". e.g. a container file for |
| 456 | # "/system/framework/foo.jar" will be "system/framework/foo.jar.fsv_meta". |
| 457 | _product_single_value_vars += PRODUCT_SYSTEM_FSVERITY_GENERATE_METADATA |
| 458 | |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 459 | .KATI_READONLY := _product_single_value_vars _product_list_vars |
| 460 | _product_var_list :=$= $(_product_single_value_vars) $(_product_list_vars) |
Ying Wang | 20ebd2e | 2014-10-07 18:07:23 -0700 | [diff] [blame] | 461 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 462 | define dump-product |
Anton Hansson | dce3f92 | 2019-02-11 21:19:54 +0000 | [diff] [blame] | 463 | $(warning ==== $(1) ====)\ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 464 | $(foreach v,$(_product_var_list),\ |
Anton Hansson | cca8cdb | 2019-10-28 11:30:40 +0000 | [diff] [blame] | 465 | $(warning PRODUCTS.$(1).$(v) := $(call get-product-var,$(1),$(v))))\ |
Anton Hansson | dce3f92 | 2019-02-11 21:19:54 +0000 | [diff] [blame] | 466 | $(warning --------) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 467 | endef |
| 468 | |
| 469 | define dump-products |
| 470 | $(foreach p,$(PRODUCTS),$(call dump-product,$(p))) |
| 471 | endef |
| 472 | |
| 473 | # |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 474 | # Functions for including product makefiles |
| 475 | # |
| 476 | |
| 477 | # |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 478 | # $(1): product to inherit |
| 479 | # |
Anton Hansson | 061cbcf | 2018-05-30 18:24:41 +0100 | [diff] [blame] | 480 | # To be called from product makefiles, and is later evaluated during the import-nodes |
| 481 | # call below. It does three things: |
The Android Open Source Project | 6a5f7f0 | 2009-03-05 14:34:30 -0800 | [diff] [blame] | 482 | # 1. Inherits all of the variables from $1. |
| 483 | # 2. Records the inheritance in the .INHERITS_FROM variable |
Anton Hansson | 061cbcf | 2018-05-30 18:24:41 +0100 | [diff] [blame] | 484 | # 3. Records the calling makefile in PARENT_PRODUCT_FILES |
| 485 | # |
| 486 | # (2) and (3) can be used together to reconstruct the include hierarchy |
| 487 | # See e.g. product-graph.mk for an example of this. |
The Android Open Source Project | 6a5f7f0 | 2009-03-05 14:34:30 -0800 | [diff] [blame] | 488 | # |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 489 | define inherit-product |
Ying Wang | a174261 | 2015-10-28 14:33:40 -0700 | [diff] [blame] | 490 | $(if $(findstring ../,$(1)),\ |
| 491 | $(eval np := $(call normalize-paths,$(1))),\ |
| 492 | $(eval np := $(strip $(1))))\ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 493 | $(foreach v,$(_product_var_list), \ |
Ying Wang | a174261 | 2015-10-28 14:33:40 -0700 | [diff] [blame] | 494 | $(eval $(v) := $($(v)) $(INHERIT_TAG)$(np))) \ |
Anton Hansson | 061cbcf | 2018-05-30 18:24:41 +0100 | [diff] [blame] | 495 | $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \ |
| 496 | $(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \ |
Ying Wang | a174261 | 2015-10-28 14:33:40 -0700 | [diff] [blame] | 497 | $(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \ |
Joe Onorato | f20c93a | 2021-01-19 22:34:22 -0800 | [diff] [blame] | 498 | $(eval PARENT_PRODUCT_FILES := $(sort $(PARENT_PRODUCT_FILES) $(current_mk))) \ |
| 499 | $(call dump-inherit,$(strip $(word 1,$(_include_stack))),$(1)) \ |
| 500 | $(call dump-config-vals,$(current_mk),inherit) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 501 | endef |
| 502 | |
Anton Hansson | 837425b | 2018-06-01 14:18:14 +0100 | [diff] [blame] | 503 | # Specifies a number of path prefixes, relative to PRODUCT_OUT, where the |
| 504 | # product makefile hierarchy rooted in the current node places its artifacts. |
| 505 | # Creating artifacts outside the specified paths will cause a build-time error. |
| 506 | define require-artifacts-in-path |
| 507 | $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \ |
| 508 | $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENTS := $(strip $(1))) \ |
Colin Cross | c3ad804 | 2020-06-11 11:25:05 -0700 | [diff] [blame] | 509 | $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_ALLOWED_LIST := $(strip $(2))) \ |
Anton Hansson | 837425b | 2018-06-01 14:18:14 +0100 | [diff] [blame] | 510 | $(eval ARTIFACT_PATH_REQUIREMENT_PRODUCTS := \ |
| 511 | $(sort $(ARTIFACT_PATH_REQUIREMENT_PRODUCTS) $(current_mk))) |
| 512 | endef |
Joe Onorato | 28a846d | 2010-02-22 10:33:05 -0800 | [diff] [blame] | 513 | |
Anton Hansson | d1258eb | 2020-12-08 12:13:50 +0000 | [diff] [blame] | 514 | # Like require-artifacts-in-path, but does not require all allow-list entries to |
| 515 | # have an effect. |
| 516 | define require-artifacts-in-path-relaxed |
| 517 | $(require-artifacts-in-path) \ |
| 518 | $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENT_IS_RELAXED := true) |
| 519 | endef |
| 520 | |
Yo Chiang | 1db657a | 2020-05-10 20:33:35 +0800 | [diff] [blame] | 521 | # Makes including non-existent modules in PRODUCT_PACKAGES an error. |
Colin Cross | c3ad804 | 2020-06-11 11:25:05 -0700 | [diff] [blame] | 522 | # $(1): list of non-existent modules to allow. |
Anton Hansson | 1ebcbd5 | 2018-07-04 17:17:23 +0100 | [diff] [blame] | 523 | define enforce-product-packages-exist |
| 524 | $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \ |
| 525 | $(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST := true) \ |
Colin Cross | c3ad804 | 2020-06-11 11:25:05 -0700 | [diff] [blame] | 526 | $(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST := $(1)) \ |
Anton Hansson | 1ebcbd5 | 2018-07-04 17:17:23 +0100 | [diff] [blame] | 527 | $(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST) \ |
Colin Cross | c3ad804 | 2020-06-11 11:25:05 -0700 | [diff] [blame] | 528 | $(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST) |
Anton Hansson | 1ebcbd5 | 2018-07-04 17:17:23 +0100 | [diff] [blame] | 529 | endef |
| 530 | |
Joe Onorato | 28a846d | 2010-02-22 10:33:05 -0800 | [diff] [blame] | 531 | # |
| 532 | # Do inherit-product only if $(1) exists |
| 533 | # |
| 534 | define inherit-product-if-exists |
| 535 | $(if $(wildcard $(1)),$(call inherit-product,$(1)),) |
| 536 | endef |
| 537 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 538 | # |
| 539 | # $(1): product makefile list |
| 540 | # |
| 541 | #TODO: check to make sure that products have all the necessary vars defined |
| 542 | define import-products |
Anton Hansson | d26c647 | 2019-05-06 14:40:57 +0100 | [diff] [blame] | 543 | $(call import-nodes,PRODUCTS,$(1),$(_product_var_list),$(_product_single_value_vars)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 544 | endef |
| 545 | |
| 546 | |
| 547 | # |
| 548 | # Does various consistency checks on all of the known products. |
| 549 | # Takes no parameters, so $(call ) is not necessary. |
| 550 | # |
| 551 | define check-all-products |
| 552 | $(if ,, \ |
| 553 | $(eval _cap_names :=) \ |
| 554 | $(foreach p,$(PRODUCTS), \ |
| 555 | $(eval pn := $(strip $(PRODUCTS.$(p).PRODUCT_NAME))) \ |
| 556 | $(if $(pn),,$(error $(p): PRODUCT_NAME must be defined.)) \ |
| 557 | $(if $(filter $(pn),$(_cap_names)), \ |
| 558 | $(error $(p): PRODUCT_NAME must be unique; "$(pn)" already used by $(strip \ |
| 559 | $(foreach \ |
| 560 | pp,$(PRODUCTS), |
| 561 | $(if $(filter $(pn),$(PRODUCTS.$(pp).PRODUCT_NAME)), \ |
| 562 | $(pp) \ |
| 563 | ))) \ |
| 564 | ) \ |
| 565 | ) \ |
| 566 | $(eval _cap_names += $(pn)) \ |
| 567 | $(if $(call is-c-identifier,$(pn)),, \ |
| 568 | $(error $(p): PRODUCT_NAME must be a valid C identifier, not "$(pn)") \ |
| 569 | ) \ |
| 570 | $(eval pb := $(strip $(PRODUCTS.$(p).PRODUCT_BRAND))) \ |
| 571 | $(if $(pb),,$(error $(p): PRODUCT_BRAND must be defined.)) \ |
| 572 | $(foreach cf,$(strip $(PRODUCTS.$(p).PRODUCT_COPY_FILES)), \ |
Ying Wang | 4b0486b | 2012-09-20 16:35:36 -0700 | [diff] [blame] | 573 | $(if $(filter 2 3,$(words $(subst :,$(space),$(cf)))),, \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 574 | $(error $(p): malformed COPY_FILE "$(cf)") \ |
| 575 | ) \ |
| 576 | ) \ |
| 577 | ) \ |
| 578 | ) |
| 579 | endef |
| 580 | |
| 581 | |
| 582 | # |
| 583 | # Returns the product makefile path for the product with the provided name |
| 584 | # |
| 585 | # $(1): short product name like "generic" |
| 586 | # |
| 587 | define _resolve-short-product-name |
| 588 | $(eval pn := $(strip $(1))) |
| 589 | $(eval p := \ |
| 590 | $(foreach p,$(PRODUCTS), \ |
| 591 | $(if $(filter $(pn),$(PRODUCTS.$(p).PRODUCT_NAME)), \ |
| 592 | $(p) \ |
| 593 | )) \ |
| 594 | ) |
| 595 | $(eval p := $(sort $(p))) |
| 596 | $(if $(filter 1,$(words $(p))), \ |
| 597 | $(p), \ |
| 598 | $(if $(filter 0,$(words $(p))), \ |
| 599 | $(error No matches for product "$(pn)"), \ |
| 600 | $(error Product "$(pn)" ambiguous: matches $(p)) \ |
| 601 | ) \ |
| 602 | ) |
| 603 | endef |
| 604 | define resolve-short-product-name |
| 605 | $(strip $(call _resolve-short-product-name,$(1))) |
| 606 | endef |
Joe Onorato | 8dc8faa | 2010-09-14 13:09:48 -0400 | [diff] [blame] | 607 | |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 608 | # BoardConfig variables that are also inherited in product mks. Should ideally |
| 609 | # be cleaned up to not be product variables. |
| 610 | _readonly_late_variables := \ |
| 611 | DEVICE_PACKAGE_OVERLAYS \ |
| 612 | WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY \ |
| 613 | |
| 614 | # Modified internally in the build system |
| 615 | _readonly_late_variables += \ |
| 616 | PRODUCT_COPY_FILES \ |
| 617 | PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING \ |
| 618 | PRODUCT_DEX_PREOPT_BOOT_FLAGS \ |
| 619 | |
| 620 | _readonly_early_variables := $(filter-out $(_readonly_late_variables),$(_product_var_list)) |
Yifan Hong | e5d879a | 2018-11-27 11:37:38 -0800 | [diff] [blame] | 621 | |
Joe Onorato | 8dc8faa | 2010-09-14 13:09:48 -0400 | [diff] [blame] | 622 | # |
Dan Willemsen | c1f17ff | 2016-10-05 16:57:27 -0700 | [diff] [blame] | 623 | # Mark the variables in _product_stash_var_list as readonly |
Joe Onorato | 8dc8faa | 2010-09-14 13:09:48 -0400 | [diff] [blame] | 624 | # |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 625 | define readonly-variables |
| 626 | $(foreach v,$(1), \ |
Anton Hansson | 70222b2 | 2019-02-21 10:41:03 +0000 | [diff] [blame] | 627 | $(eval $(v) ?=) \ |
| 628 | $(eval .KATI_READONLY := $(v)) \ |
Joe Onorato | 8dc8faa | 2010-09-14 13:09:48 -0400 | [diff] [blame] | 629 | ) |
| 630 | endef |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 631 | define readonly-product-vars |
| 632 | $(call readonly-variables,$(_readonly_early_variables)) |
| 633 | endef |
| 634 | |
| 635 | define readonly-final-product-vars |
| 636 | $(call readonly-variables,$(_readonly_late_variables)) |
| 637 | endef |
Joe Onorato | 8dc8faa | 2010-09-14 13:09:48 -0400 | [diff] [blame] | 638 | |
Anton Hansson | cca8cdb | 2019-10-28 11:30:40 +0000 | [diff] [blame] | 639 | # Macro re-defined inside strip-product-vars. |
| 640 | get-product-var = $(PRODUCTS.$(strip $(1)).$(2)) |
Yifan Hong | e5d879a | 2018-11-27 11:37:38 -0800 | [diff] [blame] | 641 | # |
Anton Hansson | 528fdc0 | 2019-06-25 18:57:57 +0100 | [diff] [blame] | 642 | # Strip the variables in _product_var_list and a few build-system |
| 643 | # internal variables, and assign the ones for the current product |
| 644 | # to a shorthand that is more convenient to read from elsewhere. |
Yifan Hong | e5d879a | 2018-11-27 11:37:38 -0800 | [diff] [blame] | 645 | # |
| 646 | define strip-product-vars |
Joe Onorato | 38a57bf | 2021-02-08 13:38:01 -0800 | [diff] [blame] | 647 | $(call dump-phase-start,PRODUCT-EXPAND,,$(_product_var_list),$(_product_single_value_vars), \ |
| 648 | build/make/core/product.mk) \ |
Anton Hansson | 528fdc0 | 2019-06-25 18:57:57 +0100 | [diff] [blame] | 649 | $(foreach v,\ |
| 650 | $(_product_var_list) \ |
| 651 | PRODUCT_ENFORCE_PACKAGES_EXIST \ |
Colin Cross | c3ad804 | 2020-06-11 11:25:05 -0700 | [diff] [blame] | 652 | PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST, \ |
Anton Hansson | 13ea2a6 | 2019-03-28 14:47:25 +0000 | [diff] [blame] | 653 | $(eval $(v) := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).$(v)))) \ |
Anton Hansson | cca8cdb | 2019-10-28 11:30:40 +0000 | [diff] [blame] | 654 | $(eval get-product-var = $$(if $$(filter $$(1),$$(INTERNAL_PRODUCT)),$$($$(2)),$$(PRODUCTS.$$(strip $$(1)).$$(2)))) \ |
| 655 | $(KATI_obsolete_var PRODUCTS.$(INTERNAL_PRODUCT).$(v),Use $(v) instead) \ |
Joe Onorato | 38a57bf | 2021-02-08 13:38:01 -0800 | [diff] [blame] | 656 | ) \ |
| 657 | $(call dump-phase-end,build/make/core/product.mk) |
Yifan Hong | e5d879a | 2018-11-27 11:37:38 -0800 | [diff] [blame] | 658 | endef |
| 659 | |
Keun young Park | c41c5f4 | 2012-05-30 10:22:29 -0700 | [diff] [blame] | 660 | define add-to-product-copy-files-if-exists |
| 661 | $(if $(wildcard $(word 1,$(subst :, ,$(1)))),$(1)) |
| 662 | endef |
Ying Wang | 20ebd2e | 2014-10-07 18:07:23 -0700 | [diff] [blame] | 663 | |
| 664 | # whitespace placeholder when we record module's dex-preopt config. |
| 665 | _PDPMC_SP_PLACE_HOLDER := |@SP@| |
| 666 | # Set up dex-preopt config for a module. |
| 667 | # $(1) list of module names |
| 668 | # $(2) the modules' dex-preopt config |
| 669 | define add-product-dex-preopt-module-config |
| 670 | $(eval _c := $(subst $(space),$(_PDPMC_SP_PLACE_HOLDER),$(strip $(2))))\ |
| 671 | $(eval PRODUCT_DEX_PREOPT_MODULE_CONFIGS += \ |
| 672 | $(foreach m,$(1),$(m)=$(_c))) |
| 673 | endef |
Andreas Gampe | 6b30d77 | 2016-06-27 15:15:31 -0700 | [diff] [blame] | 674 | |
| 675 | # whitespace placeholder when we record module's sanitizer config. |
| 676 | _PSMC_SP_PLACE_HOLDER := |@SP@| |
| 677 | # Set up sanitizer config for a module. |
| 678 | # $(1) list of module names |
| 679 | # $(2) the modules' sanitizer config |
| 680 | define add-product-sanitizer-module-config |
| 681 | $(eval _c := $(subst $(space),$(_PSMC_SP_PLACE_HOLDER),$(strip $(2))))\ |
| 682 | $(eval PRODUCT_SANITIZER_MODULE_CONFIGS += \ |
| 683 | $(foreach m,$(1),$(m)=$(_c))) |
| 684 | endef |