On Thu, 24 Sep 2009, CHEN Cheng wrote:
On Wed, Sep 23, 2009 at 11:44:49AM -0500, Roy Stogner wrote:
However, this doesn't work when rawfigs/ isn't a flat directory. If a
user has rawfigs/subdir1/fig.eps, the target figs/subdir1/fig.pdf is
correctly added to the vectorfigs list, but when asked to generate it,
make dies with a "no rule to make target" error. It appears that the
pattern character % doesn't match the directory separator character /
in a target.
IIUC, a generic pattern rule may help:
all : vpath/subdir/test.o
%.o : %.c
mkdir -p $(dir $(subst vpath,vpath.new,$@))
gcc -c -o $(subst vpath,vpath.new,$@) $<
Thank you, but unless I'm misunderstanding how the rule would work,
I'm not sure it's suitable for our documents.
I'm worried about how it would handle duplicated filenames. Having
the same document use figures like "rawfigs/experiment1/results.eps"
and "rawfigs/experiment2/results.eps" would not be unlikely, and make
would have to have some way of knowing to use the first source to
generate "figs/experiment1/results.pdf" but the second source to
generate "figs/experiment2/results.pdf"
---
Roy
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make