blob: 23be7de2f92091400555acd92d107e500080fffc [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
20
21# Clear potential input variables to BUILD_FRAMEWORK_COMPATIBILITY_MATRIX
22LOCAL_ADD_VBMETA_VERSION :=
23LOCAL_ASSEMBLE_VINTF_ENV_VARS :=
Yifan Hong3693fe42018-03-29 10:06:10 -070024LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE :=
25LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE :=
Yifan Hong44c9b2e2018-01-23 14:34:41 -080026LOCAL_ASSEMBLE_VINTF_FLAGS :=
27LOCAL_KERNEL_VERSIONS :=
28LOCAL_GEN_FILE_DEPENDENCIES :=
29
Yifan Hong2d8442c2017-12-13 15:01:19 -080030# Install all compatibility_matrix.*.xml to /system/etc/vintf
31
Yifan Hong44c9b2e2018-01-23 14:34:41 -080032
Yifan Hong2d8442c2017-12-13 15:01:19 -080033include $(CLEAR_VARS)
Yifan Hong7831d432018-03-29 10:51:48 -070034LOCAL_MODULE := framework_compatibility_matrix.legacy.xml
Yifan Hong2d8442c2017-12-13 15:01:19 -080035LOCAL_MODULE_STEM := compatibility_matrix.legacy.xml
36LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
Yifan Hong94b7d2c2018-01-23 15:38:49 -080037LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0
Yifan Hong44c9b2e2018-01-23 14:34:41 -080038include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
Yifan Hong2d8442c2017-12-13 15:01:19 -080039
40include $(CLEAR_VARS)
Yifan Hong7831d432018-03-29 10:51:48 -070041LOCAL_MODULE := framework_compatibility_matrix.1.xml
Yifan Hong2d8442c2017-12-13 15:01:19 -080042LOCAL_MODULE_STEM := compatibility_matrix.1.xml
43LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
Yifan Hong94b7d2c2018-01-23 15:38:49 -080044LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0
Yifan Hong44c9b2e2018-01-23 14:34:41 -080045include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
Yifan Hong2d8442c2017-12-13 15:01:19 -080046
47include $(CLEAR_VARS)
Yifan Hong7831d432018-03-29 10:51:48 -070048LOCAL_MODULE := framework_compatibility_matrix.2.xml
Yifan Hong2d8442c2017-12-13 15:01:19 -080049LOCAL_MODULE_STEM := compatibility_matrix.2.xml
50LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
Yifan Hong94b7d2c2018-01-23 15:38:49 -080051LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0
Yifan Hong44c9b2e2018-01-23 14:34:41 -080052include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
53
54# TODO(b/72409164): STOPSHIP: update kernel version requirements
Yifan Hong2d8442c2017-12-13 15:01:19 -080055
56include $(CLEAR_VARS)
Yifan Hong7831d432018-03-29 10:51:48 -070057LOCAL_MODULE := framework_compatibility_matrix.current.xml
Yifan Hong2d8442c2017-12-13 15:01:19 -080058LOCAL_MODULE_STEM := compatibility_matrix.current.xml
59LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
Yifan Hong94b7d2c2018-01-23 15:38:49 -080060LOCAL_KERNEL_VERSIONS := 4.4.0 4.9.0
Yifan Hong44c9b2e2018-01-23 14:34:41 -080061include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
Yifan Hong2d8442c2017-12-13 15:01:19 -080062
Yifan Hong44c9b2e2018-01-23 14:34:41 -080063# Framework Compatibility Matrix (common to all FCM versions)
64
Yifan Hong2d8442c2017-12-13 15:01:19 -080065include $(CLEAR_VARS)
Yifan Hongfee9ea42018-03-23 12:03:33 -070066LOCAL_MODULE := framework_compatibility_matrix.device.xml
Yifan Hong7831d432018-03-29 10:51:48 -070067LOCAL_MODULE_STEM := compatibility_matrix.device.xml
68# define LOCAL_MODULE_CLASS for local-generated-sources-dir.
Yifan Hongfee9ea42018-03-23 12:03:33 -070069LOCAL_MODULE_CLASS := ETC
70
71ifndef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
72LOCAL_SRC_FILES := compatibility_matrix.empty.xml
73else
74
75# DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE specify an absolute path
76LOCAL_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.
81my_manifest_src_file := $(LOCAL_PATH)/manifest.empty.xml
82my_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 Honge0cad7a2018-03-29 10:57:12 -070086 VINTF_IGNORE_TARGET_FCM_VERSION=true \
Yifan Hongfee9ea42018-03-23 12:03:33 -070087 $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $(PRIVATE_SRC_FILE) -o $@
88
89LOCAL_GEN_FILE_DEPENDENCIES += $(my_gen_check_manifest)
90LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(my_gen_check_manifest)"
91
92my_gen_check_manifest :=
93my_manifest_src_file :=
94
95endif # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
96
Yifan Hong44c9b2e2018-01-23 14:34:41 -080097LOCAL_ADD_VBMETA_VERSION := true
98LOCAL_ASSEMBLE_VINTF_ENV_VARS := \
Yifan Hongb426af32018-02-02 12:47:48 -080099 POLICYVERS \
100 PLATFORM_SEPOLICY_VERSION \
101 PLATFORM_SEPOLICY_COMPAT_VERSIONS
Yifan Hong2d8442c2017-12-13 15:01:19 -0800102
Yifan Hong3693fe42018-03-29 10:06:10 -0700103LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE := PRODUCT_ENFORCE_VINTF_MANIFEST=true
104LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE := \
Yifan Hongfee9ea42018-03-23 12:03:33 -0700105 "Error: DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX cannot contain required HALs."
106
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800107include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
Yifan Hong2d8442c2017-12-13 15:01:19 -0800108
109# Framework Compatibility Matrix
Yifan Hong2d8442c2017-12-13 15:01:19 -0800110
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800111include $(CLEAR_VARS)
112LOCAL_MODULE := framework_compatibility_matrix.xml
113LOCAL_MODULE_STEM := compatibility_matrix.xml
114LOCAL_MODULE_PATH := $(TARGET_OUT)
Yifan Hong2d8442c2017-12-13 15:01:19 -0800115LOCAL_REQUIRED_MODULES := \
116 framework_compatibility_matrix.legacy.xml \
117 framework_compatibility_matrix.1.xml \
118 framework_compatibility_matrix.2.xml \
119 framework_compatibility_matrix.current.xml \
Yifan Hongfee9ea42018-03-23 12:03:33 -0700120 framework_compatibility_matrix.device.xml
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800121LOCAL_GENERATED_SOURCES := $(call module-installed-files,$(LOCAL_REQUIRED_MODULES))
Yifan Hong2d8442c2017-12-13 15:01:19 -0800122
123ifdef BUILT_VENDOR_MANIFEST
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800124LOCAL_GEN_FILE_DEPENDENCIES += $(BUILT_VENDOR_MANIFEST)
125LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(BUILT_VENDOR_MANIFEST)"
Yifan Hong2d8442c2017-12-13 15:01:19 -0800126endif
127
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800128LOCAL_ASSEMBLE_VINTF_ENV_VARS := PRODUCT_ENFORCE_VINTF_MANIFEST
Yifan Hong2d8442c2017-12-13 15:01:19 -0800129
Yifan Hong7d61a8d2018-03-28 10:27:10 -0700130# TODO(b/65028233): Enforce no "unused HALs" for devices that does not define
131# DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE as well
132ifeq (true,$(strip $(PRODUCT_ENFORCE_VINTF_MANIFEST)))
133ifdef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
134LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE := VINTF_ENFORCE_NO_UNUSED_HALS=true
135endif
136endif
137
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800138include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
Yifan Hong2d8442c2017-12-13 15:01:19 -0800139BUILT_SYSTEM_COMPATIBILITY_MATRIX := $(LOCAL_BUILT_MODULE)
Yifan Hong44c9b2e2018-01-23 14:34:41 -0800140
141BUILD_FRAMEWORK_COMPATIBILITY_MATRIX :=