1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00
putty-source/icons/Makefile
Simon Tatham b08895f02c New script to generate OS X icon files.
The Xcode icon composer doesn't seem to exist any more in modern
versions of Xcode, or at least if it does then it's well hidden and
certainly doesn't live at the top-level path at /Developer where web
pages still claim it can be found.

There is a free software 'libicns' and associated command-line tools,
but they're large, complicated, picky about the exact format of PNGs
they get as input, and in any case a needless extra build dependency
when it turns out the important parts of the file format can be done
in a few dozen lines of Python. So here's a new macicon.py, and
icons/Makefile additions to build a demo icon for OS X PuTTY, as and
when I finally get it working.

Also I've deleted the static icon file in the neglected 'macosx'
source directory, because this one is better anyway - the old one was
appalling quality, and must have been autogenerated from a single
image in some way.
2015-09-06 10:12:15 +01:00

105 lines
3.7 KiB
Makefile

# Makefile for the PuTTY icon suite.
ICONS = putty puttycfg puttygen pscp pageant pterm ptermcfg puttyins
SIZES = 16 32 48 128
MODE = # override to -it on command line for opaque testing
PNGS = $(foreach I,$(ICONS),$(foreach S,$(SIZES),$(I)-$(S).png))
MONOPNGS = $(foreach I,$(ICONS),$(foreach S,$(SIZES),$(I)-$(S)-mono.png))
TRUEPNGS = $(foreach I,$(ICONS),$(foreach S,$(SIZES),$(I)-$(S)-true.png))
ICOS = putty.ico puttygen.ico pscp.ico pageant.ico pageants.ico puttycfg.ico \
puttyins.ico
ICNS = PuTTY.icns
CICONS = xpmputty.c xpmpucfg.c xpmpterm.c xpmptcfg.c
base: icos cicons
all: pngs monopngs base icns # truepngs currently disabled by default
pngs: $(PNGS)
monopngs: $(MONOPNGS)
truepngs: $(TRUEPNGS)
icos: $(ICOS)
icns: $(ICNS)
cicons: $(CICONS)
install: icos cicons
cp $(ICOS) ../windows
cp $(CICONS) ../unix
$(PNGS): %.png: mkicon.py
./mkicon.py $(MODE) $(join $(subst -, ,$(basename $@)),_icon) $@
$(MONOPNGS): %.png: mkicon.py
./mkicon.py -2 $(MODE) $(join $(subst -, ,$(subst -mono,,$(basename $@))),_icon) $@
$(TRUEPNGS): %.png: mkicon.py
./mkicon.py -T $(MODE) $(join $(subst -, ,$(subst -true,,$(basename $@))),_icon) $@
putty.ico: putty-16.png putty-32.png putty-48.png \
putty-16-mono.png putty-32-mono.png putty-48-mono.png
./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
puttycfg.ico: puttycfg-16.png puttycfg-32.png puttycfg-48.png \
puttycfg-16-mono.png puttycfg-32-mono.png puttycfg-48-mono.png
./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
puttygen.ico: puttygen-16.png puttygen-32.png puttygen-48.png \
puttygen-16-mono.png puttygen-32-mono.png puttygen-48-mono.png
./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
pageant.ico: pageant-16.png pageant-32.png pageant-48.png \
pageant-16-mono.png pageant-32-mono.png pageant-48-mono.png
./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
pageants.ico: pageant-16.png pageant-16-mono.png
./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
pscp.ico: pscp-16.png pscp-32.png pscp-48.png \
pscp-16-mono.png pscp-32-mono.png pscp-48-mono.png
./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@
# Because the installer icon makes heavy use of brown when drawing
# the cardboard box, it's worth having 8-bit versions of it in
# addition to the 4- and 1-bit ones.
puttyins.ico: puttyins-16.png puttyins-32.png puttyins-48.png \
puttyins-16-mono.png puttyins-32-mono.png \
puttyins-48-mono.png \
puttyins-16-true.png puttyins-32-true.png \
puttyins-48-true.png
./icon.pl -8 $(filter %-true.png, $^) \
-4 $(filter-out %-true.png, $(filter-out %-mono.png, $^)) \
-1 $(filter %-mono.png, $^) > $@
# Icon for the website. (This isn't linked into "make all".)
website.ico: putty-16.png
./icon.pl -4 $^ >$@
xpmputty.c: putty-16.png putty-32.png putty-48.png
./cicon.pl main_icon $^ > $@
xpmpucfg.c: puttycfg-16.png puttycfg-32.png puttycfg-48.png
./cicon.pl cfg_icon $^ > $@
xpmpterm.c: pterm-16.png pterm-32.png pterm-48.png
./cicon.pl main_icon $^ > $@
xpmptcfg.c: ptermcfg-16.png ptermcfg-32.png ptermcfg-48.png
./cicon.pl cfg_icon $^ > $@
PuTTY.icns: putty-16-mono.png putty-16.png \
putty-32-mono.png putty-32.png \
putty-48-mono.png putty-48.png \
putty-128.png
./macicon.py mono:putty-16-mono.png colour:putty-16.png \
mono:putty-32-mono.png colour:putty-32.png \
mono:putty-48-mono.png colour:putty-48.png \
colour:putty-128.png \
output:$@
clean:
rm -f *.png *.ico *.icns *.c