Thursday, 15 May 2014

Copy multiple files to different directories in Makefile -



Copy multiple files to different directories in Makefile -

i have makefile have 2 files should copied different directories. currently, i've tested

echo ${dirs} | xargs -n 1 cp ${sources}

so understand not work since seek re-create both source files 1 of directory every time. there way can execute re-create command every source file , directory each?

best regards,

simon

i think possible deduce want wrote, others pointed out, should more clear, don't have spend time deducing it.

anyway, since want not re-create files directories, must somehow tell make want re-create files. easiest way list total paths of copies want in variable such $(copies), , not ${dirs}. in reply going assume destination directories exist.

.phony: all: $(copies) percent := % .secondexpansion: $(copies): %: $$(filter $$(percent)/$$(notdir $$*), $(sources)) makefile cp $< $@

makefile copy make echo xargs

No comments:

Post a Comment