From e44705a86f80fe356ba83b3030864f5fcff3d394 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Thu, 17 May 2012 17:12:04 -0700 Subject: [PATCH] Add copy-many-files macro. Change-Id: I327fc19bdf9c1ada18b3ba695fe4104e2a241156 --- core/definitions.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/definitions.mk b/core/definitions.mk index 867575ad7..9420d70d6 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1695,6 +1695,19 @@ $(2): $(1) | $(ACP) $$(copy-file-to-target) endef +# Copies many files. +# $(1): The files to copy. Each entry is a ':' separated src:dst pair +# Evaluates to the list of the dst files (ie suitable for a dependency list) +define copy-many-files +$(foreach f, $(1), $(strip \ + $(eval _cmf_tuple := $(subst :, ,$(f))) \ + $(eval _cmf_src := $(word 1,$(_cmf_tuple))) \ + $(eval _cmf_dest := $(word 2,$(_cmf_tuple))) \ + $(eval $(call copy-one-file,$(_cmf_src),$(_cmf_dest))) \ + $(_cmf_dest))) +endef + + # The -t option to acp and the -p option to cp is # required for OSX. OSX has a ridiculous restriction # where it's an error for a .a file's modification time -- 2.11.0