On Wed, 12 Jul 2000, Paul D. Smith wrote:

> Date: Wed, 12 Jul 2000 17:50:57 -0400 (EDT)
> From: Paul D. Smith <[EMAIL PROTECTED]>
> To: Charles Howes <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: Circular dependency dropping error
> 
> %% Charles Howes <[EMAIL PROTECTED]> writes:
> 
>   ch> Using make version 3.79.1, on Linux 2.2.16 with glibc-2.1.2.
> 
>   ch>   % ls -la asdf.gif
>   ch>   asdf.gif
> 
>   ch>   % make asdf.png
>   ch>   make: *** No rule to make target `asdf.png'.  Stop.
> 
> This is correct, right?

No, there is a rule for %.png <- %.ppm, and a rule for %.ppm <- %.gif.
%.png <- %.gif should have worked.  This does work for %.png <- %.xpm,
as seen later, and the rules are identical.

>   ch>   % make asdf.ppm
>   ch>   make: Circular asdf.bmp <- asdf.ppm dependency dropped.
>   ch>   ppmtobmp <  > asdf.bmp
>   ch>   /bin/sh: -c: line 1: syntax error near unexpected token `>'
>   ch>   /bin/sh: -c: line 1: `ppmtobmp <  > asdf.bmp'
>   ch>   make: *** [asdf.bmp] Error 2
> 
> I agree, this seems wrong.  I would expect make, after deciding to throw
> out that circular dependency, to decide it doesn't know how to build
> asdf.ppm and give output like this:
> 
>   make: Circular asdf.bmp <- asdf.ppm dependency dropped.
>   make: *** No rule to make target `asdf.ppm'.  Stop.
> 
> rather than failing with an incorrect value.  I'll look into this.
> 
>   ch>   % giftopnm asdf.gif | ppmtoxpm > asdf.xpm
>   ch>   % rm asdf.gif
>   ch>   % make asdf.png
>   ch>   make: Circular asdf.xpm <- asdf.ppm dependency dropped.
>   ch>   xpmtoppm < asdf.xpm > asdf.ppm
>   ch>   pnmtopng < asdf.ppm > asdf.png
>   ch>   rm asdf.ppm
> 
> This is correct, right?

Yes.  This should also have happened with asdf.png <- asdf.gif, but
here it's asdf.png <- asdf.xpm.

>   ch> Anyway, yes, perhaps I'm stretching 'make' too far, but I'm strongly
>   ch> encouraged by the fact that this works some of the time!
> 
> As far as I can tell, make works all the time when it should work.  What
> is broken is that in some situations where make can't do what you want,
> it will try to do something bogus instead of just printing an error.
> 
> Am I correct here, or am I missing something?

It's actually doing the right thing about half the time.  I guess the
code determining which dependency to drop is picking an arbitrary
dependency, instead of useless dependencies.

A dependency graph is easy to parse when it's a tree; in this makefile
it's a graph with loops, but any graph can be turned into a tree if the
right parts get dropped.  (If the wrong parts get dropped, you get two
graphs instead of one, and then you can't get there from here.)

--
Charles Howes -- [EMAIL PROTECTED]

Reply via email to