summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/product_config.mk17
-rw-r--r--envsetup.sh8
2 files changed, 22 insertions, 3 deletions
diff --git a/core/product_config.mk b/core/product_config.mk
index a87d0c6..1cafc89 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -184,11 +184,16 @@ ifneq ($(strip $(TARGET_BUILD_APPS)),)
all_product_configs := $(call get-product-makefiles,\
$(SRC_TARGET_DIR)/product/AndroidProducts.mk)
else
-# Read in all of the product definitions specified by the AndroidProducts.mk
-# files in the tree.
-all_product_configs := $(get-all-product-makefiles)
+ ifneq ($(CM_BUILD),)
+ all_product_configs := $(shell ls device/*/$(CM_BUILD)/cm.mk)
+ else
+ # Read in all of the product definitions specified by the AndroidProducts.mk
+ # files in the tree.
+ all_product_configs := $(get-all-product-makefiles)
+ endif
endif
+ifeq ($(CM_BUILD),)
# Find the product config makefile for the current product.
# all_product_configs consists items like:
# <product_name>:<path_to_the_product_makefile>
@@ -207,12 +212,18 @@ $(foreach f, $(all_product_configs),\
$(eval all_product_makefiles += $(f))\
$(if $(filter $(TARGET_PRODUCT),$(basename $(notdir $(f)))),\
$(eval current_product_makefile += $(f)),)))
+
_cpm_words :=
_cpm_word1 :=
_cpm_word2 :=
+else
+ current_product_makefile := $(strip $(all_product_configs))
+ all_product_makefiles := $(strip $(all_product_configs))
+endif
current_product_makefile := $(strip $(current_product_makefile))
all_product_makefiles := $(strip $(all_product_makefiles))
+
ifneq (,$(filter product-graph dump-products, $(MAKECMDGOALS)))
# Import all product makefiles.
$(call import-products, $(all_product_makefiles))
diff --git a/envsetup.sh b/envsetup.sh
index d126ebc..ae1e4c5 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -72,6 +72,14 @@ function check_product()
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
fi
+
+ if (echo -n $1 | grep -q -e "^cm_") ; then
+ CM_BUILD=$(echo -n $1 | sed -e 's/^cm_//g')
+ else
+ CM_BUILD=
+ fi
+ export CM_BUILD
+
TARGET_PRODUCT=$1 \
TARGET_BUILD_VARIANT= \
TARGET_BUILD_TYPE= \