IMG=$(wildcard img/*.jpg)
THUMBS=$(patsubst img/%,thumbs/%,$(IMG))

index.html: $(THUMBS)
	./index.sh $^ > index.html

thumbs/%.jpg: img/%.jpg
	@mkdir -p thumbs
	magick "$<" -thumbnail x150 "$@"

gallery.tar.gz: index.html $(THUBMS)
	tar -czf gallery.tar.gz index.html img/ thumbs/

clean:
	rm -rf index.html thumbs/ gallery.tar.gz

.PHONY: clean
