[Top][All Lists]

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

Re: multiple prerequisites in pattern rules

From: Benoit Poulot-Cazajous
Subject: Re: multiple prerequisites in pattern rules
Date: 30 Jan 2004 22:07:47 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Noel Yap <address@hidden> writes:

> "Paul D. Smith" wrote:
> > No other files other than the target(s) will ever be removed (how could
> > they be, when make doesn't even know they were created?)
> I see.  I had thought, probably naively, that make watched the open calls.
> Given that what you say is true, one way to fix the problem might be to break 
> apart the rule.  For example:
> %.d: %.o
>       $(MakeDependsAction)
> %.o: %.C
>       $(C++CompileAction)

If you kill 'make' during $(MakeDependsAction) and modify, for instance,
a header file included by the %.C file, you will need to run 'make' twice :
1) One to build the %.d.
2) One to use the %.d and notice that the %.o should be updated.

So, it is better to do this :
%.o: %.d
%.d: %.C
Of course, $(MakeDependsAction) will have to produce 'foo.d: bar.h' instead
of 'foo.o: bar.h'

  -- Benoit

reply via email to

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