help-make
[Top][All Lists]
Advanced

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

Re: Getting the target of an implicit rule within the rule


From: Ronald Landheer-Cieslak
Subject: Re: Getting the target of an implicit rule within the rule
Date: Mon, 26 Jul 2004 15:18:11 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.1) Gecko/20040707

Paul D. Smith wrote:

%% Ronald Landheer-Cieslak <address@hidden> writes:

  rl> %.d : $(srcdir)/$(subst .d,.c,$@)
  rl>        blah

  rl> $@, however, is empty here (as the docs duely indicate).

Why not just use the obvious:

    %.d : $(srcdir)/%.c

?  That's what pattern rules are for, after all...

because the obvious doesn't work if there's a pathname in the target filename (i.e. target == dir/file.d, prereq would become dir/$(srcdir)/file.c because the stem of the pattern is "file", not "dir/file").

rlc





reply via email to

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