When looking for a local username on Windows, if we can get hold of the
[u/mdw/putty] / Recipe
CommitLineData
7603011f 1# -*- makefile -*-
2#
3# This file describes which PuTTY programs are made up from which
4# object and resource files. It is processed into the various
5# Makefiles by means of a Perl script. Makefile changes should
6# really be made by editing this file and/or the Perl script, not
7# by editing the actual Makefiles.
8
e35fb54b 9# ------------------------------------------------------------
10# Top-level configuration.
11
12# Overall project name.
13!name putty
14# Locations and types of output Makefiles.
6da41155 15!makefile vc windows/Makefile.vc
16!makefile vcproj windows/MSVC
17!makefile cygwin windows/Makefile.cyg
18!makefile borland windows/Makefile.bor
19!makefile lcc windows/Makefile.lcc
e35fb54b 20!makefile gtk unix/Makefile.gtk
b89e7e07 21!makefile unix unix/Makefile.ux
76d3a838 22!makefile ac unix/Makefile.in
e35fb54b 23!makefile mpw mac/Makefile.mpw
1ddda1ca 24!makefile osx macosx/Makefile
985b6440 25!makefile devcppproj windows/DEVCPP
cdd310bb 26# Source directories.
27!srcdir charset/
6da41155 28!srcdir windows/
cdd310bb 29!srcdir unix/
30!srcdir mac/
1ddda1ca 31!srcdir macosx/
e35fb54b 32
7603011f 33# Help text added to the top of each Makefile, with /D converted
34# into -D as appropriate for the particular Makefile.
35
36!begin help
37#
38# Extra options you can set:
39#
976374cd 40# - VER="/DSNAPSHOT=1999-01-25 /DSVN_REV=1234"
7603011f 41# Generates executables whose About box report them as being a
976374cd 42# development snapshot. SVN_REV is a Subversion revision number.
7603011f 43#
44# - VER=/DRELEASE=0.43
45# Generates executables whose About box report them as being a
46# release version.
47#
d2ab2f0b 48# - COMPAT=/DAUTO_WINSOCK (Windows only)
7603011f 49# Causes PuTTY to assume that <windows.h> includes its own WinSock
50# header file, so that it won't try to include <winsock.h>.
51#
d2ab2f0b 52# - COMPAT=/DWINSOCK_TWO (Windows only)
7603011f 53# Causes the PuTTY utilities to include <winsock2.h> instead of
54# <winsock.h>, except Plink which _needs_ WinSock 2 so it already
55# does this.
56#
d2ab2f0b 57# - COMPAT=/DNO_SECURITY (Windows only)
7603011f 58# Disables Pageant's use of <aclapi.h>, which is not available
7c521ac9 59# with some development environments (such as older versions of
60# the Cygwin/mingw GNU toolchain). This means that Pageant
7603011f 61# won't care about the local user ID of processes accessing it; a
62# version of Pageant built with this option will therefore refuse
63# to run under NT-series OSes on security grounds (although it
64# will run fine on Win95-series OSes where there is no access
65# control anyway).
66#
d2ab2f0b 67# - COMPAT=/DNO_MULTIMON (Windows only)
7603011f 68# Disables PuTTY's use of <multimon.h>, which is not available
69# with some development environments. This means that PuTTY's
70# full-screen mode (configurable to work on Alt-Enter) will
71# not behave usefully in a multi-monitor environment.
72#
73# Note that this definition is always enabled in the Cygwin
74# build, since at the time of writing this <multimon.h> is
75# known not to be available in Cygwin.
76#
db6452be 77# - COMPAT=/DNO_HTMLHELP (Windows only)
78# Disables PuTTY's use of <htmlhelp.h>, which is not available
79# with some development environments. The resulting binary
80# will only look for an old-style WinHelp file (.HLP/.CNT), and
81# will ignore any .CHM file.
82#
83# Note that this definition is always enabled in the Cygwin
84# build, since at the time of writing this <htmlhelp.h> is
85aa0836 85# known not to be available in Cygwin (although you can use
86# the htmlhelp.h supplied with HTML Help Workshop).
db6452be 87#
4e95a413 88# - RCFL=/DNO_MANIFESTS (Windows only)
d2ab2f0b 89# Disables inclusion of XML application manifests in the PuTTY
90# binaries. This may be necessary to build for 64-bit Windows;
91# the manifests are only included to use the XP GUI style on
92# Windows XP, and the architecture tags are a lie on 64-bit.
93#
05581745 94# - COMPAT=/DNO_IPV6
95# Disables PuTTY's ability to make IPv6 connections, enabling
96# it to compile under development environments which do not
97# support IPv6 in their header files.
98#
42af6a67 99# - COMPAT=/DNO_GSSAPI
100# Disables PuTTY's ability to use GSSAPI functions for
101# authentication and key exchange.
102#
d2ab2f0b 103# - COMPAT=/DMSVC4 (Windows only)
7603011f 104# - RCFL=/DMSVC4
105# Makes a couple of minor changes so that PuTTY compiles using
106# MSVC 4. You will also need /DNO_SECURITY and /DNO_MULTIMON.
107#
d2ab2f0b 108# - RCFL=/DASCIICTLS (Windows only)
7603011f 109# Uses ASCII rather than Unicode to specify the tab control in
110# the resource file. Probably most useful when compiling with
111# Cygnus/mingw32, whose resource compiler may have less of a
112# problem with it.
113#
4044fc45 114# - XFLAGS=/DTELNET_DEFAULT
115# Causes PuTTY to default to the Telnet protocol (in the absence
116# of Default Settings and so on to the contrary). Normally PuTTY
117# will default to SSH.
118#
7603011f 119# - XFLAGS=/DDEBUG
120# Causes PuTTY to enable internal debugging.
121#
122# - XFLAGS=/DMALLOC_LOG
123# Causes PuTTY to emit a file called putty_mem.log, logging every
124# memory allocation and free, so you can track memory leaks.
125#
d2ab2f0b 126# - XFLAGS=/DMINEFIELD (Windows only)
7603011f 127# Causes PuTTY to use a custom memory allocator, similar in
128# concept to Electric Fence, in place of regular malloc(). Wastes
129# huge amounts of RAM, but should cause heap-corruption bugs to
130# show up as GPFs at the point of failure rather than appearing
131# later on as second-level damage.
132#
133!end
134
e35fb54b 135# ------------------------------------------------------------
136# Additional text added verbatim to each individual Makefile.
137
138# Hack to force version.o to be rebuilt always.
139!begin vc
140version.obj: *.c *.h *.rc
d8284c29 141 cl $(VER) $(CFLAGS) /c ..\version.c
e35fb54b 142!end
6da41155 143!specialobj vc version
e35fb54b 144!begin cygwin
6da41155 145version.o: FORCE
d8284c29 146 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c ../version.c
e35fb54b 147!end
6da41155 148!specialobj cygwin version
e35fb54b 149!begin borland
150version.obj: FORCE
d8284c29 151 bcc32 $(VER) $(CFLAGS) /c ..\version.c
e35fb54b 152!end
6da41155 153!specialobj borland version
e35fb54b 154!begin lcc
0aafb388 155version.obj: FORCE
d8284c29 156 lcc $(VER) $(CFLAGS) /c ..\version.c
e35fb54b 157!end
6da41155 158!specialobj lcc version
e35fb54b 159# For Unix, we also need the gross MD5 hack that causes automatic
160# version number selection in release source archives.
161!begin gtk
976374cd 162version.o: FORCE
e35fb54b 163 if test -z "$(VER)" && (cd ..; md5sum -c manifest); then \
d8284c29 164 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat ../version.def` -c ../version.c; \
e35fb54b 165 else \
d8284c29 166 $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c ../version.c; \
e35fb54b 167 fi
168!end
6da41155 169!specialobj gtk version
e35fb54b 170
976374cd 171# Add VER to Windows resource targets, and force them to be rebuilt every
172# time, on the assumption that they will contain version information.
173!begin vc vars
42af6a67 174CFLAGS = $(CFLAGS) /DHAS_GSSAPI
976374cd 175RCFLAGS = $(RCFLAGS) $(VER)
176!end
177!begin cygwin vars
db6452be 178# XXX GNU-ism, but it's probably all right for a Cygwin/MinGW Makefile.
976374cd 179RCFLAGS += $(patsubst -D%,--define %,$(VER))
180!end
181!begin borland vars
182# Borland doesn't support +=. This probably shouldn't work, but seems to.
183RCFLAGS = $(RCFLAGS) $(VER)
184!end
185!begin lcc vars
186RCFLAGS += $(VER)
187!end
188!forceobj putty.res
189!forceobj puttytel.res
190!forceobj plink.res
191!forceobj pscp.res
192!forceobj psftp.res
193!forceobj pageant.res
194!forceobj puttygen.res
195
e35fb54b 196# `make install' target for Unix.
197!begin gtk
198install:
cd99cb07 199 mkdir -p $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
e35fb54b 200 $(INSTALL_PROGRAM) -m 755 plink $(DESTDIR)$(bindir)/plink
201 $(INSTALL_PROGRAM) -m 755 pscp $(DESTDIR)$(bindir)/pscp
202 $(INSTALL_PROGRAM) -m 755 psftp $(DESTDIR)$(bindir)/psftp
203 $(INSTALL_PROGRAM) -m 755 pterm $(DESTDIR)$(bindir)/pterm
e693a2d9 204 if test -n "$(UTMP_GROUP)"; then \
205 chgrp $(UTMP_GROUP) $(DESTDIR)$(bindir)/pterm && \
206 chmod 2755 $(DESTDIR)$(bindir)/pterm; \
207 elif test -n "$(UTMP_USER)"; then \
208 chown $(UTMP_USER) $(DESTDIR)$(bindir)/pterm && \
209 chmod 4755 $(DESTDIR)$(bindir)/pterm; \
210 fi
e35fb54b 211 $(INSTALL_PROGRAM) -m 755 putty $(DESTDIR)$(bindir)/putty
212 $(INSTALL_PROGRAM) -m 755 puttygen $(DESTDIR)$(bindir)/puttygen
213 $(INSTALL_PROGRAM) -m 755 puttytel $(DESTDIR)$(bindir)/puttytel
214 $(INSTALL_DATA) -m 644 ../doc/plink.1 $(DESTDIR)$(man1dir)/plink.1
215 $(INSTALL_DATA) -m 644 ../doc/pscp.1 $(DESTDIR)$(man1dir)/pscp.1
216 $(INSTALL_DATA) -m 644 ../doc/psftp.1 $(DESTDIR)$(man1dir)/psftp.1
217 $(INSTALL_DATA) -m 644 ../doc/pterm.1 $(DESTDIR)$(man1dir)/pterm.1
218 $(INSTALL_DATA) -m 644 ../doc/putty.1 $(DESTDIR)$(man1dir)/putty.1
219 $(INSTALL_DATA) -m 644 ../doc/puttygen.1 $(DESTDIR)$(man1dir)/puttygen.1
220 $(INSTALL_DATA) -m 644 ../doc/puttytel.1 $(DESTDIR)$(man1dir)/puttytel.1
221
222install-strip:
223 $(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s"
224!end
77603464 225!begin osx vars
1ddda1ca 226CFLAGS += -DMACOSX
227!end
e35fb54b 228
8f5f26d2 229# Random symbols.
230!begin cygwin vars
231# _WIN32_IE is required to expose identifiers that only make sense on
232# systems with IE5+ installed, such as some arguments to SHGetFolderPath().
09644e07 233# WINVER etc perform a similar function for FlashWindowEx().
8f5f26d2 234CFLAGS += -D_WIN32_IE=0x0500
09644e07 235CFLAGS += -DWINVER=0x0500 -D_WIN32_WINDOWS=0x0410 -D_WIN32_WINNT=0x0500
8f5f26d2 236!end
237
e35fb54b 238# ------------------------------------------------------------
7603011f 239# Definitions of object groups. A group name, followed by an =,
240# followed by any number of objects or other already-defined group
241# names. A line beginning `+' is assumed to continue the previous
242# line.
243
f0fccd51 244# Terminal emulator and its (platform-independent) dependencies.
245TERMINAL = terminal wcwidth ldiscucs logging tree234 minibidi
246 + config dialog
247
7603011f 248# GUI front end and terminal emulator (putty, puttytel).
6da41155 249GUITERM = TERMINAL window windlg winctrls sizetip winucs winprint
cb2708d3 250 + winutils wincfg sercfg winhelp
7603011f 251
f5dd8adb 252# Same thing on Unix.
aef05b78 253UXTERM = TERMINAL uxcfg sercfg uxucs uxprint timing
f160b7b8 254GTKTERM = UXTERM gtkwin gtkcfg gtkdlg gtkfont gtkcols xkeysym
1ddda1ca 255OSXTERM = UXTERM osxwin osxdlg osxctrls
1d009ae7 256
7603011f 257# Non-SSH back ends (putty, puttytel, plink).
39934deb 258NONSSH = telnet raw rlogin ldisc pinger
7603011f 259
260# SSH back end (putty, plink, pscp, psftp).
c5e438ec 261SSH = ssh sshcrc sshdes sshmd5 sshrsa sshrand sshsha sshblowf
262 + sshdh sshcrcda sshpubk sshzlib sshdss x11fwd portfwd
2ccb2fc8 263 + sshaes sshsh256 sshsh512 sshbn wildcard pinger ssharcf
42af6a67 264WINSSH = SSH winnoise winpgntc wingss
265UXSSH = SSH uxnoise uxagentc uxgss
0c4b7799 266MACSSH = SSH macnoise
7603011f 267
268# SFTP implementation (pscp, psftp).
269SFTP = sftp int64 logging
270
271# Miscellaneous objects appearing in all the network utilities (not
272# Pageant or PuTTYgen).
39934deb 273MISC = timing misc version settings tree234 proxy
0edafb21 274WINMISC = MISC winstore winnet winhandl cmdline windefs winmisc winproxy
275 + wintime
aca589d9 276UXMISC = MISC uxstore uxsel uxnet cmdline uxmisc uxproxy time
1ddda1ca 277OSXMISC = MISC uxstore uxsel osxsel uxnet uxmisc uxproxy time
39934deb 278MACMISC = MISC macstore macnet mtcpnet otnet macmisc macabout pproxy
7603011f 279
2dc6356a 280# Character set library, for use in pterm.
d4413bd2 281CHARSET = sbcsdat slookup sbcs utf8 toucs fromucs xenc mimeenc macenc localenc
2dc6356a 282
7440fd44 283# Standard libraries.
7603011f 284LIBS = advapi32.lib user32.lib gdi32.lib comctl32.lib comdlg32.lib
977e6795 285 + shell32.lib winmm.lib imm32.lib winspool.lib
7603011f 286
f33ba69e 287# Network backend sets. This also brings in the relevant attachment
288# to proxy.c depending on whether we're crypto-avoidant or not.
289BE_ALL = be_all cproxy
290BE_NOSSH = be_nossh nocproxy
291BE_SSH = be_none cproxy
292BE_NONE = be_none nocproxy
7374c779 293# More backend sets, with the additional Windows serial-port module.
294W_BE_ALL = be_all_s winser cproxy
295W_BE_NOSSH = be_nos_s winser nocproxy
aef05b78 296# And with the Unix serial-port module.
297U_BE_ALL = be_all_s uxser cproxy
298U_BE_NOSSH = be_nos_s uxser nocproxy
f33ba69e 299
e35fb54b 300# ------------------------------------------------------------
7603011f 301# Definitions of actual programs. The program name, followed by a
302# colon, followed by a list of objects. Also in the list may be the
f7f27309 303# keywords [G] for Windows GUI app, [C] for Console app, [X] for
dddf640d 304# X/GTK Unix app, [U] for command-line Unix app, [M] for Macintosh app.
7603011f 305
8def70c3 306putty : [G] GUITERM NONSSH WINSSH W_BE_ALL WINMISC winx11 putty.res LIBS
7374c779 307puttytel : [G] GUITERM NONSSH W_BE_NOSSH WINMISC puttytel.res LIBS
308plink : [C] winplink wincons NONSSH WINSSH W_BE_ALL logging WINMISC
8def70c3 309 + winx11 plink.res LIBS
bf1e6912 310pscp : [C] pscp winsftp wincons WINSSH BE_SSH SFTP wildcard WINMISC
311 + pscp.res LIBS
dee42491 312psftp : [C] psftp winsftp wincons WINSSH BE_SSH SFTP wildcard WINMISC
976374cd 313 + psftp.res LIBS
7603011f 314
6da41155 315pageant : [G] winpgnt sshrsa sshpubk sshdes sshbn sshmd5 version tree234
fedd99b6 316 + misc sshaes sshsha winpgntc sshdss sshsh256 sshsh512 winutils
317 + winmisc winhelp pageant.res LIBS
7603011f 318
6da41155 319puttygen : [G] winpgen sshrsag sshdssg sshprime sshdes sshbn sshmd5 version
320 + sshrand winnoise sshsha winstore misc winctrls sshrsa sshdss winmisc
fae1a71b 321 + sshpubk sshaes sshsh256 sshsh512 import winutils puttygen.res
322 + tree234 notiming winhelp LIBS wintime
f7f27309 323
1ddda1ca 324pterm : [X] GTKTERM uxmisc misc ldisc settings uxpty uxsel BE_NONE uxstore
533c7491 325 + uxsignal CHARSET cmdline uxpterm version time xpmpterm xpmptcfg
aef05b78 326putty : [X] GTKTERM uxmisc misc ldisc settings uxsel U_BE_ALL uxstore
533c7491 327 + uxsignal CHARSET uxputty NONSSH UXSSH UXMISC ux_x11 xpmputty
328 + xpmpucfg
aef05b78 329puttytel : [X] GTKTERM uxmisc misc ldisc settings uxsel U_BE_NOSSH
533c7491 330 + uxstore uxsignal CHARSET uxputty NONSSH UXMISC xpmputty xpmpucfg
c5e438ec 331
aef05b78 332plink : [U] uxplink uxcons NONSSH UXSSH U_BE_ALL logging UXMISC uxsignal
333 + ux_x11
cd6ca416 334
47a6b94c 335puttygen : [U] cmdgen sshrsag sshdssg sshprime sshdes sshbn sshmd5 version
336 + sshrand uxnoise sshsha misc sshrsa sshdss uxcons uxstore uxmisc
fae1a71b 337 + sshpubk sshaes sshsh256 sshsh512 import puttygen.res time tree234
338 + uxgen notiming
47a6b94c 339
bf1e6912 340pscp : [U] pscp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC
dee42491 341psftp : [U] psftp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC
d6cc41e6 342
f33ba69e 343PuTTY : [M] terminal wcwidth ldiscucs logging BE_ALL mac macdlg macevlog
0c4b7799 344 + macterm macucs mac_res.rsrc testback NONSSH MACSSH MACMISC CHARSET
68b1e05a 345 + stricmp vsnprint dialog config macctrls minibidi
f33ba69e 346PuTTYtel : [M] terminal wcwidth ldiscucs logging BE_NOSSH mac macdlg
347 + macevlog macterm macucs mac_res.rsrc testback NONSSH MACMISC
68b1e05a 348 + CHARSET stricmp vsnprint dialog config macctrls minibidi
06c24bc0 349PuTTYgen : [M] macpgen sshrsag sshdssg sshprime sshdes sshbn sshmd5 version
350 + sshrand macnoise sshsha macstore misc sshrsa sshdss macmisc sshpubk
fae1a71b 351 + sshaes sshsh256 sshsh512 import macpgen.rsrc macpgkey macabout
1ddda1ca 352
aef05b78 353PuTTY : [MX] osxmain OSXTERM OSXMISC CHARSET U_BE_ALL NONSSH UXSSH
0980c4f2 354 + ux_x11 uxpty uxsignal testback putty.icns info.plist