auto import from //branches/cupcake/...@137197
diff --git a/core/product_config.mk b/core/product_config.mk
index 93671f4..b55760f 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -50,6 +50,11 @@
endef
+# These are the valid values of TARGET_BUILD_VARIANT. Also, if anything else is passed
+# as the variant in the PRODUCT-$TARGET_BUILD_PRODUCT-$TARGET_BUILD_VARIANT form,
+# it will be treated as a goal, and the eng variant will be used.
+INTERNAL_VALID_VARIANTS := user userdebug eng tests
+
# ---------------------------------------------------------------
# Provide "PRODUCT-<prodname>-<goal>" targets, which lets you build
# a particular configuration without needing to set up the environment.
@@ -75,17 +80,15 @@
# The variant they want
TARGET_BUILD_VARIANT := $(word 2,$(product_goals))
- # HACK HACK HACK
# The build server wants to do make PRODUCT-dream-installclean
# which really means TARGET_PRODUCT=dream make installclean.
- ifneq ($(filter-out eng user userdebug tests,$(TARGET_BUILD_VARIANT)),)
+ ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
MAKECMDGOALS := $(MAKECMDGOALS) $(TARGET_BUILD_VARIANT)
TARGET_BUILD_VARIANT := eng
default_goal_substitution :=
else
default_goal_substitution := $(DEFAULT_GOAL)
endif
- # HACK HACK HACK
# Hack to make the linux build servers use dexpreopt.
# OSX is still a little flaky. Most engineers don't use this