changeset 275:d1f34cbc306e

Improve logo/icons intermediate building process.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 04 Apr 2023 12:03:38 +0300
parents 19f4b2c31f39
children 49a484ad1155
files Makefile.gen
diffstat 1 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.gen	Tue Apr 04 11:24:37 2023 +0300
+++ b/Makefile.gen	Tue Apr 04 12:03:38 2023 +0300
@@ -64,10 +64,16 @@
 	runguard.o
 
 LOGO_SVG ?= kampuscafe4.svg
-LOGO_IMG ?= CafeKampus_logo_FINAL_RGB.png
+LOGO_SRC_PNG ?= CafeKampus_logo_FINAL_RGB.png
+
 ICON_PNGS = icon-64.png icon-48.png icon-32.png icon-16.png
+LOGO_PNG = logo.png
 
-APP_RESOURCES += $(addprefix $(APP_IMG),logo.png $(ICON_PNGS)) COPYING.html
+APP_RESOURCES += $(addprefix $(APP_IMG),$(LOGO_PNG) $(ICON_PNGS)) \
+	COPYING.html
+
+DISTCLEAN_TARGETS += $(addprefix $(APP_IMG),$(LOGO_PNG) $(ICON_PNGS))
+
 
 # And target lists
 TARGETS = $(APP_BIN)
@@ -154,17 +160,19 @@
 ###
 ### Application rules
 ###
-#$(APP_IMG)icon-%.png: $(APP_IMG)$(LOGO_SVG)
-#	inkscape --export-area-page -w $(patsubst $(APP_IMG)icon-%.png,%,$@) -h $(patsubst $(APP_IMG)icon-%.png,%,$@) -e "$@" "$<"
+ifneq ($(LOGO_SRC_SVG),)
+$(APP_IMG)icon-%.png: $(APP_IMG)$(LOGO_SRC_SVG)
+	inkscape --export-area-page --export-type=png -w $(patsubst $(APP_IMG)icon-%.png,%,$@) -h $(patsubst $(APP_IMG)icon-%.png,%,$@) --export-filename="$@" "$<"
 
-#$(APP_IMG)logo.png: $(APP_IMG)$(LOGO_SVG)
-#	inkscape --export-area-page -w 258 -h 220 -e "$@" "$<"
-
-$(APP_IMG)icon-%.png: $(APP_IMG)$(LOGO_IMG)
+$(APP_IMG)$(LOGO_PNG): $(APP_IMG)$(LOGO_SRC_SVG)
+	inkscape --export-area-page --export-type=png -w 256 -h 256 --export-filename="$@" "$<"
+else
+$(APP_IMG)icon-%.png: $(APP_IMG)$(LOGO_SRC_PNG)
 	convert "$<" -scale "$(patsubst $(APP_IMG)icon-%.png,%,$@)x$(patsubst $(APP_IMG)icon-%.png,%,$@)" "$@"
 
-$(APP_IMG)logo.png: $(APP_IMG)$(LOGO_IMG)
-	convert "$<" -scale "258x220" "$@"
+$(APP_IMG)$(LOGO_PNG): $(APP_IMG)$(LOGO_SRC_PNG)
+	convert "$<" -scale "256x256" "$@"
+endif
 
 icon.ico: $(addprefix $(APP_IMG),$(ICON_PNGS))
 	@$(call DO_CMD,CONVERT,$+ -> $@,convert $+ $@)