Puzzled by Make

I know a fair bit about GNU Make, but this one has me stymied. The Makefile that rebuilds the Software Carpentry course notes contains the following definitions:

GFX_SUFFIX := gif jpg png
GFX_SRC := \
    $(foreach fmt,$(GFX_SUFFIX),\
      $(wildcard ./img/*.${fmt}) \
      $(wildcard ./lec/img/*/*.${fmt}) \
      $(foreach sitedir,${SITES}, \
        $(wildcard ./sites/${sitedir}/img/*.${fmt}) \
      ) \
GFX_WEB := $(subst ./,./web/,${GFX_SRC})

On all of the Linux and Windows (with Cygwin) machines I've used to date, this does the right thing: GFX_SRC is a list of all the image files in ./img and ./lec/img/*, and GFX_WEB has the same entries with ./web prefixed to them. (The SITES variable is empty, because I'm not building any site-specific content.)

But on my new Windows laptop (again with Cygwin), something goes wrong: Make misses two of the files in the lec/img/oop01 direcctory, and tries to copy one file from the lec/img/oop02 directory twice: once under lec/img/oop02, and once (incorrectly) under lec/img/oop01. Since this doesn't exist, Make reports an error and halts.

I've checked versions, and all five machines are using GNU Make 3.80. Is this a bug in Make? In the way I'm defining my variables? If so, why is it only triggered on the one box?

comments powered by Disqus