From f354b178b15451bc86d38c88daacb55f313e589a Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 20 Jun 2017 15:57:32 -0700 Subject: [PATCH] Support custom my_copy_pairs in package-modules.mk To support extra files in package-modules.mk, allow the user to set my_copy_pairs to a list of src:dest pairs that will be copied into the zip file. Test: build-aosp_arm.ninja is identical before/after Test: codesearch says that these variables aren't otherwise used Test: set my_copy_pairs, ensure that they exist in the zip. Change-Id: Ia80cd136db8ad37a71010baf0552621b281c8bc3 --- core/tasks/tools/build_custom_image.mk | 6 ++++++ core/tasks/tools/package-modules.mk | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/core/tasks/tools/build_custom_image.mk b/core/tasks/tools/build_custom_image.mk index 8c098d64b0..702d8b316d 100644 --- a/core/tasks/tools/build_custom_image.mk +++ b/core/tasks/tools/build_custom_image.mk @@ -144,3 +144,9 @@ custom_images $(my_custom_image_name) : $(my_installed_custom_image) # Archive the built image. $(call dist-for-goals, $(my_custom_image_name) custom_images,$(my_installed_custom_image)) + +my_staging_dir := +my_built_modules := +my_copy_dest := +my_copy_pairs := +my_pickup_files := diff --git a/core/tasks/tools/package-modules.mk b/core/tasks/tools/package-modules.mk index 63fab63fbf..629a9b2a9f 100644 --- a/core/tasks/tools/package-modules.mk +++ b/core/tasks/tools/package-modules.mk @@ -4,6 +4,7 @@ # Input variables: # my_modules: a list of module names # my_package_name: the name of the output zip file. +# my_copy_pairs: a list of extra files to install (in src:dest format) # Output variables: # my_package_zip: the path to the output zip file. # @@ -11,8 +12,8 @@ my_makefile := $(lastword $(filter-out $(lastword $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) my_staging_dir := $(call intermediates-dir-for,PACKAGING,$(my_package_name)) -my_built_modules := -my_copy_pairs := +my_built_modules := $(foreach p,$(my_copy_pairs),$(call word-colon,1,$(p))) +my_copy_pairs := $(foreach p,$(my_copy_pairs),$(call word-colon,1,$(p)):$(my_staging_dir)/$(call word-colon,2,$(p))) my_pickup_files := # Iterate over the modules and include their direct dependencies stated in the @@ -67,3 +68,12 @@ $(my_package_zip) : $(my_built_modules) $(hide) $(foreach f, $(PRIVATE_PICKUP_FILES),\ cp -RfL $(f) $(dir $@) && ) true $(hide) cd $(dir $@) && zip -rqX $(notdir $@) * + +my_makefile := +my_staging_dir := +my_built_modules := +my_copy_dest := +my_copy_pairs := +my_pickup_files := +my_missing_files := +my_modules_and_deps :=