# This is free and unencumbered software released into the public # domain. To the extent possible under law, the author of this file # waives all copyright and related or neighboring rights to it. .DELETE_ON_ERROR: XCF2PNG ?= xcf2png %.png: %.xcf $(XCF2PNG) $< > $@ # First: xcf2png by default calls zcat rather than gzcat. This is # totally always broken; zcat forces a .Z extension on its input # filename. So we can't rely on xcf2png's default behavior. But it # offers -Z for a custom decompression program. # # BUT: Gimp produces gz files with some padding zeros because, I don't # know, someone might want to save their compressed xcfs to DECtape. # gzip has a -q option to not *print* the warning associated with this # harmless thing, but then goes ahead and exits non-zero anyway, which # makes xcf2png barf and die before writing anything even though it # got perfectly good data. # # So: 1) use gunzip, 2) manually feed it to xcf2png, 3) hope nothing is # set to die based on pipe status, 4) hope that if the xcf data is # actually busted xcf2png will do something helpful. %.png: %.xcf.gz gunzip -c $< | $(XCF2PNG) - > $@ .SECONDEXPANSION: ICONUTIL ?= $(firstword $(shell command -v iconutil icnsutil) iconutil) %.icns: %.iconset $$(wildcard $$(@D)/$$*.iconset/icon_*.png) $(ICONUTIL) -c icns -o $@ $< %.ico: %.iconset $$(wildcard $$(@D)/$$*.iconset/icon_*[0-9].png) convert -background transparent -colors 256 $(filter-out $<,$^) $@