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