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 ifdef TARGET_BOOTLOADER_BOARD_NAME 28 $(hide) echo "board=$(TARGET_BOOTLOADER_BOARD_NAME)" > $@ 29else 30 $(hide) echo "" > $@ 31endif 32 33$(call declare-0p-target,$(INSTALLED_ANDROID_INFO_TXT_TARGET)) 34 35# Copy compatibility metadata to the device. 36 37# Device Manifest 38ifdef DEVICE_MANIFEST_FILE 39# $(DEVICE_MANIFEST_FILE) can be a list of files 40include $(CLEAR_VARS) 41LOCAL_MODULE := vendor_manifest.xml 42LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution 43LOCAL_LICENSE_CONDITIONS := by_exception_only not_allowed notice 44LOCAL_MODULE_STEM := manifest.xml 45LOCAL_MODULE_CLASS := ETC 46LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/vintf 47 48GEN := $(local-generated-sources-dir)/manifest.xml 49$(GEN): PRIVATE_DEVICE_MANIFEST_FILE := $(DEVICE_MANIFEST_FILE) 50$(GEN): $(DEVICE_MANIFEST_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf 51 BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \ 52 PRODUCT_ENFORCE_VINTF_MANIFEST=$(PRODUCT_ENFORCE_VINTF_MANIFEST) \ 53 PRODUCT_SHIPPING_API_LEVEL=$(PRODUCT_SHIPPING_API_LEVEL) \ 54 $(HOST_OUT_EXECUTABLES)/assemble_vintf -o $@ \ 55 -i $(call normalize-path-list,$(PRIVATE_DEVICE_MANIFEST_FILE)) 56 57LOCAL_PREBUILT_MODULE_FILE := $(GEN) 58include $(BUILD_PREBUILT) 59endif 60 61# DEVICE_MANIFEST_SKUS: a list of SKUS where DEVICE_MANIFEST_<sku>_FILES is defined. 62ifdef DEVICE_MANIFEST_SKUS 63 64# Install /vendor/etc/vintf/manifest_$(sku).xml 65# $(1): sku 66define _add_device_sku_manifest 67my_fragment_files_var := DEVICE_MANIFEST_$$(call to-upper,$(1))_FILES 68ifndef $$(my_fragment_files_var) 69$$(error $(1) is in DEVICE_MANIFEST_SKUS but $$(my_fragment_files_var) is not defined) 70endif 71my_fragment_files := $$($$(my_fragment_files_var)) 72include $$(CLEAR_VARS) 73LOCAL_MODULE := vendor_manifest_$(1).xml 74LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution 75LOCAL_LICENSE_CONDITIONS := by_exception_only not_allowed notice 76LOCAL_MODULE_STEM := manifest_$(1).xml 77LOCAL_MODULE_CLASS := ETC 78LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/vintf 79 80GEN := $$(local-generated-sources-dir)/manifest_$(1).xml 81$$(GEN): PRIVATE_SRC_FILES := $$(my_fragment_files) 82$$(GEN): $$(my_fragment_files) $$(HOST_OUT_EXECUTABLES)/assemble_vintf 83 BOARD_SEPOLICY_VERS=$$(BOARD_SEPOLICY_VERS) \ 84 PRODUCT_ENFORCE_VINTF_MANIFEST=$$(PRODUCT_ENFORCE_VINTF_MANIFEST) \ 85 PRODUCT_SHIPPING_API_LEVEL=$$(PRODUCT_SHIPPING_API_LEVEL) \ 86 $$(HOST_OUT_EXECUTABLES)/assemble_vintf -o $$@ \ 87 -i $$(call normalize-path-list,$$(PRIVATE_SRC_FILES)) 88 89LOCAL_PREBUILT_MODULE_FILE := $$(GEN) 90include $$(BUILD_PREBUILT) 91my_fragment_files_var := 92my_fragment_files := 93endef 94 95$(foreach sku, $(DEVICE_MANIFEST_SKUS), $(eval $(call _add_device_sku_manifest,$(sku)))) 96_add_device_sku_manifest := 97 98endif # DEVICE_MANIFEST_SKUS 99 100# ODM manifest 101ifdef ODM_MANIFEST_FILES 102# ODM_MANIFEST_FILES is a list of files that is combined and installed as the default ODM manifest. 103include $(CLEAR_VARS) 104LOCAL_MODULE := odm_manifest.xml 105LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution 106LOCAL_LICENSE_CONDITIONS := by_exception_only not_allowed notice 107LOCAL_MODULE_STEM := manifest.xml 108LOCAL_MODULE_CLASS := ETC 109LOCAL_MODULE_RELATIVE_PATH := vintf 110LOCAL_ODM_MODULE := true 111 112GEN := $(local-generated-sources-dir)/manifest.xml 113$(GEN): PRIVATE_SRC_FILES := $(ODM_MANIFEST_FILES) 114$(GEN): $(ODM_MANIFEST_FILES) $(HOST_OUT_EXECUTABLES)/assemble_vintf 115 # Set VINTF_IGNORE_TARGET_FCM_VERSION to true because it should only be in device manifest. 116 VINTF_IGNORE_TARGET_FCM_VERSION=true \ 117 $(HOST_OUT_EXECUTABLES)/assemble_vintf -o $@ \ 118 -i $(call normalize-path-list,$(PRIVATE_SRC_FILES)) 119 120LOCAL_PREBUILT_MODULE_FILE := $(GEN) 121include $(BUILD_PREBUILT) 122endif # ODM_MANIFEST_FILES 123 124# ODM_MANIFEST_SKUS: a list of SKUS where ODM_MANIFEST_<sku>_FILES are defined. 125ifdef ODM_MANIFEST_SKUS 126 127# Install /odm/etc/vintf/manifest_$(sku).xml 128# $(1): sku 129define _add_odm_sku_manifest 130my_fragment_files_var := ODM_MANIFEST_$$(call to-upper,$(1))_FILES 131ifndef $$(my_fragment_files_var) 132$$(error $(1) is in ODM_MANIFEST_SKUS but $$(my_fragment_files_var) is not defined) 133endif 134my_fragment_files := $$($$(my_fragment_files_var)) 135include $$(CLEAR_VARS) 136LOCAL_MODULE := odm_manifest_$(1).xml 137LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution 138LOCAL_LICENSE_CONDITIONS := by_exception_only not_allowed notice 139LOCAL_MODULE_STEM := manifest_$(1).xml 140LOCAL_MODULE_CLASS := ETC 141LOCAL_MODULE_RELATIVE_PATH := vintf 142LOCAL_ODM_MODULE := true 143GEN := $$(local-generated-sources-dir)/manifest_$(1).xml 144$$(GEN): PRIVATE_SRC_FILES := $$(my_fragment_files) 145$$(GEN): $$(my_fragment_files) $$(HOST_OUT_EXECUTABLES)/assemble_vintf 146 VINTF_IGNORE_TARGET_FCM_VERSION=true \ 147 $$(HOST_OUT_EXECUTABLES)/assemble_vintf -o $$@ \ 148 -i $$(call normalize-path-list,$$(PRIVATE_SRC_FILES)) 149LOCAL_PREBUILT_MODULE_FILE := $$(GEN) 150include $$(BUILD_PREBUILT) 151my_fragment_files_var := 152my_fragment_files := 153endef 154 155$(foreach sku, $(ODM_MANIFEST_SKUS), $(eval $(call _add_odm_sku_manifest,$(sku)))) 156_add_odm_sku_manifest := 157 158endif # ODM_MANIFEST_SKUS 159