• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Set up product-global definitions and include product-specific rules.
3#
4
5LOCAL_PATH := $(call my-dir)
6
7-include $(TARGET_DEVICE_DIR)/AndroidBoard.mk
8
9# Generate a file that contains various information about the
10# device we're building for.  This file is typically packaged up
11# with everything else.
12#
13# If TARGET_BOARD_INFO_FILE (which can be set in BoardConfig.mk) is
14# defined, it is used, otherwise board-info.txt is looked for in
15# $(TARGET_DEVICE_DIR).
16#
17INSTALLED_ANDROID_INFO_TXT_TARGET := $(PRODUCT_OUT)/android-info.txt
18board_info_txt := $(TARGET_BOARD_INFO_FILE)
19ifndef board_info_txt
20board_info_txt := $(wildcard $(TARGET_DEVICE_DIR)/board-info.txt)
21endif
22$(INSTALLED_ANDROID_INFO_TXT_TARGET): $(board_info_txt) build/make/tools/check_radio_versions.py
23	$(hide) build/make/tools/check_radio_versions.py $< $(BOARD_INFO_CHECK)
24	$(call pretty,"Generated: ($@)")
25ifdef board_info_txt
26	$(hide) grep -v '#' $< > $@
27else
28	$(hide) echo "board=$(TARGET_BOOTLOADER_BOARD_NAME)" > $@
29endif
30
31# Copy compatibility metadata to the device.
32
33# Device Manifest
34ifdef DEVICE_MANIFEST_FILE
35# $(DEVICE_MANIFEST_FILE) can be a list of files
36include $(CLEAR_VARS)
37LOCAL_MODULE        := vendor_manifest.xml
38LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution
39LOCAL_LICENSE_CONDITIONS := by_exception_only not_allowed notice
40LOCAL_MODULE_STEM   := manifest.xml
41LOCAL_MODULE_CLASS  := ETC
42LOCAL_MODULE_PATH   := $(TARGET_OUT_VENDOR)/etc/vintf
43
44GEN := $(local-generated-sources-dir)/manifest.xml
45$(GEN): PRIVATE_DEVICE_MANIFEST_FILE := $(DEVICE_MANIFEST_FILE)
46$(GEN): $(DEVICE_MANIFEST_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf
47	BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \
48	PRODUCT_ENFORCE_VINTF_MANIFEST=$(PRODUCT_ENFORCE_VINTF_MANIFEST) \
49	PRODUCT_SHIPPING_API_LEVEL=$(PRODUCT_SHIPPING_API_LEVEL) \
50	$(HOST_OUT_EXECUTABLES)/assemble_vintf -o $@ \
51		-i $(call normalize-path-list,$(PRIVATE_DEVICE_MANIFEST_FILE))
52
53LOCAL_PREBUILT_MODULE_FILE := $(GEN)
54include $(BUILD_PREBUILT)
55endif
56
57# DEVICE_MANIFEST_SKUS: a list of SKUS where DEVICE_MANIFEST_<sku>_FILES is defined.
58ifdef DEVICE_MANIFEST_SKUS
59
60# Install /vendor/etc/vintf/manifest_$(sku).xml
61# $(1): sku
62define _add_device_sku_manifest
63my_fragment_files_var := DEVICE_MANIFEST_$$(call to-upper,$(1))_FILES
64ifndef $$(my_fragment_files_var)
65$$(error $(1) is in DEVICE_MANIFEST_SKUS but $$(my_fragment_files_var) is not defined)
66endif
67my_fragment_files := $$($$(my_fragment_files_var))
68include $$(CLEAR_VARS)
69LOCAL_MODULE := vendor_manifest_$(1).xml
70LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution
71LOCAL_LICENSE_CONDITIONS := by_exception_only not_allowed notice
72LOCAL_MODULE_STEM := manifest_$(1).xml
73LOCAL_MODULE_CLASS := ETC
74LOCAL_MODULE_PATH   := $(TARGET_OUT_VENDOR)/etc/vintf
75
76GEN := $$(local-generated-sources-dir)/manifest_$(1).xml
77$$(GEN): PRIVATE_SRC_FILES := $$(my_fragment_files)
78$$(GEN): $$(my_fragment_files) $$(HOST_OUT_EXECUTABLES)/assemble_vintf
79	BOARD_SEPOLICY_VERS=$$(BOARD_SEPOLICY_VERS) \
80	PRODUCT_ENFORCE_VINTF_MANIFEST=$$(PRODUCT_ENFORCE_VINTF_MANIFEST) \
81	PRODUCT_SHIPPING_API_LEVEL=$$(PRODUCT_SHIPPING_API_LEVEL) \
82	$$(HOST_OUT_EXECUTABLES)/assemble_vintf -o $$@ \
83		-i $$(call normalize-path-list,$$(PRIVATE_SRC_FILES))
84
85LOCAL_PREBUILT_MODULE_FILE := $$(GEN)
86include $$(BUILD_PREBUILT)
87my_fragment_files_var :=
88my_fragment_files :=
89endef
90
91$(foreach sku, $(DEVICE_MANIFEST_SKUS), $(eval $(call _add_device_sku_manifest,$(sku))))
92_add_device_sku_manifest :=
93
94endif # DEVICE_MANIFEST_SKUS
95
96# ODM manifest
97ifdef ODM_MANIFEST_FILES
98# ODM_MANIFEST_FILES is a list of files that is combined and installed as the default ODM manifest.
99include $(CLEAR_VARS)
100LOCAL_MODULE := odm_manifest.xml
101LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution
102LOCAL_LICENSE_CONDITIONS := by_exception_only not_allowed notice
103LOCAL_MODULE_STEM := manifest.xml
104LOCAL_MODULE_CLASS := ETC
105LOCAL_MODULE_RELATIVE_PATH := vintf
106LOCAL_ODM_MODULE := true
107
108GEN := $(local-generated-sources-dir)/manifest.xml
109$(GEN): PRIVATE_SRC_FILES := $(ODM_MANIFEST_FILES)
110$(GEN): $(ODM_MANIFEST_FILES) $(HOST_OUT_EXECUTABLES)/assemble_vintf
111	# Set VINTF_IGNORE_TARGET_FCM_VERSION to true because it should only be in device manifest.
112	VINTF_IGNORE_TARGET_FCM_VERSION=true \
113	$(HOST_OUT_EXECUTABLES)/assemble_vintf -o $@ \
114		-i $(call normalize-path-list,$(PRIVATE_SRC_FILES))
115
116LOCAL_PREBUILT_MODULE_FILE := $(GEN)
117include $(BUILD_PREBUILT)
118endif # ODM_MANIFEST_FILES
119
120# ODM_MANIFEST_SKUS: a list of SKUS where ODM_MANIFEST_<sku>_FILES are defined.
121ifdef ODM_MANIFEST_SKUS
122
123# Install /odm/etc/vintf/manifest_$(sku).xml
124# $(1): sku
125define _add_odm_sku_manifest
126my_fragment_files_var := ODM_MANIFEST_$$(call to-upper,$(1))_FILES
127ifndef $$(my_fragment_files_var)
128$$(error $(1) is in ODM_MANIFEST_SKUS but $$(my_fragment_files_var) is not defined)
129endif
130my_fragment_files := $$($$(my_fragment_files_var))
131include $$(CLEAR_VARS)
132LOCAL_MODULE := odm_manifest_$(1).xml
133LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution
134LOCAL_LICENSE_CONDITIONS := by_exception_only not_allowed notice
135LOCAL_MODULE_STEM := manifest_$(1).xml
136LOCAL_MODULE_CLASS := ETC
137LOCAL_MODULE_RELATIVE_PATH := vintf
138LOCAL_ODM_MODULE := true
139GEN := $$(local-generated-sources-dir)/manifest_$(1).xml
140$$(GEN): PRIVATE_SRC_FILES := $$(my_fragment_files)
141$$(GEN): $$(my_fragment_files) $$(HOST_OUT_EXECUTABLES)/assemble_vintf
142	VINTF_IGNORE_TARGET_FCM_VERSION=true \
143	$$(HOST_OUT_EXECUTABLES)/assemble_vintf -o $$@ \
144		-i $$(call normalize-path-list,$$(PRIVATE_SRC_FILES))
145LOCAL_PREBUILT_MODULE_FILE := $$(GEN)
146include $$(BUILD_PREBUILT)
147my_fragment_files_var :=
148my_fragment_files :=
149endef
150
151$(foreach sku, $(ODM_MANIFEST_SKUS), $(eval $(call _add_odm_sku_manifest,$(sku))))
152_add_odm_sku_manifest :=
153
154endif # ODM_MANIFEST_SKUS
155