blob: b0caa7c36729e41008d843904574a74ffb98c56d [file] [log] [blame]
Yifan Hong2d8442c2017-12-13 15:01:19 -08001#
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
Yifan Hong44c9b2e2018-01-23 14:34:41 -080019BUILD_FRAMEWORK_COMPATIBILITY_MATRIX := $(LOCAL_PATH)/compatibility_matrix.mk
Yifan Hongfee037a2019-01-22 14:27:50 -080020my_empty_manifest := $(LOCAL_PATH)/manifest.empty.xml
Yifan Hong44c9b2e2018-01-23 14:34:41 -080021
Yifan Hongfee037a2019-01-22 14:27:50 -080022# System Compatibility Matrix (common to all FCM versions)
Yifan Hong44c9b2e2018-01-23 14:34:41 -080023
Yifan Hong2d8442c2017-12-13 15:01:19 -080024include $(CLEAR_VARS)
Yifan Hong366101c2018-04-25 14:36:00 -070025include $(LOCAL_PATH)/clear_vars.mk
Yifan Hong13df6282018-03-23 12:03:33 -070026LOCAL_MODULE := framework_compatibility_matrix.device.xml
Yifan Hong37ad8c42018-03-29 10:51:48 -070027LOCAL_MODULE_STEM := compatibility_matrix.device.xml
28# define LOCAL_MODULE_CLASS for local-generated-sources-dir.
Yifan Hong13df6282018-03-23 12:03:33 -070029LOCAL_MODULE_CLASS := ETC
Yifan Hongfee037a2019-01-22 14:27:50 -080030LOCAL_MODULE_RELATIVE_PATH := vintf
Yifan Hong13df6282018-03-23 12:03:33 -070031
32ifndef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
33LOCAL_SRC_FILES := compatibility_matrix.empty.xml
34else
35
36# DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE specify an absolute path
37LOCAL_GENERATED_SOURCES := $(DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE)
38
39# Enforce that DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE does not specify required HALs
40# by checking it against an empty manifest. But the empty manifest needs to contain
41# BOARD_SEPOLICY_VERS to be compatible with DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE.
Yifan Hong13df6282018-03-23 12:03:33 -070042my_gen_check_manifest := $(local-generated-sources-dir)/manifest.check.xml
Yifan Hongfee037a2019-01-22 14:27:50 -080043$(my_gen_check_manifest): PRIVATE_SRC_FILE := $(my_empty_manifest)
44$(my_gen_check_manifest): $(my_empty_manifest) $(HOST_OUT_EXECUTABLES)/assemble_vintf
Yifan Hong13df6282018-03-23 12:03:33 -070045 BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \
Yifan Hongb2a83d12018-03-29 10:57:12 -070046 VINTF_IGNORE_TARGET_FCM_VERSION=true \
Yifan Hong13df6282018-03-23 12:03:33 -070047 $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $(PRIVATE_SRC_FILE) -o $@
48
49LOCAL_GEN_FILE_DEPENDENCIES += $(my_gen_check_manifest)
50LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(my_gen_check_manifest)"
51
52my_gen_check_manifest :=
Yifan Hong13df6282018-03-23 12:03:33 -070053
54endif # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
55
Yifan Hong44c9b2e2018-01-23 14:34:41 -080056LOCAL_ADD_VBMETA_VERSION := true
57LOCAL_ASSEMBLE_VINTF_ENV_VARS := \
Yifan Hongb426af32018-02-02 12:47:48 -080058 POLICYVERS \
59 PLATFORM_SEPOLICY_VERSION \
60 PLATFORM_SEPOLICY_COMPAT_VERSIONS
Yifan Hong2d8442c2017-12-13 15:01:19 -080061
Yifan Hong44c9b2e2018-01-23 14:34:41 -080062include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
Yifan Hong2d8442c2017-12-13 15:01:19 -080063
Yifan Hongfee037a2019-01-22 14:27:50 -080064# Product Compatibility Matrix
65
66include $(CLEAR_VARS)
67include $(LOCAL_PATH)/clear_vars.mk
68LOCAL_MODULE := product_compatibility_matrix.xml
69
70ifndef DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE
71my_framework_matrix_deps :=
72include $(BUILD_PHONY_PACKAGE)
73else # DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE
74
75LOCAL_MODULE_STEM := compatibility_matrix.xml
76LOCAL_PRODUCT_MODULE := true
77LOCAL_MODULE_CLASS := ETC
78LOCAL_MODULE_RELATIVE_PATH := vintf
79
80# DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE specify an absolute path
81LOCAL_GENERATED_SOURCES := $(DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE)
82
83# Enforce that DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE does not specify required HALs
84# by checking it against an empty manifest.
85LOCAL_GEN_FILE_DEPENDENCIES += $(my_empty_manifest)
86LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(my_empty_manifest)"
87
88my_framework_matrix_deps := $(LOCAL_MODULE)
89
90include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
91
92endif # DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE
93
Yifan Hong774c2bf2018-06-11 18:07:53 -070094my_system_matrix_deps := \
Yifan Hong2d8442c2017-12-13 15:01:19 -080095 framework_compatibility_matrix.legacy.xml \
96 framework_compatibility_matrix.1.xml \
97 framework_compatibility_matrix.2.xml \
Steven Moreland92ea6542018-04-03 09:38:41 -070098 framework_compatibility_matrix.3.xml \
Steven Moreland86eb7fc2019-04-09 14:08:40 -070099 framework_compatibility_matrix.4.xml \
Yifan Hongfee037a2019-01-22 14:27:50 -0800100 framework_compatibility_matrix.device.xml \
Yifan Hong774c2bf2018-06-11 18:07:53 -0700101
Yifan Hongfee037a2019-01-22 14:27:50 -0800102my_framework_matrix_deps += \
103 $(my_system_matrix_deps)
104
105# Phony target that installs all system compatibility matrix files
106include $(CLEAR_VARS)
107LOCAL_MODULE := system_compatibility_matrix.xml
108LOCAL_REQUIRED_MODULES := $(my_system_matrix_deps)
109include $(BUILD_PHONY_PACKAGE)
110
111# Phony target that installs all framework compatibility matrix files (system + product)
Yifan Hong774c2bf2018-06-11 18:07:53 -0700112include $(CLEAR_VARS)
113LOCAL_MODULE := framework_compatibility_matrix.xml
Yifan Hongfee037a2019-01-22 14:27:50 -0800114LOCAL_REQUIRED_MODULES := $(my_framework_matrix_deps)
Yifan Hong774c2bf2018-06-11 18:07:53 -0700115include $(BUILD_PHONY_PACKAGE)
116
Yifan Hong53891ac2018-08-13 12:33:42 -0700117# Final Framework Compatibility Matrix for OTA
Yifan Hong774c2bf2018-06-11 18:07:53 -0700118include $(CLEAR_VARS)
119include $(LOCAL_PATH)/clear_vars.mk
120LOCAL_MODULE := verified_assembled_system_matrix.xml
121LOCAL_MODULE_PATH := $(PRODUCT_OUT)
Yifan Hongfee037a2019-01-22 14:27:50 -0800122LOCAL_REQUIRED_MODULES := $(my_framework_matrix_deps)
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800123LOCAL_GENERATED_SOURCES := $(call module-installed-files,$(LOCAL_REQUIRED_MODULES))
Yifan Hong53891ac2018-08-13 12:33:42 -0700124LOCAL_ADD_VBMETA_VERSION_OVERRIDE := true
Yifan Hong2d8442c2017-12-13 15:01:19 -0800125
126ifdef BUILT_VENDOR_MANIFEST
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800127LOCAL_GEN_FILE_DEPENDENCIES += $(BUILT_VENDOR_MANIFEST)
128LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(BUILT_VENDOR_MANIFEST)"
Yifan Hong2d8442c2017-12-13 15:01:19 -0800129endif
130
Yifan Hongf529c342018-07-26 11:42:17 -0700131ifneq ($(PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS),true)
132LOCAL_ASSEMBLE_VINTF_FLAGS += --no-kernel-requirements
133endif
134
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800135include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
Steven Moreland515324a2018-05-01 09:59:32 -0700136BUILT_SYSTEM_MATRIX := $(LOCAL_BUILT_MODULE)
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800137
Yifan Hong774c2bf2018-06-11 18:07:53 -0700138my_system_matrix_deps :=
Yifan Hongfee037a2019-01-22 14:27:50 -0800139my_framework_matrix_deps :=
140my_empty_manifest :=
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800141BUILD_FRAMEWORK_COMPATIBILITY_MATRIX :=