help-make
[Top][All Lists]
Advanced

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

Re: a small question about subst


From: John Graham-Cumming
Subject: Re: a small question about subst
Date: Thu, 12 May 2005 16:30:38 -0400

On Thu, 2005-05-12 at 16:18 -0400, Ken Smith wrote:
> Without seeing your code, I can only assume that you are trying to do
> this in the command section of a rule.  If that is the case, you'll need
> to use sed or something similar.  The GNU make functions will be
> processed when the files are read and not when the targets are run.  At
> that time, $< has no value and your statements evaluate to the empty
> string.

Sorry, that's totally wrong.  

The commands within a rule are not expanded/substituted until they are
needed (i.e. just before the rule's commands are about to be executed)
and hence $< etc. are perfectly valid within a rule.  There's no need to
use sed.  

John.
-- 
John Graham-Cumming

Home: http://www.jgc.org/
Work: http://www.electric-cloud.com/
POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/






reply via email to

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