From db2cb63612af2bc9e8bd7ea6d33da2218a33de2d Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Tue, 14 Sep 2010 16:07:56 -0700 Subject: [PATCH] Change "make PRODUCT-XXX-tests" to build only tests-build-target Change-Id: Ib1a1a7b09ea6f1c3eea84394dcd6e3ebcda81e1a --- core/Makefile | 17 +++++++++-------- core/main.mk | 11 ----------- core/product_config.mk | 5 +++++ 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/core/Makefile b/core/Makefile index 7b67f88e81..0adc673de8 100644 --- a/core/Makefile +++ b/core/Makefile @@ -831,8 +831,6 @@ $(INSTALLED_USERDATAIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) \ .PHONY: userdataimage-nodeps userdataimage-nodeps: $(INTERNAL_USERIMAGES_DEPS) $(build-userdataimage-target) - $(hide)mkdir -p $(DIST_DIR) - $(hide)cp $(INSTALLED_USERDATAIMAGE_TARGET) $(DIST_DIR) ####### ## data partition tarball @@ -1106,12 +1104,15 @@ $(BUILT_TESTS_ZIP_PACKAGE): \ .PHONY: tests-zip-package tests-zip-package: $(BUILT_TESTS_ZIP_PACKAGE) -# Dist the files needed by tests builds -# So the build server can run the following commands to build tests packages while avoid a full build: -# $make -j16 tests-zip-package userdataimage-nodeps dist showcommands TARGET_BUILD_VARIANT=tests TARGET_PRODUCT=passion -ifeq ($(filter $(DEFAULT_GOAL) tests-zip-package,$(MAKECMDGOALS)),tests-zip-package) - $(call dist-for-goals, tests-zip-package, \ - $(BUILT_TESTS_ZIP_PACKAGE)) +# Target needed by tests build +.PHONY: tests-build-target +tests-build-target: $(BUILT_TESTS_ZIP_PACKAGE) \ + $(BUILT_USERDATAIMAGE_TARGET) + +ifneq (,$(filter $(MAKECMDGOALS),tests-build-target)) + $(call dist-for-goals, tests-build-target, \ + $(BUILT_TESTS_ZIP_PACKAGE) \ + $(BUILT_USERDATAIMAGE_TARGET)) endif # ----------------------------------------------------------------- diff --git a/core/main.mk b/core/main.mk index 8d6fddfa62..f3ec53f106 100644 --- a/core/main.mk +++ b/core/main.mk @@ -741,17 +741,6 @@ else # TARGET_BUILD_APPS $(INSTALLED_RAMDISK_TARGET) \ ) - # Tests are installed in userdata.img. If we're building the tests - # variant, copy it for "make tests dist". Also copy a zip of the - # contents of userdata.img, so that people can easily extract a - # single .apk. - ifeq ($(TARGET_BUILD_VARIANT),tests) - $(call dist-for-goals, droid, \ - $(INSTALLED_USERDATAIMAGE_TARGET) \ - $(BUILT_TESTS_ZIP_PACKAGE) \ - ) - endif - # Building a full system-- the default is to build droidcore droid: droidcore dist_libraries diff --git a/core/product_config.mk b/core/product_config.mk index 7f79ff78c3..482424530b 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -119,6 +119,11 @@ ifdef product_goals default_goal_substitution := $(DEFAULT_GOAL) endif + # For tests build, only build tests-build-target + ifeq (tests,$(TARGET_BUILD_VARIANT)) + default_goal_substitution := tests-build-target + endif + # Hack to make the linux build servers use dexpreopt (emulator-based # preoptimization). Most engineers don't use this type of target # ("make PRODUCT-blah-user"), so this should only tend to happen when