From a47420a22d83fb5707cb971d98961f87e667ffe8 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Tue, 23 Sep 2014 21:50:12 -0700 Subject: [PATCH] Break package-modules build recipe to mutliple lines To fix "Argument list too long" error seen on some machines. Change-Id: I6f34668e938412751e257b4b543358e1fc0809a1 --- core/tasks/tools/package-modules.mk | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/core/tasks/tools/package-modules.mk b/core/tasks/tools/package-modules.mk index f7e04ede9..bd9cf57f7 100644 --- a/core/tasks/tools/package-modules.mk +++ b/core/tasks/tools/package-modules.mk @@ -37,16 +37,26 @@ $(foreach m,$(my_modules),\ $(eval my_copy_pairs += $(bui):$(my_staging_dir)/$(my_copy_dest)))\ )) +define copy-tests-in-batch +$(hide) $(foreach p, $(1),\ + $(eval pair := $(subst :,$(space),$(p)))\ + mkdir -p $(dir $(word 2,$(pair)));\ + cp -rf $(word 1,$(pair)) $(word 2,$(pair));) +endef + my_package_zip := $(my_staging_dir)/$(my_package_name).zip $(my_package_zip): PRIVATE_COPY_PAIRS := $(my_copy_pairs) $(my_package_zip): PRIVATE_PICKUP_FILES := $(my_pickup_files) $(my_package_zip) : $(my_built_modules) @echo "Package $@" @rm -rf $(dir $@) && mkdir -p $(dir $@) - $(hide) $(foreach p, $(PRIVATE_COPY_PAIRS), \ - $(eval pair := $(subst :,$(space),$(p)))\ - mkdir -p $(dir $(word 2,$(pair))); \ - cp -rf $(word 1,$(pair)) $(word 2,$(pair));) - $(hide) $(foreach f, $(PRIVATE_PICKUP_FILES), \ + $(call copy-tests-in-batch,$(wordlist 1,200,$(PRIVATE_COPY_PAIRS))) + $(call copy-tests-in-batch,$(wordlist 201,400,$(PRIVATE_COPY_PAIRS))) + $(call copy-tests-in-batch,$(wordlist 401,600,$(PRIVATE_COPY_PAIRS))) + $(call copy-tests-in-batch,$(wordlist 601,800,$(PRIVATE_COPY_PAIRS))) + $(call copy-tests-in-batch,$(wordlist 801,1000,$(PRIVATE_COPY_PAIRS))) + $(call copy-tests-in-batch,$(wordlist 1001,1200,$(PRIVATE_COPY_PAIRS))) + $(call copy-tests-in-batch,$(wordlist 1201,9999,$(PRIVATE_COPY_PAIRS))) + $(hide) $(foreach f, $(PRIVATE_PICKUP_FILES),\ cp -rf $(f) $(dir $@);) $(hide) cd $(dir $@) && zip -rq $(notdir $@) * -- 2.11.0