1 # Original workspace files in the 'src' dir (not in the git repo) 2 3 # Inkscape fails to convert SVG to small PNG (it omits parts of the image). 4 # For this reason, we create a big PNG, then convert it to smaller ones. 5 6 SRC = hicolor/scalable/apps/photocollage.svg 7 BIG = hicolor/256x256/apps/photocollage.png 8 SMALL := $(shell for s in 16 22 24 32 48 64 128; do \ 9 echo hicolor/$${s}x$${s}/apps/photocollage.png; done) 10 11 all: $(BIG) $(SMALL) 12 13 $(BIG): $(SRC) 14 $(eval SIZE := $(shell echo $@ | cut -d/ -f2)) 15 @echo " SVG -> PNG $(SIZE)" 16 @mkdir -p $(shell dirname $@) 17 @inkscape -z -e $@ -w 256 -h 256 $< >/dev/null 18 19 $(SMALL): $(BIG) 20 $(eval SIZE := $(shell echo $@ | cut -d/ -f2)) 21 @echo " PNG -> PNG $(SIZE)" 22 @mkdir -p $(shell dirname $@) 23 @convert $< -resize $(SIZE) $@ 24 25 .PHONY: clean 26 clean: 27 rm -f $(BIG) $(SMALL)