Automate the strip and assignment of PRODUCT_ vars
With this change, all PRODUCT_ variables are treated the same
when it comes to stripping and assigning them to their final
variable name. In the past, all the PRODUCT variables needed
to be listed in two places to achieve this.
The documentation previously attached to the strip/assignment
is moved to the PRODUCT_ variable list in product.mk.
Also refactor some of the default value logic to cope with
the new automation.
Many places in the build system that currently refer to
$(PRODUCTS.$(INTERNAL_PRODUCT).X) can now be modified to
use $(X) directly.
Bug: 116769560
Test: verified noop on PRODUCT_ variables on all products in the tree
Change-Id: I5677c355e81359b1d3c0db2a2232941097a05047
diff --git a/core/main.mk b/core/main.mk
index 62d3719..1fd5385 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -404,12 +404,8 @@
# Typical build; include any Android.mk files we can find.
#
-# Before we go and include all of the module makefiles, strip values for easier
-# processing.
-$(call strip-product-vars)
-# Before we go and include all of the module makefiles, mark the PRODUCT_*
-# and ADDITIONAL*PROPERTIES values readonly so that they won't be modified.
-$(call readonly-product-vars)
+# Strip and readonly a few more variables so they won't be modified.
+$(readonly-final-product-vars)
ADDITIONAL_DEFAULT_PROPERTIES := $(strip $(ADDITIONAL_DEFAULT_PROPERTIES))
.KATI_READONLY := ADDITIONAL_DEFAULT_PROPERTIES
ADDITIONAL_BUILD_PROPERTIES := $(strip $(ADDITIONAL_BUILD_PROPERTIES))