2018-01-23 23:34:41 +01:00
|
|
|
#
|
|
|
|
# Copyright (C) 2018 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
2018-03-29 19:06:10 +02:00
|
|
|
##### Input Variables:
|
|
|
|
# LOCAL_MODULE: required. Module name for the build system.
|
|
|
|
# LOCAL_MODULE_CLASS: optional. Default is ETC.
|
2019-01-22 23:27:50 +01:00
|
|
|
# LOCAL_MODULE_PATH / LOCAL_MODULE_RELATIVE_PATH: required. (Relative) path of output file.
|
|
|
|
# If not defined, LOCAL_MODULE_RELATIVE_PATH will be "vintf".
|
2018-03-29 19:06:10 +02:00
|
|
|
# LOCAL_MODULE_STEM: optional. Name of output file. Default is $(LOCAL_MODULE).
|
|
|
|
# LOCAL_SRC_FILES: required. Local source files provided to assemble_vintf
|
|
|
|
# (command line argument -i).
|
|
|
|
# LOCAL_GENERATED_SOURCES: optional. Global source files provided to assemble_vintf
|
|
|
|
# (command line argument -i).
|
|
|
|
#
|
|
|
|
# LOCAL_ADD_VBMETA_VERSION: Use AVBTOOL to add avb version to the output matrix
|
|
|
|
# (corresponds to <avb><vbmeta-version> tag)
|
|
|
|
# LOCAL_ASSEMBLE_VINTF_ENV_VARS: Add a list of environment variable names from global variables in
|
|
|
|
# the build system that is lazily evaluated (e.g. PRODUCT_ENFORCE_VINTF_MANIFEST).
|
|
|
|
# LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE: Add a list of environment variables that is local to
|
|
|
|
# assemble_vintf invocation. Format is "VINTF_ENFORCE_NO_UNUSED_HALS=true".
|
|
|
|
# LOCAL_ASSEMBLE_VINTF_FLAGS: Add additional command line arguments to assemble_vintf invocation.
|
2018-04-25 23:36:00 +02:00
|
|
|
# LOCAL_KERNEL_CONFIG_DATA_PATHS: Paths to search for kernel config requirements. Format for each is
|
2018-07-24 02:27:25 +02:00
|
|
|
# <kernel version x.y.z>:<path that contains android-base*.config>.
|
2018-03-29 19:06:10 +02:00
|
|
|
# LOCAL_GEN_FILE_DEPENDENCIES: A list of additional dependencies for the generated file.
|
|
|
|
|
2018-03-29 19:51:48 +02:00
|
|
|
ifndef LOCAL_MODULE
|
|
|
|
$(error LOCAL_MODULE must be defined.)
|
2018-01-23 23:34:41 +01:00
|
|
|
endif
|
|
|
|
|
2018-03-29 19:51:48 +02:00
|
|
|
ifndef LOCAL_MODULE_STEM
|
|
|
|
LOCAL_MODULE_STEM := $(LOCAL_MODULE)
|
2018-03-23 20:03:33 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef LOCAL_MODULE_CLASS
|
2018-01-23 23:34:41 +01:00
|
|
|
LOCAL_MODULE_CLASS := ETC
|
2018-03-23 20:03:33 +01:00
|
|
|
endif
|
2018-01-23 23:34:41 +01:00
|
|
|
|
|
|
|
ifndef LOCAL_MODULE_PATH
|
2019-01-22 23:27:50 +01:00
|
|
|
ifndef LOCAL_MODULE_RELATIVE_PATH
|
|
|
|
$(error Either LOCAL_MODULE_PATH or LOCAL_MODULE_RELATIVE_PATH must be defined.)
|
|
|
|
endif
|
2018-01-23 23:34:41 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
GEN := $(local-generated-sources-dir)/$(LOCAL_MODULE_STEM)
|
|
|
|
|
|
|
|
$(GEN): PRIVATE_ENV_VARS := $(LOCAL_ASSEMBLE_VINTF_ENV_VARS)
|
|
|
|
$(GEN): PRIVATE_FLAGS := $(LOCAL_ASSEMBLE_VINTF_FLAGS)
|
|
|
|
|
|
|
|
$(GEN): $(LOCAL_GEN_FILE_DEPENDENCIES)
|
|
|
|
|
|
|
|
ifeq (true,$(strip $(LOCAL_ADD_VBMETA_VERSION)))
|
|
|
|
ifeq (true,$(BOARD_AVB_ENABLE))
|
|
|
|
$(GEN): $(AVBTOOL)
|
|
|
|
# INTERNAL_AVB_SYSTEM_SIGNING_ARGS consists of BOARD_AVB_SYSTEM_KEY_PATH and
|
|
|
|
# BOARD_AVB_SYSTEM_ALGORITHM. We should add the dependency of key path, which
|
|
|
|
# is a file, here.
|
|
|
|
$(GEN): $(BOARD_AVB_SYSTEM_KEY_PATH)
|
|
|
|
# Use deferred assignment (=) instead of immediate assignment (:=).
|
|
|
|
# Otherwise, cannot get INTERNAL_AVB_SYSTEM_SIGNING_ARGS.
|
|
|
|
$(GEN): FRAMEWORK_VBMETA_VERSION = $$("$(AVBTOOL)" add_hashtree_footer \
|
|
|
|
--print_required_libavb_version \
|
|
|
|
$(INTERNAL_AVB_SYSTEM_SIGNING_ARGS) \
|
|
|
|
$(BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS))
|
|
|
|
else
|
|
|
|
$(GEN): FRAMEWORK_VBMETA_VERSION := 0.0
|
|
|
|
endif # BOARD_AVB_ENABLE
|
|
|
|
$(GEN): PRIVATE_ENV_VARS += FRAMEWORK_VBMETA_VERSION
|
|
|
|
endif # LOCAL_ADD_VBMETA_VERSION
|
|
|
|
|
2018-08-13 21:33:42 +02:00
|
|
|
ifeq (true,$(strip $(LOCAL_ADD_VBMETA_VERSION_OVERRIDE)))
|
|
|
|
ifneq ($(BOARD_OTA_FRAMEWORK_VBMETA_VERSION_OVERRIDE),)
|
|
|
|
$(GEN): FRAMEWORK_VBMETA_VERSION_OVERRIDE := $(BOARD_OTA_FRAMEWORK_VBMETA_VERSION_OVERRIDE)
|
|
|
|
$(GEN): PRIVATE_ENV_VARS += FRAMEWORK_VBMETA_VERSION_OVERRIDE
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-04-25 23:36:00 +02:00
|
|
|
ifneq (,$(strip $(LOCAL_KERNEL_CONFIG_DATA_PATHS)))
|
|
|
|
$(GEN): PRIVATE_KERNEL_CONFIG_DATA_PATHS := $(LOCAL_KERNEL_CONFIG_DATA_PATHS)
|
2018-08-18 00:45:03 +02:00
|
|
|
$(GEN): $(foreach pair,$(LOCAL_KERNEL_CONFIG_DATA_PATHS),\
|
2018-07-24 02:27:25 +02:00
|
|
|
$(wildcard $(call word-colon,2,$(pair))/android-base*.config))
|
2018-04-25 23:36:00 +02:00
|
|
|
$(GEN): PRIVATE_FLAGS += $(foreach pair,$(PRIVATE_KERNEL_CONFIG_DATA_PATHS),\
|
|
|
|
--kernel=$(call word-colon,1,$(pair)):$(call normalize-path-list,\
|
2018-07-24 02:27:25 +02:00
|
|
|
$(wildcard $(call word-colon,2,$(pair))/android-base*.config)))
|
2018-01-23 23:34:41 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
my_matrix_src_files := \
|
|
|
|
$(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES)) \
|
|
|
|
$(LOCAL_GENERATED_SOURCES)
|
|
|
|
|
2018-03-29 19:06:10 +02:00
|
|
|
$(GEN): PRIVATE_ADDITIONAL_ENV_VARS := $(LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE)
|
|
|
|
|
|
|
|
ifneq (,$(strip $(LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE)))
|
|
|
|
$(GEN): PRIVATE_COMMAND_TAIL := || (echo $(strip $(LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE)) && false)
|
2018-03-23 20:03:33 +01:00
|
|
|
endif
|
|
|
|
|
2018-01-23 23:34:41 +01:00
|
|
|
$(GEN): PRIVATE_SRC_FILES := $(my_matrix_src_files)
|
|
|
|
$(GEN): $(my_matrix_src_files) $(HOST_OUT_EXECUTABLES)/assemble_vintf
|
2018-03-29 19:06:10 +02:00
|
|
|
$(foreach varname,$(PRIVATE_ENV_VARS),\
|
|
|
|
$(if $(findstring $(varname),$(PRIVATE_ADDITIONAL_ENV_VARS)),\
|
|
|
|
$(error $(varname) should not be overridden by LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE.)))
|
2018-02-02 21:47:48 +01:00
|
|
|
$(foreach varname,$(PRIVATE_ENV_VARS),$(varname)="$($(varname))") \
|
2018-03-23 20:03:33 +01:00
|
|
|
$(PRIVATE_ADDITIONAL_ENV_VARS) \
|
2018-01-23 23:34:41 +01:00
|
|
|
$(HOST_OUT_EXECUTABLES)/assemble_vintf \
|
|
|
|
-i $(call normalize-path-list,$(PRIVATE_SRC_FILES)) \
|
|
|
|
-o $@ \
|
2018-03-23 20:03:33 +01:00
|
|
|
$(PRIVATE_FLAGS) $(PRIVATE_COMMAND_TAIL)
|
2018-01-23 23:34:41 +01:00
|
|
|
|
|
|
|
LOCAL_PREBUILT_MODULE_FILE := $(GEN)
|
|
|
|
LOCAL_SRC_FILES :=
|
|
|
|
LOCAL_GENERATED_SOURCES :=
|
|
|
|
|
2018-04-25 23:36:00 +02:00
|
|
|
include $(LOCAL_PATH)/clear_vars.mk
|
2018-01-23 23:34:41 +01:00
|
|
|
my_matrix_src_files :=
|
|
|
|
|
|
|
|
include $(BUILD_PREBUILT)
|