I would like to have a makefile copy files from another directory and change their names. At the moment, I do something like this:
ALL: figure1.eps figure2.eps figure3.eps
figure1.eps: ../other_directory/a_nice_graph.eps
cp $< $@
figure2.eps: ../other_directory/a_beautiful_graph.eps
cp $< $@
figure3.eps: ../other_directory/an_ugly_graph.eps
cp $< $@
I would like to avoid writing the same rule (cp $< $@) for every line. I can’t use the standard wildcards (%.eps) because the filenames do not match. Is there any way to do this?
Try this: