summaryrefslogtreecommitdiffstats
path: root/core/product_config.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2010-06-02 13:11:32 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-06-02 13:11:32 -0700
commitf33c3ef9332c2d3e4a04b14819aa3dbb9f0d4d21 (patch)
tree55fdd3c2c37621107701107c680523bbccdf7a4c /core/product_config.mk
parent8a06bac1db18ff7702dbd2a4ffbdde97330cd665 (diff)
parentb93e03cbc9d47a9d9a385c780ed64639e2a23ae5 (diff)
downloadbuild-f33c3ef9332c2d3e4a04b14819aa3dbb9f0d4d21.tar.gz
build-f33c3ef9332c2d3e4a04b14819aa3dbb9f0d4d21.tar.bz2
build-f33c3ef9332c2d3e4a04b14819aa3dbb9f0d4d21.zip
am b93e03cb: am 52911309: Cherry-pick unbundled build changes from master
Merge commit 'b93e03cbc9d47a9d9a385c780ed64639e2a23ae5' into kraken * commit 'b93e03cbc9d47a9d9a385c780ed64639e2a23ae5': Cherry-pick unbundled build changes from master
Diffstat (limited to 'core/product_config.mk')
-rw-r--r--core/product_config.mk39
1 files changed, 33 insertions, 6 deletions
diff --git a/core/product_config.mk b/core/product_config.mk
index 02334cfa7..a7eba92d1 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -149,6 +149,27 @@ endif
# else: Use the value set in the environment or buildspec.mk.
# ---------------------------------------------------------------
+# Provide "APP-<appname>" targets, which lets you build
+# an unbundled app.
+#
+unbundled_goals := $(strip $(filter APP-%,$(MAKECMDGOALS)))
+ifdef unbundled_goals
+ ifneq ($(words $(unbundled_goals)),1)
+ $(error Only one APP-* goal may be specified; saw "$(unbundled_goals)"))
+ endif
+ UNBUNDLED_APPS := $(strip $(subst -, ,$(patsubst APP-%,%,$(unbundled_goals))))
+ ifneq ($(filter $(DEFAULT_GOAL),$(MAKECMDGOALS)),)
+ MAKECMDGOALS := $(patsubst $(unbundled_goals),,$(MAKECMDGOALS))
+ else
+ MAKECMDGOALS := $(patsubst $(unbundled_goals),$(DEFAULT_GOAL),$(MAKECMDGOALS))
+ endif
+ is_unbundled_app_build := true
+
+.PHONY: $(unbundled_goals)
+$(unbundled_goals): $(MAKECMDGOALS)
+endif # unbundled_goals
+
+# ---------------------------------------------------------------
# Include the product definitions.
# We need to do this to translate TARGET_PRODUCT into its
# underlying TARGET_DEVICE before we start defining any rules.
@@ -157,12 +178,18 @@ include $(BUILD_SYSTEM)/node_fns.mk
include $(BUILD_SYSTEM)/product.mk
include $(BUILD_SYSTEM)/device.mk
-# Read in all of the product definitions specified by the AndroidProducts.mk
-# files in the tree.
-#
-#TODO: when we start allowing direct pointers to product files,
-# guarantee that they're in this list.
-$(call import-products, $(get-all-product-makefiles))
+ifeq ($(strip $(is_unbundled_app_build)),true)
+ # An unbundled app build needs only the core product makefiles.
+ $(call import-products,$(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.
+ #
+ #TODO: when we start allowing direct pointers to product files,
+ # guarantee that they're in this list.
+ $(call import-products, $(get-all-product-makefiles))
+endif # is_unbundled_app_build
$(check-all-products)
#$(dump-products)
#$(error done)