PHOTOS_ORIG = $(wildcard *.orig.jpg) PHOTOS_MIN = $(patsubst %.orig.jpg,%.min.jpg,$(PHOTOS_ORIG)) MIN_WIDTH = 800 CONVERT_OPTIONS = -quality 75 all: $(PHOTOS_MIN) %.min.jpg: %.orig.jpg convert "$<" -size '$(MIN_WIDTH)x' $(CONVERT_OPTIONS) "$@" clean: rm -f *.min.jpg