Buildscr 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. # -*- sh -*-
  2. # Build script to construct a full distribution directory of PuTTY.
  3. module putty
  4. # Start by figuring out what our version information looks like.
  5. #
  6. # There are four classes of PuTTY build:
  7. # - a release, which just has an X.YY version number
  8. # - a prerelease, which has an X.YY version number, plus a date and
  9. # version control commit id (and is considered to be 'almost'
  10. # version X.YY)
  11. # - a development snapshot, which just has a date and commit id
  12. # - a custom build, which also has a date and commit id (but is
  13. # labelled differently, to stress that development snapshots are
  14. # built from the checked-in code by the automated nightly script
  15. # whereas custom builds are made manually, perhaps from uncommitted
  16. # changes, e.g. to send to a user for diagnostic or testing
  17. # purposes).
  18. #
  19. # The four classes of build are triggered by invoking bob with
  20. # different command-line variable definitions:
  21. #
  22. # - RELEASE=X.YY makes a release build
  23. # - PRERELEASE=X.YY makes a prerelease build (combined with the build
  24. # date and VCS info)
  25. # - setting SNAPSHOT to any non-empty string makes a development
  26. # snapshot
  27. # - setting none of these makes a custom build.
  28. # If we need a date for our build, start by computing it in the
  29. # various forms we need. $(Ndate) is the date in purely numeric form
  30. # (YYYYMMDD); $(Date) is separated as YYYY-MM-DD; $(Days) is the
  31. # number of days since the epoch.
  32. ifeq "$(RELEASE)" "" set Ndate $(!builddate)
  33. ifneq "$(Ndate)" "" in . do echo $(Ndate) | perl -pe 's/(....)(..)(..)/$$1-$$2-$$3/' > date
  34. ifneq "$(Ndate)" "" read Date date
  35. set Epoch 18819 # update this at every release
  36. ifneq "$(Ndate)" "" in . do echo $(Ndate) | perl -ne 'use Time::Local; /(....)(..)(..)/ and print timegm(0,0,0,$$3,$$2-1,$$1) / 86400 - $(Epoch)' > days
  37. ifneq "$(Ndate)" "" read Days days
  38. # For any non-release, we're going to need the number of the prior
  39. # release, for putting in various places so as to get monotonic
  40. # comparisons with the surrounding actual releases.
  41. ifeq "$(RELEASE)" "" read Lastver putty/LATEST.VER
  42. # Set up the textual version strings for the docs build and installers.
  43. # We have one of these including the word 'PuTTY', and one without,
  44. # which are inconveniently capitalised differently.
  45. ifneq "$(RELEASE)" "" set Puttytextver PuTTY release $(RELEASE)
  46. ifneq "$(RELEASE)" "" set Textver Release $(RELEASE)
  47. ifneq "$(PRERELEASE)" "" set Puttytextver PuTTY pre-release $(PRERELEASE):$(Date).$(vcsid)
  48. ifneq "$(PRERELEASE)" "" set Textver Pre-release $(PRERELEASE):$(Date).$(vcsid)
  49. ifneq "$(SNAPSHOT)" "" set Puttytextver PuTTY development snapshot $(Date).$(vcsid)
  50. ifneq "$(SNAPSHOT)" "" set Textver Development snapshot $(Date).$(vcsid)
  51. ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Puttytextver PuTTY custom build $(Date).$(vcsid)
  52. ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Textver Custom build $(Date).$(vcsid)
  53. in putty/doc do echo "\\\\versionid $(Puttytextver)" > version.but
  54. # Set up the version string for use in the SSH connection greeting.
  55. #
  56. # We use $(Ndate) rather than $(Date) in the pre-release string to
  57. # make sure it's under 40 characters, which is a hard limit in the SSH
  58. # protocol spec (and enforced by a compile-time assertion in
  59. # version.c).
  60. ifneq "$(RELEASE)" "" set Sshver -Release-$(RELEASE)
  61. ifneq "$(PRERELEASE)" "" set Sshver -Prerelease-$(PRERELEASE):$(Ndate).$(vcsid)
  62. ifneq "$(SNAPSHOT)" "" set Sshver -Snapshot-$(Date).$(vcsid)
  63. ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Sshver -Custom-$(Date).$(vcsid)
  64. # Set up the filename suffix for the Unix source archive.
  65. ifneq "$(RELEASE)" "" set Uxarcsuffix -$(RELEASE)
  66. ifneq "$(PRERELEASE)" "" set Uxarcsuffix -$(PRERELEASE)~pre$(Ndate).$(vcsid)
  67. ifneq "$(SNAPSHOT)" "" set Uxarcsuffix -$(Lastver)-$(Date).$(vcsid)
  68. ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Uxarcsuffix -custom-$(Date).$(vcsid)
  69. # Set up the filenames for the Windows installers (minus extension,
  70. # which goes on later).
  71. ifneq "$(RELEASE)" "" set Isuffix $(RELEASE)-installer
  72. ifneq "$(PRERELEASE)" "" set Isuffix $(PRERELEASE)-pre$(Ndate)-installer
  73. ifneq "$(SNAPSHOT)" "" set Isuffix $(Date)-installer
  74. ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Isuffix custom-$(Date)-installer
  75. set Ifilename32 putty-$(Isuffix)
  76. set Ifilename64 putty-64bit-$(Isuffix)
  77. set Ifilenamea32 putty-arm32-$(Isuffix)
  78. set Ifilenamea64 putty-arm64-$(Isuffix)
  79. # Set up the Windows version resource info, for both the installers and
  80. # the individual programs. This must be a sequence of four 16-bit
  81. # integers compared lexicographically, and we define it as follows:
  82. #
  83. # For release X.YY: X.YY.0.0
  84. # For a prerelease before the X.YY release: (X.YY-1).(DDDDD + 0x8000).0
  85. # For a devel snapshot after the X.YY release: X.YY.DDDDD.0
  86. # For a custom build: X.YY.DDDDD.1
  87. #
  88. # where DDDDD is a representation of the build date, in the form of a
  89. # number of days since an epoch date. The epoch is reset at every
  90. # release (which, with 15 bits, gives us a comfortable 80-odd years
  91. # before it becomes vital to make another release to reset the count
  92. # :-).
  93. ifneq "$(RELEASE)" "" in . do echo $(RELEASE).0.0 > winver
  94. ifneq "$(PRERELEASE)" "" in . do perl -e 'printf "%s.%d.0", $$ARGV[0], 0x8000+$$ARGV[1]' $(Lastver) $(Days) > winver
  95. ifneq "$(SNAPSHOT)" "" in . do perl -e 'printf "%s.%d.0", $$ARGV[0], $$ARGV[1]' $(Lastver) $(Days) > winver
  96. ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" in . do perl -e 'printf "%s.%d.1", $$ARGV[0], $$ARGV[1]' $(Lastver) $(Days) > winver
  97. in . do perl -pe 'y!.!,!' winver > winvercommas
  98. read Winver winver
  99. read Winvercommas winvercommas
  100. # Write out a version.h that contains the real version number.
  101. in putty do echo '/* Generated by automated build script */' > version.h
  102. ifneq "$(RELEASE)" "" in putty do echo '$#define RELEASE $(RELEASE)' >> version.h
  103. ifneq "$(PRERELEASE)" "" in putty do echo '$#define PRERELEASE $(PRERELEASE)' >> version.h
  104. ifneq "$(SNAPSHOT)" "" in putty do echo '$#define SNAPSHOT' >> version.h
  105. in putty do echo '$#define TEXTVER "$(Textver)"' >> version.h
  106. in putty do echo '$#define SSHVER "$(Sshver)"' >> version.h
  107. in putty do echo '$#define BINARY_VERSION $(Winvercommas)' >> version.h
  108. # In cmake/gitcommit.cmake, replace the default output "unavailable"
  109. # with the commit string generated by bob, so that people rebuilding
  110. # the source archive will still get a useful value.
  111. in putty do sed -i '/set(DEFAULT_COMMIT/s/unavailable/$(vcsfullid)/' cmake/gitcommit.cmake
  112. in . do mkdir docbuild
  113. in docbuild do cmake ../putty/doc
  114. in docbuild do make -j$(nproc) VERBOSE=1
  115. in putty/doc do cp ../../docbuild/*.1 .
  116. in putty/doc do cp ../../docbuild/puttydoc.txt .
  117. in putty/doc do cp ../../docbuild/putty.chm .
  118. in putty/doc do cp -r ../../docbuild/html .
  119. in putty do ./mksrcarc.sh
  120. in putty do ./mkunxarc.sh '$(Uxarcsuffix)'
  121. delegate -
  122. # Run the test suite, under self-delegation so that we don't leave any
  123. # cruft lying around. This involves doing a build of the Unix tools
  124. # (which is a useful double-check anyway to pick up any build failures)
  125. in putty do cmake . -DCMAKE_C_COMPILER=clang -DCMAKE_C_FLAGS="-fsanitize=address -fsanitize=leak" -DSTRICT=ON
  126. in putty do make -j$(nproc) VERBOSE=1
  127. in putty do python3 test/cryptsuite.py
  128. in putty do ./test_lineedit
  129. in putty do ./test_terminal
  130. in putty do ./test_conf
  131. enddelegate
  132. delegate -
  133. # Also, test-build the Windows tools using MinGW. This is important if
  134. # we want the MinGW build to carry on working, partly because of the
  135. # chance of compiler compatibility issues, but mostly because MinGW's
  136. # linker uses Unix-style library search semantics (once down the
  137. # library list), and no other Windows toolchain we build with is that
  138. # picky. So this ensures the Windows library structure continues to
  139. # work in the most difficult circumstance we expect it to encounter.
  140. in putty do cmake . -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw.cmake -DSTRICT=ON
  141. in putty do make -j$(nproc) VERBOSE=1
  142. enddelegate
  143. # Windowsify LICENCE, since it's going in the Windows installers.
  144. in putty do perl -i~ -pe 'y/\015//d;s/$$/\015/' LICENCE
  145. # Some gratuitous theming for the MSI installer UI.
  146. in putty/icons do make -j$(nproc)
  147. in putty do ./windows/make_install_images.sh
  148. mkdir putty/windows/build32
  149. mkdir putty/windows/build64
  150. mkdir putty/windows/buildold
  151. mkdir putty/windows/abuild32
  152. mkdir putty/windows/abuild64
  153. # Build the binaries to go in the installers, in both 32- and 64-bit
  154. # flavours.
  155. #
  156. # For the 32-bit ones, we set a subsystem version of 5.01, which
  157. # allows the resulting files to still run on Windows XP.
  158. in putty/windows/build32 with cmake_at_least_3.20 do cmake ../.. -DCMAKE_TOOLCHAIN_FILE=$(cmake_toolchain_clangcl32) -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPUTTY_LINK_MAPS=ON -DCMAKE_C_FLAGS_RELEASE="/MT /O2" -DPUTTY_SUBSYSTEM_VERSION=5.01 -DSTRICT=ON
  159. in putty/windows/build32 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1
  160. in putty/windows/build64 with cmake_at_least_3.20 do cmake ../.. -DCMAKE_TOOLCHAIN_FILE=$(cmake_toolchain_clangcl64) -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPUTTY_LINK_MAPS=ON -DCMAKE_C_FLAGS_RELEASE="/MT /O2" -DSTRICT=ON
  161. in putty/windows/build64 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1
  162. # The cmake mechanism used to set the subsystem version is a bit of a
  163. # bodge (it depends on knowing how cmake set up all its build command
  164. # variables), so just in case it breaks in future, double-check we
  165. # really did get the subsystem version we wanted.
  166. in putty/windows/build32 do objdump -x putty.exe > exe-headers.txt
  167. in putty/windows/build32 do grep -Ex 'MajorOSystemVersion[[:space:]]+5' exe-headers.txt
  168. in putty/windows/build32 do grep -Ex 'MinorOSystemVersion[[:space:]]+1' exe-headers.txt
  169. in putty/windows/build32 do grep -Ex 'MajorSubsystemVersion[[:space:]]+5' exe-headers.txt
  170. in putty/windows/build32 do grep -Ex 'MinorSubsystemVersion[[:space:]]+1' exe-headers.txt
  171. # Build experimental Arm Windows binaries.
  172. in putty/windows/abuild32 with cmake_at_least_3.20 do cmake ../.. -DCMAKE_TOOLCHAIN_FILE=$(cmake_toolchain_clangcl_a32) -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPUTTY_LINK_MAPS=ON -DCMAKE_C_FLAGS_RELEASE="/MT /O2" -DSTRICT=ON
  173. in putty/windows/abuild32 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1
  174. in putty/windows/abuild64 with cmake_at_least_3.20 do cmake ../.. -DCMAKE_TOOLCHAIN_FILE=$(cmake_toolchain_clangcl_a64) -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPUTTY_LINK_MAPS=ON -DCMAKE_C_FLAGS_RELEASE="/MT /O2" -DSTRICT=ON
  175. in putty/windows/abuild64 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1
  176. # Make a list of the Windows binaries we're going to ship, so that we
  177. # can sign them.
  178. in putty/windows do for subdir in build32 abuild32 build64 abuild64; do sed "s!^!$$subdir/!" $$subdir/shipped.txt; done > to-sign.txt
  179. # Code-sign the Windows binaries, if the local bob config provides a
  180. # script to do so in a cross-compiling way. We assume here that the
  181. # script accepts an -i option to provide a 'more info' URL, an
  182. # optional -n option to provide a program name, and an -N option to
  183. # take the program name from an .exe's version resource, and that it
  184. # can accept multiple .exe or .msi filename arguments and sign them
  185. # all in place.
  186. ifneq "$(cross_winsigncode)" "" in putty/windows do $(cross_winsigncode) -N -i https://www.chiark.greenend.org.uk/~sgtatham/putty/ $$(cat to-sign.txt)
  187. # Make a preliminary set of cryptographic checksums giving the hashes
  188. # of these versions of the binaries. We'll make the rest below.
  189. in putty do for hash in md5 sha1 sha256 sha512; do for dir_plat in "build32 w32" "build64 w64" "abuild32 wa32" "abuild64 wa64"; do set -- $$dir_plat; (cd windows/$$1 && $${hash}sum *.exe | sed 's!\( \+\)!\1'$$2'/!;s!$$! (installer version)!') >> $${hash}sums.installer; done; done
  190. # Build a WiX MSI installer, for each build flavour.
  191. in putty/windows with wixonlinux do candle -arch x86 -dRealPlatform=x86 -dDllOk=yes -dBuilddir=build32/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" -dHelpFilePath="../../docbuild/putty.chm" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installer32.msi -spdb
  192. in putty/windows with wixonlinux do candle -arch x64 -dRealPlatform=x64 -dDllOk=yes -dBuilddir=build64/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" -dHelpFilePath="../../docbuild/putty.chm" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installer64.msi -spdb
  193. in putty/windows with wixonlinux do candle -arch x64 -dRealPlatform=Arm -dDllOk=no -dBuilddir=abuild32/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" -dHelpFilePath="../../docbuild/putty.chm" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installera32.msi -spdb
  194. in putty/windows with wixonlinux do candle -arch x64 -dRealPlatform=Arm64 -dDllOk=no -dBuilddir=abuild64/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" -dHelpFilePath="../../docbuild/putty.chm" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installera64.msi -spdb
  195. # Change the width field for our dialog background image so that it
  196. # doesn't stretch across the whole dialog. (WiX's default one does; we
  197. # replace it with a narrow one so that the text to the right of it
  198. # shows up on system default background colour, meaning that
  199. # high-contrast mode doesn't make the text white on white. But that
  200. # means we also have to modify the width field, and there's nothing in
  201. # WiX's source syntax to make that happen.)
  202. #
  203. # Also bodge the platform fields for the Windows on Arm installers,
  204. # since WiX 3 doesn't understand Arm platform names itself.
  205. in putty/windows do ./msifixup.py installer32.msi --dialog-bmp-width=123
  206. in putty/windows do ./msifixup.py installer64.msi --dialog-bmp-width=123
  207. in putty/windows do ./msifixup.py installera32.msi --dialog-bmp-width=123 --platform=Arm
  208. in putty/windows do ./msifixup.py installera64.msi --dialog-bmp-width=123 --platform=Arm64
  209. # Sign the Windows installers.
  210. ifneq "$(cross_winsigncode)" "" in putty/windows do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/putty/ -n "PuTTY Installer" installer32.msi installer64.msi installera32.msi installera64.msi
  211. # Build the standalone binaries, in both 32- and 64-bit flavours.
  212. # These differ from the previous set in that they embed the help file.
  213. in putty/windows/build32 with cmake_at_least_3.20 do cmake . -DPUTTY_EMBEDDED_CHM_FILE=$$(realpath ../../../docbuild/putty.chm)
  214. in putty/windows/build32 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1
  215. in putty/windows/build64 with cmake_at_least_3.20 do cmake . -DPUTTY_EMBEDDED_CHM_FILE=$$(realpath ../../../docbuild/putty.chm)
  216. in putty/windows/build64 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1
  217. in putty/windows/abuild32 with cmake_at_least_3.20 do cmake . -DPUTTY_EMBEDDED_CHM_FILE=$$(realpath ../../../docbuild/putty.chm)
  218. in putty/windows/abuild32 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1
  219. in putty/windows/abuild64 with cmake_at_least_3.20 do cmake . -DPUTTY_EMBEDDED_CHM_FILE=$$(realpath ../../../docbuild/putty.chm)
  220. in putty/windows/abuild64 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1
  221. # Build the 'old' binaries, which should still run on all 32-bit
  222. # versions of Windows back to Win95 (but not Win32s). These link
  223. # against Visual Studio 2003 libraries (the more modern versions
  224. # assume excessively modern Win32 API calls to be available), specify
  225. # a subsystem version of 4.0, and compile with /arch:IA32 to prevent
  226. # the use of modern CPU features like MMX which older machines also
  227. # might not have.
  228. #
  229. # There's no installer to go with these, so they must also embed the
  230. # help file.
  231. in putty/windows/buildold with cmake_at_least_3.20 do cmake ../.. -DCMAKE_TOOLCHAIN_FILE=$(cmake_toolchain_clangcl32_2003) -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPUTTY_LINK_MAPS=ON -DSTRICT=ON
  232. in putty/windows/buildold with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1
  233. # Regenerate to-sign.txt with the 'old' binaries included.
  234. in putty/windows do for subdir in build32 abuild32 build64 abuild64 buildold; do sed "s!^!$$subdir/!" $$subdir/shipped.txt; done > to-sign.txt
  235. # Code-sign the standalone versions of the binaries.
  236. ifneq "$(cross_winsigncode)" "" in putty/windows do $(cross_winsigncode) -N -i https://www.chiark.greenend.org.uk/~sgtatham/putty/ $$(cat to-sign.txt)
  237. # Move the shipped (and signed) binaries into another directory to
  238. # deliver them from, so that we omit testcrypt and its ilk.
  239. in putty/windows do mkdir deliver
  240. in putty/windows do for subdir in build32 abuild32 build64 abuild64 buildold; do mkdir deliver/$$subdir; done
  241. in putty/windows do while read x; do mv $$x deliver/$$x; mv $$x.map deliver/$$x.map; done < to-sign.txt
  242. # Make putty.zip in each Windows directory. We add the files one by
  243. # one, because 'zip' exits with a success status if it managed to add
  244. # _at least one_ of the input files, even if another didn't exist. So
  245. # doing them one at a time gets us proper error reporting.
  246. in putty/windows/deliver/buildold do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done
  247. in putty/windows/deliver/build32 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done
  248. in putty/windows/deliver/build64 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done
  249. in putty/windows/deliver/abuild32 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done
  250. in putty/windows/deliver/abuild64 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done
  251. in docbuild/html do for file in *.html; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip puttydoc.zip "$$file";; esac; done
  252. # Deliver the actual PuTTY release directory into a subdir `putty'.
  253. deliver putty/windows/deliver/buildold/*.exe putty/w32old/$@
  254. deliver putty/windows/deliver/buildold/putty.zip putty/w32old/$@
  255. deliver putty/windows/deliver/build32/*.exe putty/w32/$@
  256. deliver putty/windows/deliver/build32/putty.zip putty/w32/$@
  257. deliver putty/windows/deliver/build64/*.exe putty/w64/$@
  258. deliver putty/windows/deliver/build64/putty.zip putty/w64/$@
  259. deliver putty/windows/installer32.msi putty/w32/$(Ifilename32).msi
  260. deliver putty/windows/installer64.msi putty/w64/$(Ifilename64).msi
  261. deliver putty/windows/installera32.msi putty/wa32/$(Ifilenamea32).msi
  262. deliver putty/windows/installera64.msi putty/wa64/$(Ifilenamea64).msi
  263. deliver putty/windows/deliver/abuild32/*.exe putty/wa32/$@
  264. deliver putty/windows/deliver/abuild32/putty.zip putty/wa32/$@
  265. deliver putty/windows/deliver/abuild64/*.exe putty/wa64/$@
  266. deliver putty/windows/deliver/abuild64/putty.zip putty/wa64/$@
  267. deliver docbuild/html/puttydoc.zip putty/$@
  268. deliver docbuild/putty.chm putty/$@
  269. deliver docbuild/puttydoc.txt putty/$@
  270. deliver docbuild/html/*.html putty/htmldoc/$@
  271. deliver putty/putty-src.zip putty/$@
  272. deliver putty/*.tar.gz putty/$@
  273. # Deliver the map files alongside the `proper' release deliverables.
  274. deliver putty/windows/deliver/buildold/*.map maps/w32old/$@
  275. deliver putty/windows/deliver/build32/*.map maps/w32/$@
  276. deliver putty/windows/deliver/build64/*.map maps/w64/$@
  277. deliver putty/windows/deliver/abuild32/*.map maps/wa32/$@
  278. deliver putty/windows/deliver/abuild64/*.map maps/wa64/$@
  279. # Deliver sign.sh, so that whoever has just built PuTTY (the
  280. # snapshot scripts or me, depending) can conveniently sign it with
  281. # whatever key they want.
  282. deliver putty/sign.sh $@
  283. # Create files of cryptographic checksums, which will be signed along
  284. # with the files they verify. We've provided MD5 checksums for a
  285. # while, but now MD5 is looking iffy, we're expanding our selection.
  286. #
  287. # Creating these files is most easily done in the destination
  288. # directory, where all the files we're delivering are already in their
  289. # final relative layout.
  290. in . do pwd > builddir
  291. read Builddir builddir
  292. in-dest putty do a=`\find * -type f -print`; for hash in md5 sha1 sha256 sha512; do ($${hash}sum $$a; echo; cat $(Builddir)/putty/$${hash}sums.installer) > $${hash}sums; done
  293. # And construct .htaccess files. One in the top-level directory,
  294. # setting the MIME types for Windows help files and providing an
  295. # appropriate link to the source archive:
  296. in-dest putty do echo "AddType application/octet-stream .chm" >> .htaccess
  297. in-dest putty do set -- putty*.tar.gz; for k in '' .gpg; do echo RedirectMatch temp '(.*/)'putty.tar.gz$$k\$$ '$$1'"$$1$$k" >> .htaccess; done
  298. # And one in each binary directory, providing links for the installers.
  299. in-dest putty do for params in "w32 putty-installer" "w64 putty-64bit-installer" "wa32 putty-arm32-installer" "wa64 putty-arm64-installer"; do (set -- $$params; subdir=$$1; installername=$$2; cd $$subdir && for ext in msi exe; do set -- putty*installer.$$ext; if test -f $$1; then for k in '' .gpg; do echo RedirectMatch temp '(.*/)'$${installername}.$$ext$$k\$$ '$$1'"$$1$$k" >> .htaccess; done; fi; done); done