[Top][All Lists]

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

Re: using "%: $(subst RCS/,,%)"

From: Paul D. Smith
Subject: Re: using "%: $(subst RCS/,,%)"
Date: Mon, 2 Oct 2000 18:33:17 -0400

%% Marc MERLIN <address@hidden> 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.

See the GNU make manual section on how make parses makefiles for a
description of which functions and variables are evaluated immediately
when make reads them, and which are deferred until later.

The above is expanded immediately, and you are simply defining this

  %,v : %

since "$(subst RCS/,,%)" gives just "%".

  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?

 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

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