From 53ddb4fb4d648231d0ed4f1cd445e3505bef78ca Mon Sep 17 00:00:00 2001 From: Ulli Kehrle Date: Wed, 21 Apr 2021 02:29:13 +0200 Subject: [PATCH] Logos: generiere ico/icns aus pngs, die direkt aus inkscape stammen --- grafik/logos/Makefile | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/grafik/logos/Makefile b/grafik/logos/Makefile index 583d751e..0eecdfa6 100644 --- a/grafik/logos/Makefile +++ b/grafik/logos/Makefile @@ -1,18 +1,26 @@ -LAYOUTS = neo neoqwertz bone -ICOFILES = $(addsuffix -icon.ico, ${LAYOUTS}) -ICNSFILES = $(addsuffix -icon.ico, ${LAYOUTS}) +LAYOUTS=neo neoqwertz bone +ICOFILES=$(addsuffix .ico, ${LAYOUTS}) +ICNSFILES = $(addsuffix .icns, ${LAYOUTS}) +ICONSIZES=16 32 48 128 256 +SMALLICONPNGS=$(foreach layout, ${LAYOUTS}, $(foreach size, ${ICONSIZES}, ${layout}-smallicon-${size}.png)) -EXTRACLEAN = ${ICOFILES} ${ICNSFILES} - -all: default ico +EXTRACLEAN = ${ICOFILES} ${ICNSFILES} ${SMALLICONPNGS} +all: default ico icns ico: ${ICOFILES} +icns: ${ICNSFILES} + +define GENERATE_RULES +${1}-smallicon-%.png: ${1}-icon.svg + inkscape --export-filename=$$@ --export-height=$$* $$< -ico: ${ICNSFILES} +${1}.ico: $(foreach size, ${ICONSIZES}, ${1}-smallicon-${size}.png) + convert $$^ $$@ -%.ico: %.png - convert $< -define icon:auto-resize=16,32,48,128,256 $@ +${1}.icns: $(foreach size, ${ICONSIZES}, ${1}-smallicon-${size}.png) + png2icns $$@ $$^ +endef -# TODO: find a way to generate icns icons a normal loonix machine +$(foreach layout, ${LAYOUTS}, $(eval $(call GENERATE_RULES, ${layout}))) include ../common.mk