Makefile 1020 B

1234567891011121314151617181920212223242526272829303132333435
  1. # Requires imagick
  2. gallery_name="Decrunch 2117"
  3. foto_path=../../www/decrunch.org/2117/foto/katod
  4. zip_name=2117
  5. edition=2117
  6. date=2-4 VI 2117
  7. author_link=//fb.me/katodmusic
  8. author_name=Katod
  9. img_full_dir=/2117/foto/katod
  10. img_thumb_dir=thumb
  11. gallery_opts=edition date gallery_name author_name author_link zip_name img_thumb_dir img_full_dir
  12. dir_guard=@mkdir -p $(@D)
  13. $(foto_path)/thumb/%.jpg: $(foto_path)/%.jpg
  14. $(dir_guard)
  15. @python thumbnailer.py $^
  16. $(foto_path)/$(zip_name).zip: $(foto_path)
  17. cd $(dir $(foto_path)); \
  18. zip $(notdir $@) $(addprefix $(notdir $(foto_path))/,$(notdir $(wildcard $(foto_path)/*.jpg)))
  19. thumb: $(addprefix $(foto_path)/thumb/, $(notdir $(wildcard $(foto_path)/*.jpg)))
  20. build/gallery.yaml: thumb
  21. @echo > $@
  22. @$(foreach name,$(gallery_opts),echo $(name): $($(name)) >> $@;)
  23. @echo 'pictures:' >> $@
  24. @\ls -1 $(foto_path)/thumb | sed 's/\(.*\)/ - "\1"/' >> $@
  25. $(foto_path)/index.html: build/gallery.yaml gallery.j2
  26. @j2 -f yaml gallery.j2 $< > $@
  27. all: $(foto_path)/index.html thumb