diff options
author | Ying Wang <wangying@google.com> | 2010-05-26 13:13:56 -0700 |
---|---|---|
committer | Ying Wang <wangying@google.com> | 2010-05-26 13:39:31 -0700 |
commit | 529113098350c026ec521258d4c6fba51f285a48 (patch) | |
tree | bec1876c0af8a3500c0843aae7cf6dd8245be4da /core/product_config.mk | |
parent | 8e5605a774fd2f61c6d5bae0440b20fc0bdd79f7 (diff) | |
download | replicant_build-529113098350c026ec521258d4c6fba51f285a48.zip replicant_build-529113098350c026ec521258d4c6fba51f285a48.tar.gz replicant_build-529113098350c026ec521258d4c6fba51f285a48.tar.bz2 |
Cherry-pick unbundled build changes from master
Change-Id: I82cab32f00b7b729d9b01c8e1532c8bf0ad2fb92
Diffstat (limited to 'core/product_config.mk')
-rw-r--r-- | core/product_config.mk | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/core/product_config.mk b/core/product_config.mk index ffb8d27..e86b040 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) |