help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matching subdirectories in patterns?


From: Roy Stogner
Subject: Re: Matching subdirectories in patterns?
Date: Wed, 23 Sep 2009 20:59:42 -0500 (CDT)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)


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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]