Reputation: 21
please I need your help!
In order to get a list of thumbnails associated with a list of photos, I've use the following Makefile (the project's directory has 2 subdirectories thumbs and pictures)
all: $(patsubst pictures/%.jpg, thumbs/%.jpg, $(wilcard pictures/*.jpg))
thumbs/%.jpg: pictures/%.jpg
convert -thumbnail 100 $< $*
The problem is that I always get the same error message "Nothing to be done for 'all'", as if there was no dependencies. :( Has anybody an explanation for that?
Upvotes: 1
Views: 1991
Reputation: 119106
It is a simple typo: just add the missing d to $(wildcard ...)
Make does not throw an error when you make a call to a function that does not exist, so the result of that function call is simply an empty string. This makes your all
target have no dependencies, and there you are!
For future reference, I found this error by adding the following line at the beginning of the makefile:
$(info $(patsubst pictures/%.jpg, thumbs/%.jpg, $(wilcard pictures/*.jpg)))
The $(info ...)
function will print out to the console, which can be very useful for debugging. In this case, it printed a blank line. To debug further, I tried this:
$(info $(wilcard pictures/*.jpg))
Which also dumped an empty string. At that point, all it took was some careful squinting :)
Upvotes: 4