OSDN Git Service

Add copy-many-files macro.
authorJoe Onorato <joeo@google.com>
Fri, 18 May 2012 00:12:04 +0000 (17:12 -0700)
committerJoe Onorato <joeo@google.com>
Fri, 18 May 2012 03:57:35 +0000 (20:57 -0700)
Change-Id: I327fc19bdf9c1ada18b3ba695fe4104e2a241156

core/definitions.mk

index 867575a..9420d70 100644 (file)
@@ -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