- progressive jpegs
[Photos2Atom.git] / Makefile
blob9ba5f2153a818e715c12cc9c7a5ad2dd25957cc3
2 # Example
4 # $ make title='My Photos' base='https://example.com/sub/my-photos'
6 # See http://purl.mro.name/Photos2Atom
9 .PHONY: all build clean large thumb
11 _build/200/%: src/%
12 @-mkdir -p _build/200
13 @# https://www.smashingmagazine.com/2015/06/efficient-image-resizing-with-imagemagick/
14 @# https://www.linuxquestions.org/questions/linux-software-2/question-about-thumbnail-orientation-dimensions-with-imagemagick-493034/
15 convert $< -thumbnail 200x200 -quality 30% -auto-orient -strip -define png:exclude-chunk=all -interlace Plane $@
16 @touch -r "$<" "$@"
18 _build/1200/%: src/%
19 @-mkdir -p _build/1200
20 convert $< -resize 1200x1200\> -quality 82% -auto-orient -strip -define png:exclude-chunk=all -interlace Plane $@
21 @touch -r "$<" "$@"
23 build: _build/index.xml
25 all: build
27 clean:
28 rm -rf _build
30 SRC := $(wildcard src/*)
32 thumb: $(patsubst src/%,_build/200/%,${SRC})
33 large: $(patsubst src/%,_build/1200/%,${SRC})
35 _build/index.xml.raw: thumb large
36 sh ./atom.sh '$(title)' '$(base)' ${SRC} > $@
38 _build/index.xml: rfc4287.rng _build/index.xml.raw
39 xmllint --format --encode utf-8 --nocdata --nonet --output $@ --relaxng $^