Circular dependency dropping error

2000-07-12 Thread Charles Howes

Hi!

Using make version 3.79.1, on Linux 2.2.16 with glibc-2.1.2.

Trying to write a makefile for the netpbm utilities
  http://sourceforge.net/project/?group_id=5128
to convert between any two graphics formats.

  % ls -la asdf.gif
  asdf.gif

  % make asdf.png
  make: *** No rule to make target `asdf.png'.  Stop.

  % make asdf.ppm
  make: Circular asdf.bmp - asdf.ppm dependency dropped.
  ppmtobmpasdf.bmp
  /bin/sh: -c: line 1: syntax error near unexpected token `'
  /bin/sh: -c: line 1: `ppmtobmpasdf.bmp'
  make: *** [asdf.bmp] Error 2

  % giftopnm asdf.gif | ppmtoxpm  asdf.xpm
  % rm asdf.gif
  % make asdf.png
  make: Circular asdf.xpm - asdf.ppm dependency dropped.
  xpmtoppm  asdf.xpm  asdf.ppm
  pnmtopng  asdf.ppm  asdf.png
  rm asdf.ppm

  % ls asdf.*
  asdf.png  asdf.xpm

  %

Anyway, yes, perhaps I'm stretching 'make' too far, but I'm strongly
encouraged by the fact that this works some of the time!

It appears that the wrong dependency in a circular dependency gets
dropped, and also the value of $ gets clobbered.

Is this a bug in make, the makefile, or the author of the makefile?

Anyways, here's the makefile:

-
# Convert from ppm
%.acad : %.ppm
ppmtoacad  $  $@
%.bmp : %.ppm
ppmtobmp  $  $@
%.eyuv : %.ppm
ppmtoeyuv  $  $@
%.gif : %.ppm
ppmquant 256  $ | ppmtogif  $@
%.icr : %.ppm
ppmtoicr  $  $@
%.ilbm : %.ppm
ppmquant 32  $ | ppmtoilbm  $@
%.jpeg : %.ppm
ppmtojpeg  $  $@
%.leaf : %.ppm
ppmtoleaf  $  $@
%.map : %.ppm
ppmtomap  $  $@
%.mitsu : %.ppm
ppmtomitsu  $  $@
%.pcx : %.ppm
ppmtopcx  $  $@
%.pgm : %.ppm
ppmtopgm  $  $@
%.pi1 : %.ppm
ppmtopi1  $  $@
%.pict : %.ppm
ppmtopict  $  $@
%.pj : %.ppm
ppmtopj  $  $@
%.pjxl : %.ppm
ppmtopjxl  $  $@
%.puzz : %.ppm
ppmtopuzz  $  $@
%.rgb3 : %.ppm
ppmtorgb3  $  $@
%.sixel : %.ppm
ppmtosixel  $  $@
%.tga : %.ppm
ppmtotga  $  $@
%.uil : %.ppm
ppmtouil  $  $@
%.winicon : %.ppm
ppmtowinicon  $  $@
%.xpm : %.ppm
ppmquant 256  $ | ppmtoxpm  $@
%.yuv : %.ppm
ppmtoyuv  $  $@
%.yuvsplit : %.ppm
ppmtoyuvsplit  $  $@
%.png : %.ppm
pnmtopng  $  $@

# Convert to ppm
%.ppm : %.bmp
bmptoppm  $  $@
%.ppm : %.eyuv
eyuvtoppm  $  $@
%.ppm : %.gould
gouldtoppm  $  $@
%.ppm : %.hpcd
hpcdtoppm  $  $@
%.ppm : %.ilbm
ilbmtoppm  $  $@
%.ppm : %.img
imgtoppm  $  $@
%.ppm : %.leaf
leaftoppm  $  $@
%.ppm : %.mtv
mtvtoppm  $  $@
%.ppm : %.pcx
pcxtoppm  $  $@
%.ppm : %.pgm
pgmtoppm  $  $@
%.ppm : %.pi1
pi1toppm  $  $@
%.ppm : %.pict
picttoppm  $  $@
%.ppm : %.pj
pjtoppm  $  $@
%.ppm : %.qrt
qrttoppm  $  $@
%.ppm : %.raw
rawtoppm  $  $@
%.ppm : %.rgb3
rgb3toppm  $  $@
%.ppm : %.sld
sldtoppm  $  $@
%.ppm : %.spc
spctoppm  $  $@
%.ppm : %.spu
sputoppm  $  $@
%.ppm : %.tga
tgatoppm  $  $@
%.ppm : %.winicon
winicontoppm  $  $@
%.ppm : %.xim
ximtoppm  $  $@
%.ppm : %.xpm
xpmtoppm  $  $@
%.ppm : %.xvmini
xvminitoppm  $  $@
%.ppm : %.yuvsplit
yuvsplittoppm  $  $@
%.ppm : %.yuv
yuvtoppm  $  $@
-

--
Charles Howes -- [EMAIL PROTECTED]

Microsoft Magic Line, The: n; the curve on a price-performance chart defined by
the set of current shipping MS products.  New MS products shift the MML upward. 
Competitive products that fall below the MML become unmarketable and disappear. 
Hence, Microsoft is always the worst marketable solution for any real problem.




Re: Circular dependency dropping error

2000-07-12 Thread Paul D. Smith

%% 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?

  ch   % make asdf.ppm
  ch   make: Circular asdf.bmp - asdf.ppm dependency dropped.
  ch   ppmtobmpasdf.bmp
  ch   /bin/sh: -c: line 1: syntax error near unexpected token `'
  ch   /bin/sh: -c: line 1: `ppmtobmpasdf.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?

  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?

-- 
---
 Paul D. Smith [EMAIL PROTECTED]  Find some GNU make tips at:
 http://www.gnu.org  http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




Re: Circular dependency dropping error

2000-07-12 Thread Paul D. Smith

%% Regarding Re: Circular dependency dropping error; you wrote:

  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?

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

Not in the makefile you sent in your message.  There's a target %.gif
that can be built from %.ppm, but there's no implicit rule that shows
how to build anything (including %.ppm) from %.gif.

Either you overlooked it, or the makefile I received got truncated
somehow.

  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?

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

It's not clear how make would determine "useless".  What I would assume
is that make would pick the last dependency that caused the loop, and
throw it out.

-- 
---
 Paul D. Smith [EMAIL PROTECTED]  Find some GNU make tips at:
 http://www.gnu.org  http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist