[Top][All Lists]

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

Re: Make 3.82: weird "circular dependency" and missing $< expansion

From: Paul Smith
Subject: Re: Make 3.82: weird "circular dependency" and missing $< expansion
Date: Tue, 03 May 2011 12:10:38 -0400

On Tue, 2011-05-03 at 15:03 +0200, Edward Welbourne wrote:
> > It all depends on the order in which make searches the rules, which is
> > why changing things in the makefile matters.  If make finds the second
> > rule first then it sees it can build foo.eps and foo.pdf from foo.dat
> > and it's all good.  No circularity.
> Well, it still gets told the same edges in its directed graph, so it's
> just as "cyclic" - when you ignore the direction on at least some
> edges; i.e. it's not a tree - it's just that it's not interested in
> the %.eps: %.pdf rule by the time it reads it, so it doesn't get
> confused about it.  The fact that this depends on the orer of rules
> strikes me as highly suspect; it may be "by design" but I'd read it as
> saying make isn't really building the full directed graph of
> dependencies. 

Absolutely true; it definitely does not (when it comes to pattern rules:
the full graph is created for explicit rules of course).

Make has a well-defined way to traverse the graph, described in the
manual, and as soon as make finds the first acceptable match using that
algorithm it will stop searching the graph and build the target.  If
there are ambiguities or cycles further on, that are never checked
because make stops once it finds an acceptable solution, then you will
never know it (unless you change the graph to expose them).

To test and check every possibility would (a) be very slow, and (b) is
not necessary to build, and (c) expressly violates the behavior
documented in the manual, that many makefiles rely on to avoid these
kinds of issues.


 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "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]