Makefile 4.8 KB

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