Merge "Make inherit-product loop over all files passed to it" am: 2089403223

Original change: https://android-review.googlesource.com/c/platform/build/+/2016698

Change-Id: I9bf55cb353b805f82fa7d500d8a7ff51d5e5c7d0
This commit is contained in:
Cole Faust
2022-03-15 19:59:40 +00:00
committed by Automerger Merge Worker

View File

@@ -400,17 +400,20 @@ endef
# See e.g. product-graph.mk for an example of this.
#
define inherit-product
$(if $(findstring ../,$(1)),\
$(eval np := $(call normalize-paths,$(1))),\
$(eval np := $(strip $(1))))\
$(foreach v,$(_product_var_list), \
$(eval $(v) := $($(v)) $(INHERIT_TAG)$(np))) \
$(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
$(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \
$(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \
$(eval PARENT_PRODUCT_FILES := $(sort $(PARENT_PRODUCT_FILES) $(current_mk))) \
$(call dump-inherit,$(strip $(word 1,$(_include_stack))),$(1)) \
$(call dump-config-vals,$(current_mk),inherit)
$(eval _inherit_product_wildcard := $(wildcard $(1)))\
$(if $(_inherit_product_wildcard),,$(error $(1) does not exist.))\
$(foreach part,$(_inherit_product_wildcard),\
$(if $(findstring ../,$(part)),\
$(eval np := $(call normalize-paths,$(part))),\
$(eval np := $(strip $(part))))\
$(foreach v,$(_product_var_list), \
$(eval $(v) := $($(v)) $(INHERIT_TAG)$(np))) \
$(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
$(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \
$(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \
$(eval PARENT_PRODUCT_FILES := $(sort $(PARENT_PRODUCT_FILES) $(current_mk))) \
$(call dump-inherit,$(strip $(word 1,$(_include_stack))),$(1)) \
$(call dump-config-vals,$(current_mk),inherit))
endef
# Specifies a number of path prefixes, relative to PRODUCT_OUT, where the