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 17LOCAL_PATH := $(call my-dir) 18 19BUILD_FRAMEWORK_COMPATIBILITY_MATRIX := $(LOCAL_PATH)/compatibility_matrix.mk 20my_empty_manifest := $(LOCAL_PATH)/manifest.empty.xml 21 22# System Compatibility Matrix (common to all FCM versions) 23 24include $(CLEAR_VARS) 25include $(LOCAL_PATH)/clear_vars.mk 26LOCAL_MODULE := framework_compatibility_matrix.device.xml 27LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 28LOCAL_LICENSE_CONDITIONS := notice 29LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../NOTICE 30LOCAL_MODULE_STEM := compatibility_matrix.device.xml 31# define LOCAL_MODULE_CLASS for local-generated-sources-dir. 32LOCAL_MODULE_CLASS := ETC 33LOCAL_MODULE_RELATIVE_PATH := vintf 34 35ifndef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE 36LOCAL_SRC_FILES := compatibility_matrix.empty.xml 37else 38 39# DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE specifies absolute paths 40LOCAL_GENERATED_SOURCES := $(DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE) 41 42# Enforce that DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE does not specify required HALs 43# by checking it against an empty manifest. But the empty manifest needs to contain 44# BOARD_SEPOLICY_VERS to be compatible with DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE. 45my_gen_check_manifest := $(local-generated-sources-dir)/manifest.check.xml 46$(my_gen_check_manifest): PRIVATE_SRC_FILE := $(my_empty_manifest) 47$(my_gen_check_manifest): $(my_empty_manifest) $(HOST_OUT_EXECUTABLES)/assemble_vintf 48 BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \ 49 VINTF_IGNORE_TARGET_FCM_VERSION=true \ 50 $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $(PRIVATE_SRC_FILE) -o $@ 51 52LOCAL_GEN_FILE_DEPENDENCIES += $(my_gen_check_manifest) 53LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(my_gen_check_manifest)" 54 55my_gen_check_manifest := 56 57endif # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE 58 59# TODO(b/296875906): use POLICYVERS from Soong 60POLICYVERS ?= 30 61 62LOCAL_ADD_VBMETA_VERSION := true 63LOCAL_ASSEMBLE_VINTF_ENV_VARS := \ 64 POLICYVERS \ 65 PLATFORM_SEPOLICY_VERSION \ 66 PLATFORM_SEPOLICY_COMPAT_VERSIONS 67 68include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) 69 70# Product Compatibility Matrix 71 72include $(CLEAR_VARS) 73include $(LOCAL_PATH)/clear_vars.mk 74LOCAL_MODULE := product_compatibility_matrix.xml 75LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 76LOCAL_LICENSE_CONDITIONS := notice 77LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../NOTICE 78 79ifndef DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE 80my_framework_matrix_deps := 81include $(BUILD_PHONY_PACKAGE) 82else # DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE 83 84LOCAL_MODULE_STEM := compatibility_matrix.xml 85LOCAL_PRODUCT_MODULE := true 86LOCAL_MODULE_CLASS := ETC 87LOCAL_MODULE_RELATIVE_PATH := vintf 88 89# DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE specifies absolute paths 90LOCAL_GENERATED_SOURCES := $(DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE) 91 92# Enforce that DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE does not specify required HALs 93# by checking it against an empty manifest. 94LOCAL_GEN_FILE_DEPENDENCIES += $(my_empty_manifest) 95LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(my_empty_manifest)" 96 97my_framework_matrix_deps := $(LOCAL_MODULE) 98 99include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) 100 101endif # DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE 102 103my_system_matrix_deps := \ 104 framework_compatibility_matrix.5.xml \ 105 framework_compatibility_matrix.6.xml \ 106 framework_compatibility_matrix.7.xml \ 107 framework_compatibility_matrix.8.xml \ 108 framework_compatibility_matrix.202404.xml \ 109 framework_compatibility_matrix.device.xml \ 110 111# Only allow the use of the unreleased compatibility matrix when we can use unfrozen 112# interfaces (in the `next` release configuration). 113ifeq ($(RELEASE_AIDL_USE_UNFROZEN),true) 114my_system_matrix_deps += \ 115 framework_compatibility_matrix.202504.xml \ 116 117endif 118 119my_framework_matrix_deps += \ 120 $(my_system_matrix_deps) 121 122# Phony target that installs all framework compatibility matrix files (system + product) 123include $(CLEAR_VARS) 124LOCAL_MODULE := framework_compatibility_matrix.xml 125LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 126LOCAL_LICENSE_CONDITIONS := notice 127LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../NOTICE 128LOCAL_REQUIRED_MODULES := $(my_framework_matrix_deps) 129include $(BUILD_PHONY_PACKAGE) 130 131my_system_matrix_deps := 132my_framework_matrix_deps := 133my_empty_manifest := 134BUILD_FRAMEWORK_COMPATIBILITY_MATRIX := 135