1 | IMG_SOURCES = $(shell find images -name '*.svg')
|
---|
2 | IMG_TARGETS = $(patsubst %.svg,../data/%.png,$(IMG_SOURCES))
|
---|
3 | ICONS = _16.png _24.png _32.png _48.png _64.png _128.png .xpm .icns .ico
|
---|
4 | ICO_TARGETS = $(patsubst %,../data/icons/werewolf-sonata%,$(ICONS))
|
---|
5 | OPTIMIZE = 1
|
---|
6 |
|
---|
7 | all: $(IMG_TARGETS) $(ICO_TARGETS)
|
---|
8 |
|
---|
9 | clean:
|
---|
10 | rm -f $(IMG_TARGETS)
|
---|
11 |
|
---|
12 | ../data/%.png: %.svg
|
---|
13 | mkdir -p $(dir $@)
|
---|
14 | inkscape --export-png $@ --export-dpi 9 $<
|
---|
15 | ifeq ($(OPTIMIZE),1)
|
---|
16 | optipng -o4 -preserve $@
|
---|
17 | advpng -z4 $@
|
---|
18 | endif
|
---|
19 |
|
---|
20 | ../data/icons/%_1024.png: icons/%.svg
|
---|
21 | inkscape --export-png $@ --export-width 1024 --export-height 1024 $<
|
---|
22 |
|
---|
23 | ../data/icons/%_512.png: icons/%.svg
|
---|
24 | inkscape --export-png $@ --export-width 512 --export-height 512 $<
|
---|
25 |
|
---|
26 | ../data/icons/%_256.png: icons/%.svg
|
---|
27 | inkscape --export-png $@ --export-width 256 --export-height 256 $<
|
---|
28 | ifeq ($(OPTIMIZE),1)
|
---|
29 | optipng -o4 -preserve $@
|
---|
30 | advpng -z4 $@
|
---|
31 | endif
|
---|
32 |
|
---|
33 | ../data/icons/%_128.png: icons/%.svg
|
---|
34 | inkscape --export-png $@ --export-width 128 --export-height 128 $<
|
---|
35 | ifeq ($(OPTIMIZE),1)
|
---|
36 | optipng -o4 -preserve $@
|
---|
37 | advpng -z4 $@
|
---|
38 | endif
|
---|
39 |
|
---|
40 | ../data/icons/%_64.png: icons/%.svg
|
---|
41 | inkscape --export-png $@ --export-width 64 --export-height 64 $<
|
---|
42 | ifeq ($(OPTIMIZE),1)
|
---|
43 | optipng -o4 -preserve $@
|
---|
44 | advpng -z4 $@
|
---|
45 | endif
|
---|
46 |
|
---|
47 | ../data/icons/%_48.png: icons/%.svg
|
---|
48 | inkscape --export-png $@ --export-width 48 --export-height 48 $<
|
---|
49 |
|
---|
50 | ../data/icons/%_32.png: icons/%.svg
|
---|
51 | inkscape --export-png $@ --export-width 32 --export-height 32 $<
|
---|
52 | ifeq ($(OPTIMIZE),1)
|
---|
53 | optipng -o4 -preserve $@
|
---|
54 | advpng -z4 $@
|
---|
55 | endif
|
---|
56 |
|
---|
57 | ../data/icons/%_24.png: icons/%.svg
|
---|
58 | inkscape --export-png $@ --export-width 24 --export-height 24 $<
|
---|
59 | ifeq ($(OPTIMIZE),1)
|
---|
60 | optipng -o4 -preserve $@
|
---|
61 | advpng -z4 $@
|
---|
62 | endif
|
---|
63 |
|
---|
64 | ../data/icons/%_16.png: icons/%.svg
|
---|
65 | inkscape --export-png $@ --export-width 16 --export-height 16 $<
|
---|
66 | ifeq ($(OPTIMIZE),1)
|
---|
67 | optipng -o4 -preserve $@
|
---|
68 | advpng -z4 $@
|
---|
69 | endif
|
---|
70 |
|
---|
71 | %.xpm: %_32.png
|
---|
72 | convert $< $@
|
---|
73 |
|
---|
74 | %.icns: %_16.png %_32.png %_48.png %_128.png %_256.png %_512.png %_1024.png
|
---|
75 | png2icns $@ $^
|
---|
76 |
|
---|
77 | %.ico: %_16.png %_32.png %_64.png %_48.png %_128.png %_256.png
|
---|
78 | icotool -c -o $@ $(filter-out %_256.png,$^) --raw=$(filter %_256.png,$^)
|
---|