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 | 4d6c4a9 | 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 | 37ad8c4 | 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 | 94b7d2c | 2018-01-23 15:38:49 -0800 | [diff] [blame] | 37 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 38 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 39 | |
| 40 | include $(CLEAR_VARS) |
Yifan Hong | 37ad8c4 | 2018-03-29 10:51:48 -0700 | [diff] [blame] | 41 | LOCAL_MODULE := framework_compatibility_matrix.1.xml |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 42 | LOCAL_MODULE_STEM := compatibility_matrix.1.xml |
| 43 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
Yifan Hong | 94b7d2c | 2018-01-23 15:38:49 -0800 | [diff] [blame] | 44 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 45 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 46 | |
| 47 | include $(CLEAR_VARS) |
Yifan Hong | 37ad8c4 | 2018-03-29 10:51:48 -0700 | [diff] [blame] | 48 | LOCAL_MODULE := framework_compatibility_matrix.2.xml |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 49 | LOCAL_MODULE_STEM := compatibility_matrix.2.xml |
| 50 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
Yifan Hong | 94b7d2c | 2018-01-23 15:38:49 -0800 | [diff] [blame] | 51 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 52 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
| 53 | |
| 54 | # TODO(b/72409164): STOPSHIP: update kernel version requirements |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 55 | |
| 56 | include $(CLEAR_VARS) |
Steven Moreland | 92ea654 | 2018-04-03 09:38:41 -0700 | [diff] [blame^] | 57 | LOCAL_MODULE := framework_compatibility_matrix.3.xml |
| 58 | LOCAL_MODULE_STEM := compatibility_matrix.3.xml |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 59 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
Yifan Hong | 94b7d2c | 2018-01-23 15:38:49 -0800 | [diff] [blame] | 60 | LOCAL_KERNEL_VERSIONS := 4.4.0 4.9.0 |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 61 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 62 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 63 | # Framework Compatibility Matrix (common to all FCM versions) |
| 64 | |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 65 | include $(CLEAR_VARS) |
Yifan Hong | 13df628 | 2018-03-23 12:03:33 -0700 | [diff] [blame] | 66 | LOCAL_MODULE := framework_compatibility_matrix.device.xml |
Yifan Hong | 37ad8c4 | 2018-03-29 10:51:48 -0700 | [diff] [blame] | 67 | LOCAL_MODULE_STEM := compatibility_matrix.device.xml |
| 68 | # define LOCAL_MODULE_CLASS for local-generated-sources-dir. |
Yifan Hong | 13df628 | 2018-03-23 12:03:33 -0700 | [diff] [blame] | 69 | LOCAL_MODULE_CLASS := ETC |
| 70 | |
| 71 | ifndef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE |
| 72 | LOCAL_SRC_FILES := compatibility_matrix.empty.xml |
| 73 | else |
| 74 | |
| 75 | # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE specify an absolute path |
| 76 | LOCAL_GENERATED_SOURCES := $(DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE) |
| 77 | |
| 78 | # Enforce that DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE does not specify required HALs |
| 79 | # by checking it against an empty manifest. But the empty manifest needs to contain |
| 80 | # BOARD_SEPOLICY_VERS to be compatible with DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE. |
| 81 | my_manifest_src_file := $(LOCAL_PATH)/manifest.empty.xml |
| 82 | my_gen_check_manifest := $(local-generated-sources-dir)/manifest.check.xml |
| 83 | $(my_gen_check_manifest): PRIVATE_SRC_FILE := $(my_manifest_src_file) |
| 84 | $(my_gen_check_manifest): $(my_manifest_src_file) $(HOST_OUT_EXECUTABLES)/assemble_vintf |
| 85 | BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \ |
Yifan Hong | b2a83d1 | 2018-03-29 10:57:12 -0700 | [diff] [blame] | 86 | VINTF_IGNORE_TARGET_FCM_VERSION=true \ |
Yifan Hong | 13df628 | 2018-03-23 12:03:33 -0700 | [diff] [blame] | 87 | $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $(PRIVATE_SRC_FILE) -o $@ |
| 88 | |
| 89 | LOCAL_GEN_FILE_DEPENDENCIES += $(my_gen_check_manifest) |
| 90 | LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(my_gen_check_manifest)" |
| 91 | |
| 92 | my_gen_check_manifest := |
| 93 | my_manifest_src_file := |
| 94 | |
| 95 | endif # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE |
| 96 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 97 | LOCAL_ADD_VBMETA_VERSION := true |
| 98 | LOCAL_ASSEMBLE_VINTF_ENV_VARS := \ |
Yifan Hong | b426af3 | 2018-02-02 12:47:48 -0800 | [diff] [blame] | 99 | POLICYVERS \ |
| 100 | PLATFORM_SEPOLICY_VERSION \ |
| 101 | PLATFORM_SEPOLICY_COMPAT_VERSIONS |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 102 | |
Yifan Hong | 4d6c4a9 | 2018-03-29 10:06:10 -0700 | [diff] [blame] | 103 | LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE := PRODUCT_ENFORCE_VINTF_MANIFEST=true |
| 104 | LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE := \ |
Yifan Hong | 13df628 | 2018-03-23 12:03:33 -0700 | [diff] [blame] | 105 | "Error: DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX cannot contain required HALs." |
| 106 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 107 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 108 | |
| 109 | # Framework Compatibility Matrix |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 110 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 111 | include $(CLEAR_VARS) |
| 112 | LOCAL_MODULE := framework_compatibility_matrix.xml |
| 113 | LOCAL_MODULE_STEM := compatibility_matrix.xml |
| 114 | LOCAL_MODULE_PATH := $(TARGET_OUT) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 115 | LOCAL_REQUIRED_MODULES := \ |
| 116 | framework_compatibility_matrix.legacy.xml \ |
| 117 | framework_compatibility_matrix.1.xml \ |
| 118 | framework_compatibility_matrix.2.xml \ |
Steven Moreland | 92ea654 | 2018-04-03 09:38:41 -0700 | [diff] [blame^] | 119 | framework_compatibility_matrix.3.xml \ |
Yifan Hong | 13df628 | 2018-03-23 12:03:33 -0700 | [diff] [blame] | 120 | framework_compatibility_matrix.device.xml |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 121 | LOCAL_GENERATED_SOURCES := $(call module-installed-files,$(LOCAL_REQUIRED_MODULES)) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 122 | |
| 123 | ifdef BUILT_VENDOR_MANIFEST |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 124 | LOCAL_GEN_FILE_DEPENDENCIES += $(BUILT_VENDOR_MANIFEST) |
| 125 | LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(BUILT_VENDOR_MANIFEST)" |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 126 | endif |
| 127 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 128 | LOCAL_ASSEMBLE_VINTF_ENV_VARS := PRODUCT_ENFORCE_VINTF_MANIFEST |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 129 | |
Yifan Hong | e62d476 | 2018-03-28 10:27:10 -0700 | [diff] [blame] | 130 | # TODO(b/65028233): Enforce no "unused HALs" for devices that does not define |
| 131 | # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE as well |
| 132 | ifeq (true,$(strip $(PRODUCT_ENFORCE_VINTF_MANIFEST))) |
| 133 | ifdef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE |
| 134 | LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE := VINTF_ENFORCE_NO_UNUSED_HALS=true |
| 135 | endif |
| 136 | endif |
| 137 | |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 138 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
Yifan Hong | 2d8442c | 2017-12-13 15:01:19 -0800 | [diff] [blame] | 139 | BUILT_SYSTEM_COMPATIBILITY_MATRIX := $(LOCAL_BUILT_MODULE) |
Yifan Hong | 44c9b2e | 2018-01-23 14:34:41 -0800 | [diff] [blame] | 140 | |
| 141 | BUILD_FRAMEWORK_COMPATIBILITY_MATRIX := |