-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (31 loc) · 903 Bytes
/
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
37
38
39
40
41
42
43
INKSCAPE=$(shell which inkscape)
define print_header
@echo
@echo "==> $(1)"
@echo
endef
define svg_to_png
@$(INKSCAPE) -z -e $(CURDIR)/$1/$(2).png -w $(3) -h $(3) $(CURDIR)/$(4) 1>/dev/null
@echo "convert $(4) to $(2).png"
endef
define convert
$(call svg_to_png,$(1),icon_$(2)x$(2),$(2),$(3))
$(call svg_to_png,$(1),icon_$(2)x$(2)@2x,$(shell echo $$(($2*2))),$(3))
endef
all: build install clean
Polymail.icns: Polymail.iconset
$(call print_header,"Create icon resource")
rm -f Polymail.icns
iconutil -c icns -o $@ $^
Polymail.iconset:
$(call print_header,"Convert svg to pngs")
mkdir -p $@
$(foreach size,16 32,$(call convert,$@,$(size),Icon64.svg))
$(foreach size,128 256 512,$(call convert,$@,$(size),Icon1024.svg))
build: clean Polymail.icns
clean:
rm -rf Polymail.iconset
install:
$(call print_header,"Install icns")
./install.sh Polymail.icns
.PHONY: all build clean install