1#
2# Copyright (C) 2018 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
19# DEVICE_FRAMEWORK_MANIFEST_FILE is a device-specific framework manifest file
20# that installed to the system image. HALs entries should be written to
21# DEVICE_FRAMEWORK_MANIFEST_FILE or PRODUCT_MANIFEST_FILES depend on the path of
22# the module. It is recommended that such device-specific modules to be
23# installed on product partition.
24
25SYSTEM_MANIFEST_INPUT_FILES := $(LOCAL_PATH)/manifest.xml
26ifdef DEVICE_FRAMEWORK_MANIFEST_FILE
27  SYSTEM_MANIFEST_INPUT_FILES += $(DEVICE_FRAMEWORK_MANIFEST_FILE)
28endif
29
30SYSTEM_EXT_MANIFEST_INPUT_FILES := $(LOCAL_PATH)/system_ext_manifest.default.xml
31ifdef SYSTEM_EXT_MANIFEST_FILES
32  SYSTEM_EXT_MANIFEST_INPUT_FILES += $(SYSTEM_EXT_MANIFEST_FILES)
33endif
34
35# VNDK Version in device compatibility matrix and framework manifest
36ifeq ($(BOARD_VNDK_VERSION),current)
37VINTF_VNDK_VERSION := $(PLATFORM_VNDK_VERSION)
38else
39VINTF_VNDK_VERSION := $(BOARD_VNDK_VERSION)
40endif
41
42# Device Compatibility Matrix
43ifdef DEVICE_MATRIX_FILE
44DEVICE_MATRIX_INPUT_FILE := $(DEVICE_MATRIX_FILE)
45else
46DEVICE_MATRIX_INPUT_FILE := $(LOCAL_PATH)/device_compatibility_matrix.default.xml
47endif
48
49include $(CLEAR_VARS)
50LOCAL_MODULE        := vendor_compatibility_matrix.xml
51LOCAL_MODULE_STEM   := compatibility_matrix.xml
52LOCAL_MODULE_CLASS  := ETC
53LOCAL_MODULE_PATH   := $(TARGET_OUT_VENDOR)/etc/vintf
54
55GEN := $(local-generated-sources-dir)/compatibility_matrix.xml
56
57$(GEN): PRIVATE_VINTF_VNDK_VERSION := $(VINTF_VNDK_VERSION)
58$(GEN): PRIVATE_DEVICE_MATRIX_INPUT_FILE := $(DEVICE_MATRIX_INPUT_FILE)
59$(GEN): $(DEVICE_MATRIX_INPUT_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf
60	REQUIRED_VNDK_VERSION=$(PRIVATE_VINTF_VNDK_VERSION) \
61	BOARD_SYSTEMSDK_VERSIONS="$(BOARD_SYSTEMSDK_VERSIONS)" \
62		$(HOST_OUT_EXECUTABLES)/assemble_vintf \
63		-i $(call normalize-path-list,$(PRIVATE_DEVICE_MATRIX_INPUT_FILE)) \
64		-o $@
65
66LOCAL_PREBUILT_MODULE_FILE := $(GEN)
67include $(BUILD_PREBUILT)
68
69# System Manifest
70include $(CLEAR_VARS)
71LOCAL_MODULE        := system_manifest.xml
72LOCAL_MODULE_STEM   := manifest.xml
73LOCAL_MODULE_CLASS  := ETC
74LOCAL_MODULE_PATH   := $(TARGET_OUT)/etc/vintf
75
76GEN := $(local-generated-sources-dir)/manifest.xml
77
78$(GEN): PRIVATE_SYSTEM_MANIFEST_INPUT_FILES := $(SYSTEM_MANIFEST_INPUT_FILES)
79$(GEN): $(SYSTEM_MANIFEST_INPUT_FILES) $(HOST_OUT_EXECUTABLES)/assemble_vintf
80	PLATFORM_SYSTEMSDK_VERSIONS="$(PLATFORM_SYSTEMSDK_VERSIONS)" \
81		$(HOST_OUT_EXECUTABLES)/assemble_vintf \
82		-i $(call normalize-path-list,$(PRIVATE_SYSTEM_MANIFEST_INPUT_FILES)) \
83		-o $@
84
85LOCAL_PREBUILT_MODULE_FILE := $(GEN)
86include $(BUILD_PREBUILT)
87
88# Product Manifest
89ifneq ($(PRODUCT_MANIFEST_FILES),)
90include $(CLEAR_VARS)
91LOCAL_MODULE := product_manifest.xml
92LOCAL_MODULE_STEM := manifest.xml
93LOCAL_MODULE_CLASS := ETC
94LOCAL_PRODUCT_MODULE := true
95LOCAL_MODULE_RELATIVE_PATH := vintf
96GEN := $(local-generated-sources-dir)/manifest.xml
97$(GEN): PRIVATE_PRODUCT_MANIFEST_FILES := $(PRODUCT_MANIFEST_FILES)
98$(GEN): $(PRODUCT_MANIFEST_FILES) $(HOST_OUT_EXECUTABLES)/assemble_vintf
99	$(HOST_OUT_EXECUTABLES)/assemble_vintf \
100		-i $(call normalize-path-list,$(PRIVATE_PRODUCT_MANIFEST_FILES)) \
101		-o $@
102
103LOCAL_PREBUILT_MODULE_FILE := $(GEN)
104include $(BUILD_PREBUILT)
105endif
106
107# System_ext Manifest
108include $(CLEAR_VARS)
109LOCAL_MODULE := system_ext_manifest.xml
110LOCAL_MODULE_STEM := manifest.xml
111LOCAL_MODULE_CLASS := ETC
112LOCAL_SYSTEM_EXT_MODULE := true
113LOCAL_MODULE_RELATIVE_PATH := vintf
114GEN := $(local-generated-sources-dir)/manifest.xml
115$(GEN): PRIVATE_SYSTEM_EXT_MANIFEST_FILES := $(SYSTEM_EXT_MANIFEST_INPUT_FILES)
116$(GEN): PRIVATE_VINTF_VNDK_VERSION := $(VINTF_VNDK_VERSION)
117$(GEN): $(SYSTEM_EXT_MANIFEST_INPUT_FILES) $(HOST_OUT_EXECUTABLES)/assemble_vintf
118	PROVIDED_VNDK_VERSIONS="$(PRIVATE_VINTF_VNDK_VERSION) $(PRODUCT_EXTRA_VNDK_VERSIONS)" \
119	$(HOST_OUT_EXECUTABLES)/assemble_vintf \
120		-i $(call normalize-path-list,$(PRIVATE_SYSTEM_EXT_MANIFEST_FILES)) \
121		-o $@
122
123LOCAL_PREBUILT_MODULE_FILE := $(GEN)
124include $(BUILD_PREBUILT)
125
126VINTF_VNDK_VERSION :=
127SYSTEM_MANIFEST_INPUT_FILES :=
128SYSTEM_EXT_MANIFEST_INPUT_FILES :=
129DEVICE_MATRIX_INPUT_FILE :=
130PRODUCT_MANIFEST_INPUT_FILES :=
131