comparison Makefile.gen @ 279:770d1ea07a49

Add LOGO_SIZE Makefile variable.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 18 Apr 2023 13:43:35 +0300
parents d1f34cbc306e
children 755fe3f8c08f
comparison
equal deleted inserted replaced
278:f12718986d31 279:770d1ea07a49
66 LOGO_SVG ?= kampuscafe4.svg 66 LOGO_SVG ?= kampuscafe4.svg
67 LOGO_SRC_PNG ?= CafeKampus_logo_FINAL_RGB.png 67 LOGO_SRC_PNG ?= CafeKampus_logo_FINAL_RGB.png
68 68
69 ICON_PNGS = icon-64.png icon-48.png icon-32.png icon-16.png 69 ICON_PNGS = icon-64.png icon-48.png icon-32.png icon-16.png
70 LOGO_PNG = logo.png 70 LOGO_PNG = logo.png
71 LOGO_SIZE = 256
71 72
72 APP_RESOURCES += $(addprefix $(APP_IMG),$(LOGO_PNG) $(ICON_PNGS)) \ 73 APP_RESOURCES += $(addprefix $(APP_IMG),$(LOGO_PNG) $(ICON_PNGS)) \
73 COPYING.html 74 COPYING.html
74 75
75 DISTCLEAN_TARGETS += $(addprefix $(APP_IMG),$(LOGO_PNG) $(ICON_PNGS)) 76 DISTCLEAN_TARGETS += $(addprefix $(APP_IMG),$(LOGO_PNG) $(ICON_PNGS))
163 ifneq ($(LOGO_SRC_SVG),) 164 ifneq ($(LOGO_SRC_SVG),)
164 $(APP_IMG)icon-%.png: $(APP_IMG)$(LOGO_SRC_SVG) 165 $(APP_IMG)icon-%.png: $(APP_IMG)$(LOGO_SRC_SVG)
165 inkscape --export-area-page --export-type=png -w $(patsubst $(APP_IMG)icon-%.png,%,$@) -h $(patsubst $(APP_IMG)icon-%.png,%,$@) --export-filename="$@" "$<" 166 inkscape --export-area-page --export-type=png -w $(patsubst $(APP_IMG)icon-%.png,%,$@) -h $(patsubst $(APP_IMG)icon-%.png,%,$@) --export-filename="$@" "$<"
166 167
167 $(APP_IMG)$(LOGO_PNG): $(APP_IMG)$(LOGO_SRC_SVG) 168 $(APP_IMG)$(LOGO_PNG): $(APP_IMG)$(LOGO_SRC_SVG)
168 inkscape --export-area-page --export-type=png -w 256 -h 256 --export-filename="$@" "$<" 169 inkscape --export-area-page --export-type=png -w $(LOGO_SIZE) -h $(LOGO_SIZE) --export-filename="$@" "$<"
169 else 170 else
170 $(APP_IMG)icon-%.png: $(APP_IMG)$(LOGO_SRC_PNG) 171 $(APP_IMG)icon-%.png: $(APP_IMG)$(LOGO_SRC_PNG)
171 convert "$<" -scale "$(patsubst $(APP_IMG)icon-%.png,%,$@)x$(patsubst $(APP_IMG)icon-%.png,%,$@)" "$@" 172 convert "$<" -scale "$(patsubst $(APP_IMG)icon-%.png,%,$@)x$(patsubst $(APP_IMG)icon-%.png,%,$@)" "$@"
172 173
173 $(APP_IMG)$(LOGO_PNG): $(APP_IMG)$(LOGO_SRC_PNG) 174 $(APP_IMG)$(LOGO_PNG): $(APP_IMG)$(LOGO_SRC_PNG)
174 convert "$<" -scale "256x256" "$@" 175 convert "$<" -scale "$(LOGO_SIZE)x$(LOGO_SIZE)" "$@"
175 endif 176 endif
176 177
177 icon.ico: $(addprefix $(APP_IMG),$(ICON_PNGS)) 178 icon.ico: $(addprefix $(APP_IMG),$(ICON_PNGS))
178 @$(call DO_CMD,CONVERT,$+ -> $@,convert $+ $@) 179 @$(call DO_CMD,CONVERT,$+ -> $@,convert $+ $@)
179 180