-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
36 lines (28 loc) · 1.47 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
SIZES := 16 19 38 48 128
ICONNAMES := $(addprefix audible-dark-, $(SIZES)) $(addprefix audible-light-, $(SIZES)) $(addprefix muted-dark-, $(SIZES)) $(addprefix muted-light-, $(SIZES)) $(addprefix webstore-icon-, $(SIZES))
ICONS := $(addprefix images/, $(addsuffix .png, $(ICONNAMES)))
FILES := $(ICONS) $(shell git ls-files ':!:.gitignore' ':!:Makefile' ':!:images/' ':!:release.sh')
# inkscape >1.0 deprecates the -z (without-gui) flag and dropped
# support for the -e (export-filename) flag.
# TODO: stderr is redirected due to
# https://gitlab.com/inkscape/inbox/-/issues/3882; remove stderr
# redirection when resolved upstream.
INKSCAPE_EXPORT_FLAG := $(shell if inkscape --version 2> /dev/null | grep -qF "Inkscape 0."; then printf %s "-z -e"; else printf %s -o; fi)
.PHONY: zip
zip: out.zip
out.zip: $(FILES)
rm -f $@
zip -r $@ $^
# There's no good way to avoid duplicating the recipe here.
images/audible-dark-%.png: images/audible.svg
inkscape $(INKSCAPE_EXPORT_FLAG) $@ -w $* -h $* $<
images/muted-dark-%.png: images/muted.svg
inkscape $(INKSCAPE_EXPORT_FLAG) $@ -w $* -h $* $<
images/audible-light-%.png: images/audible-dark-%.png
convert $< -channel RGB -negate $@
images/muted-light-%.png: images/muted-dark-%.png
convert $< -channel RGB -negate $@
images/webstore-icon-128.png: images/muted.svg
convert $< -resize 90x90! -bordercolor white -border 3x3 -bordercolor none -border 16x16 $@
images/webstore-icon-%.png: images/webstore-icon-128.png
convert $< -resize $*x$* $@