]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - icons/Makefile
New script to generate OS X icon files.
[PuTTY.git] / icons / Makefile
1 # Makefile for the PuTTY icon suite.
2
3 ICONS = putty puttycfg puttygen pscp pageant pterm ptermcfg puttyins
4 SIZES = 16 32 48 128
5
6 MODE = # override to -it on command line for opaque testing
7
8 PNGS = $(foreach I,$(ICONS),$(foreach S,$(SIZES),$(I)-$(S).png))
9 MONOPNGS = $(foreach I,$(ICONS),$(foreach S,$(SIZES),$(I)-$(S)-mono.png))
10 TRUEPNGS = $(foreach I,$(ICONS),$(foreach S,$(SIZES),$(I)-$(S)-true.png))
11
12 ICOS = putty.ico puttygen.ico pscp.ico pageant.ico pageants.ico puttycfg.ico \
13        puttyins.ico
14 ICNS = PuTTY.icns
15 CICONS = xpmputty.c xpmpucfg.c xpmpterm.c xpmptcfg.c
16
17 base: icos cicons
18
19 all: pngs monopngs base icns # truepngs currently disabled by default
20
21 pngs: $(PNGS)
22 monopngs: $(MONOPNGS)
23 truepngs: $(TRUEPNGS)
24
25 icos: $(ICOS)
26 icns: $(ICNS)
27 cicons: $(CICONS)
28
29 install: icos cicons
30         cp $(ICOS) ../windows
31         cp $(CICONS) ../unix
32
33 $(PNGS): %.png: mkicon.py
34         ./mkicon.py $(MODE) $(join $(subst -, ,$(basename $@)),_icon) $@
35
36 $(MONOPNGS): %.png: mkicon.py
37         ./mkicon.py -2 $(MODE) $(join $(subst -, ,$(subst -mono,,$(basename $@))),_icon) $@
38
39 $(TRUEPNGS): %.png: mkicon.py
40         ./mkicon.py -T $(MODE) $(join $(subst -, ,$(subst -true,,$(basename $@))),_icon) $@
41
42 putty.ico: putty-16.png putty-32.png putty-48.png \
43            putty-16-mono.png putty-32-mono.png putty-48-mono.png
44         ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
45
46 puttycfg.ico: puttycfg-16.png puttycfg-32.png puttycfg-48.png \
47               puttycfg-16-mono.png puttycfg-32-mono.png puttycfg-48-mono.png
48         ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
49
50 puttygen.ico: puttygen-16.png puttygen-32.png puttygen-48.png \
51               puttygen-16-mono.png puttygen-32-mono.png puttygen-48-mono.png
52         ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
53
54 pageant.ico: pageant-16.png pageant-32.png pageant-48.png \
55              pageant-16-mono.png pageant-32-mono.png pageant-48-mono.png
56         ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
57
58 pageants.ico: pageant-16.png pageant-16-mono.png
59         ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
60
61 pscp.ico: pscp-16.png pscp-32.png pscp-48.png \
62           pscp-16-mono.png pscp-32-mono.png pscp-48-mono.png
63         ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
64
65 # Because the installer icon makes heavy use of brown when drawing
66 # the cardboard box, it's worth having 8-bit versions of it in
67 # addition to the 4- and 1-bit ones.
68 puttyins.ico: puttyins-16.png puttyins-32.png puttyins-48.png \
69               puttyins-16-mono.png puttyins-32-mono.png \
70               puttyins-48-mono.png \
71               puttyins-16-true.png puttyins-32-true.png \
72               puttyins-48-true.png
73         ./icon.pl -8 $(filter %-true.png, $^) \
74                   -4 $(filter-out %-true.png, $(filter-out %-mono.png, $^)) \
75                   -1 $(filter %-mono.png, $^) > $@
76
77 # Icon for the website. (This isn't linked into "make all".)
78 website.ico: putty-16.png
79         ./icon.pl -4 $^ >$@
80
81 xpmputty.c: putty-16.png putty-32.png putty-48.png
82         ./cicon.pl main_icon $^ > $@
83
84 xpmpucfg.c: puttycfg-16.png puttycfg-32.png puttycfg-48.png
85         ./cicon.pl cfg_icon $^ > $@
86
87 xpmpterm.c: pterm-16.png pterm-32.png pterm-48.png
88         ./cicon.pl main_icon $^ > $@
89
90 xpmptcfg.c: ptermcfg-16.png ptermcfg-32.png ptermcfg-48.png
91         ./cicon.pl cfg_icon $^ > $@
92
93 PuTTY.icns: putty-16-mono.png putty-16.png \
94             putty-32-mono.png putty-32.png \
95             putty-48-mono.png putty-48.png \
96             putty-128.png
97         ./macicon.py mono:putty-16-mono.png colour:putty-16.png \
98                      mono:putty-32-mono.png colour:putty-32.png \
99                      mono:putty-48-mono.png colour:putty-48.png \
100                                             colour:putty-128.png \
101                 output:$@
102
103 clean:
104         rm -f *.png *.ico *.icns *.c