On Mon, Oct 02, 2000 at 06:33:17PM -0400, Paul D. Smith wrote:
> %% Marc MERLIN <[EMAIL PROTECTED]> writes:
>
> mm> %,v: $(subst RCS/,,%)
>
> This can't work. Variables and functions in target and prerequisite
> definitions are evaluated when the makefile is read in. So, this is
> expanded at makefile read time, and the subst is expanded on the literal
> string "%", not on the results of the pattern substitution, which won't
> happen until make actually starts trying to evaluate rules.
I was afraid of that. Thank you for the confirmation
> mm> The only fix I see right now is to get rid of the RCS directories,
> mm> something which I'd like to avoid at the moment.
>
> I really had a hard time following what you're trying to do. Maybe you
> could provide a simple example with one file, describing the files that
> exist, what you know about them in the makefile, and the result you're
> trying to obtain?
Sure. Sorry I wasn't clear enough the first time.
I have
path/file
path/RCS/file,v
and I'd like to autocheck in path/file if it's been modified
To do this, I did:
TORCSFILES=path1/file1 path2/file2 file3
TORCS=$(shell echo '$(TORCSFILES)' | sed -e 's/\/\([^/]*\) /\/RCS\/\1 /g'
-e 's/\<\([^/]*\) /RCS\/\1 /g' -e 's/RCS\/RCS/RCS/g' -e 's/ */,v /'g)
Which gives me:
TORCS=path1/RCS/file1,v path2/RCS/file2,v RCS/file3,v # (path is optional)
I'd like to have something like this:
rcs: $(TORCS)
RCS/%,v: %
ci -l $<
touch $@
This works fine, but it stops working when I have path/RCS/file,v instead of
RCS/file,v
If I had real regexes, I could do:
\(.*\)RCS/\([^/]\),v: \1\2
Does that make more sense? :-)
Thanks,
Marc
--
Microsoft is to software what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ (friendly to non IE browsers)
Finger [EMAIL PROTECTED] for PGP key and other contact information
_______________________________________________
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make