aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-03-31 23:03:19 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-03-31 23:03:20 +0000
commit979dac690a67fd928ccab94d73926c612b7118df (patch)
tree14b15b28141aa7a5bc0c1eba2de95c47525289dc
parent542c3d57d0ac2ab918cbb0bb2a361ddf57a52175 (diff)
parent839db81b26e8b912250c3ee081bc354e7b660412 (diff)
downloadbuild_make-979dac690a67fd928ccab94d73926c612b7118df.tar.gz
build_make-979dac690a67fd928ccab94d73926c612b7118df.tar.bz2
build_make-979dac690a67fd928ccab94d73926c612b7118df.zip
Merge "Auto-generate PLATFORM_VERSION_ALL_CODENAMES."
-rw-r--r--core/version_defaults.mk21
1 files changed, 18 insertions, 3 deletions
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index e11e8b3591..1c228551ae 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -66,9 +66,9 @@ endif
# than overriding it somewhere else). Can be an arbitrary string.
PLATFORM_VERSION.OPR1 := O
-# This is the current development code-name, if the build is not a final
-# release build. If this is a final release build, it is simply "REL".
+# These are the current development codenames.
PLATFORM_VERSION_CODENAME.OPR1 := O
+PLATFORM_VERSION_CODENAME.PPR1 := P
ifndef PLATFORM_VERSION
PLATFORM_VERSION := $(PLATFORM_VERSION.$(TARGET_PLATFORM_VERSION))
@@ -109,7 +109,22 @@ ifndef PLATFORM_VERSION_CODENAME
# This is all of the development codenames that are active. Should be either
# the same as PLATFORM_VERSION_CODENAME or a comma-separated list of additional
# codenames after PLATFORM_VERSION_CODENAME.
- PLATFORM_VERSION_ALL_CODENAMES := $(PLATFORM_VERSION_CODENAME)
+ PLATFORM_VERSION_ALL_CODENAMES :=
+
+ # Build a list of all possible code names. Avoid duplicates, and stop when we
+ # reach a codename that matches PLATFORM_VERSION_CODENAME (anything beyond
+ # that is not included in our build.
+ _versions_in_target := \
+ $(call find_and_earlier,$(ALL_VERSIONS),$(TARGET_PLATFORM_VERSION))
+ $(foreach version,$(_versions_in_target),\
+ $(eval _codename := $(PLATFORM_VERSION_CODENAME.$(version)))\
+ $(if $(filter $(_codename),$(PLATFORM_VERSION_ALL_CODENAMES)),,\
+ $(eval PLATFORM_VERSION_ALL_CODENAMES += $(_codename))))
+
+ # And convert from space separated to comma separated.
+ PLATFORM_VERSION_ALL_CODENAMES := \
+ $(subst $(space),$(comma),$(strip $(PLATFORM_VERSION_ALL_CODENAMES)))
+
endif
ifeq (REL,$(PLATFORM_VERSION_CODENAME))