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) 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 := device_manifest.xml 38LOCAL_MODULE_STEM := manifest.xml 39LOCAL_MODULE_CLASS := ETC 40LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/vintf 41 42GEN := $(local-generated-sources-dir)/manifest.xml 43$(GEN): PRIVATE_DEVICE_MANIFEST_FILE := $(DEVICE_MANIFEST_FILE) 44$(GEN): $(DEVICE_MANIFEST_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf 45 BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \ 46 PRODUCT_ENFORCE_VINTF_MANIFEST=$(PRODUCT_ENFORCE_VINTF_MANIFEST) \ 47 PRODUCT_SHIPPING_API_LEVEL=$(PRODUCT_SHIPPING_API_LEVEL) \ 48 $(HOST_OUT_EXECUTABLES)/assemble_vintf -o $@ \ 49 -i $(call normalize-path-list,$(PRIVATE_DEVICE_MANIFEST_FILE)) 50 51LOCAL_PREBUILT_MODULE_FILE := $(GEN) 52include $(BUILD_PREBUILT) 53BUILT_VENDOR_MANIFEST := $(LOCAL_BUILT_MODULE) 54endif 55 56# ODM manifest 57ifdef ODM_MANIFEST_FILES 58# ODM_MANIFEST_FILES is a list of files that is combined and installed as the default ODM manifest. 59include $(CLEAR_VARS) 60LOCAL_MODULE := odm_manifest.xml 61LOCAL_MODULE_STEM := manifest.xml 62LOCAL_MODULE_CLASS := ETC 63LOCAL_MODULE_RELATIVE_PATH := vintf 64LOCAL_ODM_MODULE := true 65 66GEN := $(local-generated-sources-dir)/manifest.xml 67$(GEN): PRIVATE_SRC_FILES := $(ODM_MANIFEST_FILES) 68$(GEN): $(ODM_MANIFEST_FILES) $(HOST_OUT_EXECUTABLES)/assemble_vintf 69 # Set VINTF_IGNORE_TARGET_FCM_VERSION to true because it should only be in device manifest. 70 VINTF_IGNORE_TARGET_FCM_VERSION=true \ 71 $(HOST_OUT_EXECUTABLES)/assemble_vintf -o $@ \ 72 -i $(call normalize-path-list,$(PRIVATE_SRC_FILES)) 73 74LOCAL_PREBUILT_MODULE_FILE := $(GEN) 75include $(BUILD_PREBUILT) 76endif # ODM_MANIFEST_FILES 77 78# ODM_MANIFEST_SKUS: a list of SKUS where ODM_MANIFEST_<sku>_FILES are defined. 79ifdef ODM_MANIFEST_SKUS 80 81# Install /odm/etc/vintf/manifest_$(sku).xml 82# $(1): sku 83define _add_odm_sku_manifest 84my_fragment_files_var := ODM_MANIFEST_$$(call to-upper,$(1))_FILES 85ifndef $$(my_fragment_files_var) 86$$(error $(1) is in ODM_MANIFEST_SKUS but $$(my_fragment_files_var) is not defined) 87endif 88my_fragment_files := $$($$(my_fragment_files_var)) 89include $$(CLEAR_VARS) 90LOCAL_MODULE := odm_manifest_$(1).xml 91LOCAL_MODULE_STEM := manifest_$(1).xml 92LOCAL_MODULE_CLASS := ETC 93LOCAL_MODULE_RELATIVE_PATH := vintf 94LOCAL_ODM_MODULE := true 95GEN := $$(local-generated-sources-dir)/manifest_$(1).xml 96$$(GEN): PRIVATE_SRC_FILES := $$(my_fragment_files) 97$$(GEN): $$(my_fragment_files) $$(HOST_OUT_EXECUTABLES)/assemble_vintf 98 VINTF_IGNORE_TARGET_FCM_VERSION=true \ 99 $$(HOST_OUT_EXECUTABLES)/assemble_vintf -o $$@ \ 100 -i $$(call normalize-path-list,$$(PRIVATE_SRC_FILES)) 101LOCAL_PREBUILT_MODULE_FILE := $$(GEN) 102include $$(BUILD_PREBUILT) 103my_fragment_files_var := 104my_fragment_files := 105endef 106 107$(foreach sku, $(ODM_MANIFEST_SKUS), $(eval $(call _add_odm_sku_manifest,$(sku)))) 108_add_odm_sku_manifest := 109 110endif # ODM_MANIFEST_SKUS 111