summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2012-05-17 17:12:04 -0700
committerJoe Onorato <joeo@google.com>2012-05-17 20:57:35 -0700
commite44705a86f80fe356ba83b3030864f5fcff3d394 (patch)
treebfae65d2390d863c434ad926765fdf0000d612dc
parentac2c989e8492a733bdd3d4c7e1bedd5210c56c8d (diff)
downloadbuild-e44705a86f80fe356ba83b3030864f5fcff3d394.zip
build-e44705a86f80fe356ba83b3030864f5fcff3d394.tar.gz
build-e44705a86f80fe356ba83b3030864f5fcff3d394.tar.bz2
Add copy-many-files macro.
Change-Id: I327fc19bdf9c1ada18b3ba695fe4104e2a241156
-rw-r--r--core/definitions.mk13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/definitions.mk b/core/definitions.mk
index 867575a..9420d70 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