From 8b9b39e995407a025ed9bc87b5062194f1b5f51f Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Thu, 25 Feb 2010 20:20:43 -0800 Subject: [PATCH] Add phony target to build and dist sample code. See http://b/issue?id=2468418 After this CL, add "samplecode" to your make goals, you will get the sample apks built and installed at out/target/common/samples/. Change-Id: Iff83f2ba6b6c2fe6ac1c78ca4a9d4bc6953dac8a --- core/main.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/main.mk b/core/main.mk index 71e8acb98a..3ffb084f47 100644 --- a/core/main.mk +++ b/core/main.mk @@ -727,6 +727,20 @@ $(call dist-for-goals,sdk, \ $(SYMBOLS_ZIP) \ ) +.PHONY: samplecode +sample_MODULES := $(sort $(call get-tagged-modules,samples)) +sample_APKS_DEST_PATH := $(TARGET_COMMON_OUT_ROOT)/samples +sample_APKS_COLLECTION := \ + $(foreach module,$(sample_MODULES),$(sample_APKS_DEST_PATH)/$(notdir $(module))) +$(foreach module,$(sample_MODULES),$(eval $(call \ + copy-one-file,$(module),$(sample_APKS_DEST_PATH)/$(notdir $(module))))) +sample_ADDITIONAL_INSTALLED := \ + $(filter-out $(modules_to_install) $(modules_to_check) $(ALL_PREBUILT),$(sample_MODULES)) +samplecode: $(sample_APKS_COLLECTION) + @echo "Collect sample code apks: $^" + # remove apks that are not intended to be installed. + rm -f $(sample_ADDITIONAL_INSTALLED) + .PHONY: findbugs findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET)