Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2017 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 | LOCAL_PATH := $(call my-dir) |
| 18 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 19 | BUILD_FRAMEWORK_COMPATIBILITY_MATRIX := $(LOCAL_PATH)/compatibility_matrix.mk |
| 20 | |
| 21 | # Clear potential input variables to BUILD_FRAMEWORK_COMPATIBILITY_MATRIX |
| 22 | LOCAL_ADD_VBMETA_VERSION := |
| 23 | LOCAL_ASSEMBLE_VINTF_ENV_VARS := |
Yifan Hong | 3693fe4 | 2018-03-29 10:06:10 -0700 | [diff] [blame] | 24 | LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE := |
| 25 | LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE := |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 26 | LOCAL_ASSEMBLE_VINTF_FLAGS := |
| 27 | LOCAL_KERNEL_VERSIONS := |
| 28 | LOCAL_GEN_FILE_DEPENDENCIES := |
| 29 | |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 30 | # Install all compatibility_matrix.*.xml to /system/etc/vintf |
| 31 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 32 | |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 33 | include $(CLEAR_VARS) |
Yifan Hong | 7831d43 | 2018-03-29 10:51:48 -0700 | [diff] [blame] | 34 | LOCAL_MODULE := framework_compatibility_matrix.legacy.xml |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 35 | LOCAL_MODULE_STEM := compatibility_matrix.legacy.xml |
| 36 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
Yifan Hong | d8a4d34 | 2018-04-12 14:50:09 -0700 | [diff] [blame^] | 37 | LOCAL_KERNEL_VERSIONS := \ |
| 38 | 3.18.0 \ |
| 39 | 4.4.0 \ |
| 40 | 4.9.0 \ |
| 41 | 4.14.0 \ |
| 42 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 43 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 44 | |
| 45 | include $(CLEAR_VARS) |
Yifan Hong | 7831d43 | 2018-03-29 10:51:48 -0700 | [diff] [blame] | 46 | LOCAL_MODULE := framework_compatibility_matrix.1.xml |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 47 | LOCAL_MODULE_STEM := compatibility_matrix.1.xml |
| 48 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
Yifan Hong | d8a4d34 | 2018-04-12 14:50:09 -0700 | [diff] [blame^] | 49 | LOCAL_KERNEL_VERSIONS := \ |
| 50 | 3.18.0 \ |
| 51 | 4.4.0 \ |
| 52 | 4.9.0 \ |
| 53 | 4.14.0 \ |
| 54 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 55 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 56 | |
| 57 | include $(CLEAR_VARS) |
Yifan Hong | 7831d43 | 2018-03-29 10:51:48 -0700 | [diff] [blame] | 58 | LOCAL_MODULE := framework_compatibility_matrix.2.xml |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 59 | LOCAL_MODULE_STEM := compatibility_matrix.2.xml |
| 60 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
Yifan Hong | d8a4d34 | 2018-04-12 14:50:09 -0700 | [diff] [blame^] | 61 | LOCAL_KERNEL_VERSIONS := \ |
| 62 | 3.18.0 \ |
| 63 | 4.4.0 \ |
| 64 | 4.9.0 \ |
| 65 | 4.14.0 \ |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 66 | |
Yifan Hong | d8a4d34 | 2018-04-12 14:50:09 -0700 | [diff] [blame^] | 67 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 68 | |
| 69 | include $(CLEAR_VARS) |
Yifan Hong | 7831d43 | 2018-03-29 10:51:48 -0700 | [diff] [blame] | 70 | LOCAL_MODULE := framework_compatibility_matrix.current.xml |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 71 | LOCAL_MODULE_STEM := compatibility_matrix.current.xml |
| 72 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
Yifan Hong | d8a4d34 | 2018-04-12 14:50:09 -0700 | [diff] [blame^] | 73 | LOCAL_KERNEL_VERSIONS := \ |
| 74 | 4.4.0 \ |
| 75 | 4.9.0 \ |
| 76 | 4.14.0 \ |
| 77 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 78 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 79 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 80 | # Framework Compatibility Matrix (common to all FCM versions) |
| 81 | |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 82 | include $(CLEAR_VARS) |
Yifan Hong | fee9ea4 | 2018-03-23 12:03:33 -0700 | [diff] [blame] | 83 | LOCAL_MODULE := framework_compatibility_matrix.device.xml |
Yifan Hong | 7831d43 | 2018-03-29 10:51:48 -0700 | [diff] [blame] | 84 | LOCAL_MODULE_STEM := compatibility_matrix.device.xml |
| 85 | # define LOCAL_MODULE_CLASS for local-generated-sources-dir. |
Yifan Hong | fee9ea4 | 2018-03-23 12:03:33 -0700 | [diff] [blame] | 86 | LOCAL_MODULE_CLASS := ETC |
| 87 | |
| 88 | ifndef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE |
| 89 | LOCAL_SRC_FILES := compatibility_matrix.empty.xml |
| 90 | else |
| 91 | |
| 92 | # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE specify an absolute path |
| 93 | LOCAL_GENERATED_SOURCES := $(DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE) |
| 94 | |
| 95 | # Enforce that DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE does not specify required HALs |
| 96 | # by checking it against an empty manifest. But the empty manifest needs to contain |
| 97 | # BOARD_SEPOLICY_VERS to be compatible with DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE. |
| 98 | my_manifest_src_file := $(LOCAL_PATH)/manifest.empty.xml |
| 99 | my_gen_check_manifest := $(local-generated-sources-dir)/manifest.check.xml |
| 100 | $(my_gen_check_manifest): PRIVATE_SRC_FILE := $(my_manifest_src_file) |
| 101 | $(my_gen_check_manifest): $(my_manifest_src_file) $(HOST_OUT_EXECUTABLES)/assemble_vintf |
| 102 | BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \ |
Yifan Hong | e0cad7a | 2018-03-29 10:57:12 -0700 | [diff] [blame] | 103 | VINTF_IGNORE_TARGET_FCM_VERSION=true \ |
Yifan Hong | fee9ea4 | 2018-03-23 12:03:33 -0700 | [diff] [blame] | 104 | $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $(PRIVATE_SRC_FILE) -o $@ |
| 105 | |
| 106 | LOCAL_GEN_FILE_DEPENDENCIES += $(my_gen_check_manifest) |
| 107 | LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(my_gen_check_manifest)" |
| 108 | |
| 109 | my_gen_check_manifest := |
| 110 | my_manifest_src_file := |
| 111 | |
| 112 | endif # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE |
| 113 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 114 | LOCAL_ADD_VBMETA_VERSION := true |
| 115 | LOCAL_ASSEMBLE_VINTF_ENV_VARS := \ |
Yifan Hong | b426af3 | 2018-02-02 12:47:48 -0800 | [diff] [blame] | 116 | POLICYVERS \ |
| 117 | PLATFORM_SEPOLICY_VERSION \ |
| 118 | PLATFORM_SEPOLICY_COMPAT_VERSIONS |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 119 | |
Yifan Hong | 3693fe4 | 2018-03-29 10:06:10 -0700 | [diff] [blame] | 120 | LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE := PRODUCT_ENFORCE_VINTF_MANIFEST=true |
| 121 | LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE := \ |
Yifan Hong | fee9ea4 | 2018-03-23 12:03:33 -0700 | [diff] [blame] | 122 | "Error: DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX cannot contain required HALs." |
| 123 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 124 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 125 | |
| 126 | # Framework Compatibility Matrix |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 127 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 128 | include $(CLEAR_VARS) |
| 129 | LOCAL_MODULE := framework_compatibility_matrix.xml |
| 130 | LOCAL_MODULE_STEM := compatibility_matrix.xml |
| 131 | LOCAL_MODULE_PATH := $(TARGET_OUT) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 132 | LOCAL_REQUIRED_MODULES := \ |
| 133 | framework_compatibility_matrix.legacy.xml \ |
| 134 | framework_compatibility_matrix.1.xml \ |
| 135 | framework_compatibility_matrix.2.xml \ |
| 136 | framework_compatibility_matrix.current.xml \ |
Yifan Hong | fee9ea4 | 2018-03-23 12:03:33 -0700 | [diff] [blame] | 137 | framework_compatibility_matrix.device.xml |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 138 | LOCAL_GENERATED_SOURCES := $(call module-installed-files,$(LOCAL_REQUIRED_MODULES)) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 139 | |
| 140 | ifdef BUILT_VENDOR_MANIFEST |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 141 | LOCAL_GEN_FILE_DEPENDENCIES += $(BUILT_VENDOR_MANIFEST) |
| 142 | LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(BUILT_VENDOR_MANIFEST)" |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 143 | endif |
| 144 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 145 | LOCAL_ASSEMBLE_VINTF_ENV_VARS := PRODUCT_ENFORCE_VINTF_MANIFEST |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 146 | |
Yifan Hong | 7d61a8d | 2018-03-28 10:27:10 -0700 | [diff] [blame] | 147 | # TODO(b/65028233): Enforce no "unused HALs" for devices that does not define |
| 148 | # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE as well |
| 149 | ifeq (true,$(strip $(PRODUCT_ENFORCE_VINTF_MANIFEST))) |
| 150 | ifdef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE |
| 151 | LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE := VINTF_ENFORCE_NO_UNUSED_HALS=true |
| 152 | endif |
| 153 | endif |
| 154 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 155 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 156 | BUILT_SYSTEM_COMPATIBILITY_MATRIX := $(LOCAL_BUILT_MODULE) |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 157 | |
| 158 | BUILD_FRAMEWORK_COMPATIBILITY_MATRIX := |