help-make
[Top][All Lists]
Advanced

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

Re: multiple/hidden targets again


From: sqweek
Subject: Re: multiple/hidden targets again
Date: Thu, 23 Feb 2006 09:57:39 +0800

On 22/02/06, Alexander Frink <address@hidden> wrote:
> If I understand this correctly, the following example should work
> when a rule creates two header files 'foo.h' and 'bar.h' from an
> input file 'input' using a pseudo-target foobar (note that I
> cannot use pattern rules, because 'foo', 'bar' and 'input' do not
> have any stem in common). However I need two make invocations to
> update the main target 'program' completely. This looks like a problem
> with make's stat caching.
>
> If I change the line
> foo.h bar.h: foobar
> to an empty command
> foo.h bar.h: foobar ;
> everything works as expected (see debug output below), however
> according to the manual "The only reason this is useful is to prevent
> a target from getting implicit commands", which is not the case here.
>
> So, is this a bug, a feature or am I doing anything wrong?

 I think you answered this yourself by linking
http://lists.gnu.org/archive/html/help-make/2005-10/msg00021.html

Paul D. Smith wrote:
| Make knows that it didn't run any rules, so it "knows" that my.exp
| could not have been updated.

 From the sounds of it, make doesn't bother to restat foo.h after
considering its rules since it doesn't have any actions to take. And
it doesn't bother to restat foo.h after running foobar's rule since as
far as make is concerned, said rule updates the file "foobar" and no
others (I wonder if changing that rule to "foobar foo.h bar.h: input"
would help?).




reply via email to

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