Rename the poorly named ALL_PRODUCTS variable.

There was PRODUCTS, ALL_PRODUCTS and really_all_products, and
ALL_PRODUCTS was in fact not all products. Rename it to what
it really is: parent makefiles, i.e. product makefiles that include
other product makefiles.

Also rename the really_all_products var.

Bug: 80410283
Test: lunch aosp_arm64; m product-graph
Change-Id: I87aec49966e50c364ca2baf5de10fe30f9292a53
This commit is contained in:
Anton Hansson 2018-05-30 18:24:41 +01:00
parent e56adeffef
commit 061cbcfdae
2 changed files with 13 additions and 10 deletions

View File

@ -18,7 +18,7 @@
define gather-all-products
$(sort $(foreach p, \
$(eval _all_products_visited := )
$(call all-products-inner, $(ALL_PRODUCTS)) \
$(call all-products-inner, $(PARENT_PRODUCT_FILES)) \
, $(if $(strip $(p)),$(strip $(p)),)) \
)
endef
@ -49,7 +49,7 @@ products_list := $(foreach prod,$(ANDROID_PRODUCT_GRAPH),$(call resolve-short-pr
endif
endif
really_all_products := $(call gather-all-products)
all_products := $(call gather-all-products)
open_parethesis := (
close_parenthesis := )
@ -66,7 +66,7 @@ colorscheme=\"svg\" fontcolor=\"darkblue\" href=\"products/$(1).html\" \
endef
$(products_graph): PRIVATE_PRODUCTS := $(really_all_products)
$(products_graph): PRIVATE_PRODUCTS := $(all_products)
$(products_graph): PRIVATE_PRODUCTS_FILTER := $(products_list)
$(products_graph): $(this_makefile)
@ -130,7 +130,7 @@ $(call product-debug-filename, $(p)): \
endef
product_debug_files:=
$(foreach p,$(really_all_products), \
$(foreach p,$(all_products), \
$(eval $(call transform-product-debug, $(p))) \
$(eval product_debug_files += $(call product-debug-filename, $(p))) \
)

View File

@ -213,10 +213,14 @@ endef
#
# $(1): product to inherit
#
# Does three things:
# To be called from product makefiles, and is later evaluated during the import-nodes
# call below. It does three things:
# 1. Inherits all of the variables from $1.
# 2. Records the inheritance in the .INHERITS_FROM variable
# 3. Records that we've visited this node, in ALL_PRODUCTS
# 3. Records the calling makefile in PARENT_PRODUCT_FILES
#
# (2) and (3) can be used together to reconstruct the include hierarchy
# See e.g. product-graph.mk for an example of this.
#
define inherit-product
$(if $(findstring ../,$(1)),\
@ -224,11 +228,10 @@ define inherit-product
$(eval np := $(strip $(1))))\
$(foreach v,$(_product_var_list), \
$(eval $(v) := $($(v)) $(INHERIT_TAG)$(np))) \
$(eval inherit_var := \
PRODUCTS.$(strip $(word 1,$(_include_stack))).INHERITS_FROM) \
$(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
$(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \
$(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \
$(eval inherit_var:=) \
$(eval ALL_PRODUCTS := $(sort $(ALL_PRODUCTS) $(word 1,$(_include_stack))))
$(eval PARENT_PRODUCT_FILES := $(sort $(PARENT_PRODUCT_FILES) $(current_mk)))
endef