1 # Visual C++ Makefile for PuTTY.
3 # Use `nmake' to build.
8 # Extra options you can set:
11 # Enables a hack that tunnels through some firewall proxies.
13 # - VER=/DSNAPSHOT=1999-01-25
14 # Generates executables whose About box report them as being a
15 # development snapshot.
17 # - VER=/DRELEASE=0.43
18 # Generates executables whose About box report them as being a
21 # - COMPAT=/DAUTO_WINSOCK
22 # Causes PuTTY to assume that <windows.h> includes its own WinSock
23 # header file, so that it won't try to include <winsock.h>.
25 # - COMPAT=/DWINSOCK_TWO
26 # Causes the PuTTY utilities to include <winsock2.h> instead of
27 # <winsock.h>, except Plink which _needs_ WinSock 2 so it already
30 # - COMPAT=/DNO_SECURITY
31 # Disables Pageant's use of <aclapi.h>, which is not available
32 # with some development environments. This means that Pageant
33 # won't care about the local user ID of processes accessing it; a
34 # version of Pageant built with this option will therefore refuse
35 # to run under NT-series OSes on security grounds (although it
36 # will run fine on Win95-series OSes where there is no access
40 # Uses ASCII rather than Unicode to specify the tab control in
41 # the resource file. Probably most useful when compiling with
42 # Cygnus/mingw32, whose resource compiler may have less of a
46 # Causes PuTTY to enable internal debugging.
48 # - XFLAGS=/DMALLOC_LOG
49 # Causes PuTTY to emit a file called putty_mem.log, logging every
50 # memory allocation and free, so you can track memory leaks.
52 # - XFLAGS=/DMINEFIELD
53 # Causes PuTTY to use a custom memory allocator, similar in
54 # concept to Electric Fence, in place of regular malloc(). Wastes
55 # huge amounts of RAM, but should cause heap-corruption bugs to
56 # show up as GPFs at the point of failure rather than appearing
57 # later on as second-level damage.
61 # Enable debug and incremental linking and compiling
62 # CFLAGS = /nologo /W3 /YX /Yd /O1 /Gi /D_WINDOWS /DDEBUG /D_WIN32_WINDOWS=0x401
65 # Disable debug and incremental linking and compiling
66 CFLAGS
= /nologo
/W3
/O1
/D_WINDOWS
/D_WIN32_WINDOWS
=0x401
67 LFLAGS
= /incremental
:no
/fixed
70 # CFLAGS = /nologo /W3 /O1 /MD /D_WINDOWS /D_WIN32_WINDOWS=0x401
71 # LFLAGS = /incremental:no
74 cl
$(COMPAT
) $(FWHACK
) $(XFLAGS
) $(CFLAGS
) /c
$*.c
79 ##-- objects putty puttytel
80 GOBJS1
= window.
$(OBJ
) windlg.
$(OBJ
) winctrls.
$(OBJ
) terminal.
$(OBJ
)
81 GOBJS2
= sizetip.
$(OBJ
) wcwidth.
$(OBJ
) unicode.
$(OBJ
)
82 ##-- objects putty puttytel plink
83 LOBJS1
= telnet.
$(OBJ
) raw.
$(OBJ
) rlogin.
$(OBJ
) ldisc.
$(OBJ
) winnet.
$(OBJ
)
84 ##-- objects putty plink
87 TOBJS
= be_nossh.
$(OBJ
)
91 SOBJS
= scp.
$(OBJ
) winnet.
$(OBJ
) be_none.
$(OBJ
) wildcard.
$(OBJ
)
93 FOBJS
= psftp.
$(OBJ
) winnet.
$(OBJ
) be_none.
$(OBJ
)
94 ##-- objects pscp psftp
95 SFOBJS
= sftp.
$(OBJ
) int64.
$(OBJ
)
96 ##-- objects putty puttytel pscp psftp plink
97 MOBJS
= misc.
$(OBJ
) version.
$(OBJ
) winstore.
$(OBJ
) settings.
$(OBJ
)
98 MOBJ2
= tree234.
$(OBJ
)
99 ##-- objects putty pscp psftp plink
100 OBJS1
= sshcrc.
$(OBJ
) sshdes.
$(OBJ
) sshmd5.
$(OBJ
) sshrsa.
$(OBJ
) sshrand.
$(OBJ
)
101 OBJS2
= sshsha.
$(OBJ
) sshblowf.
$(OBJ
) noise.
$(OBJ
) sshdh.
$(OBJ
) sshdss.
$(OBJ
)
102 OBJS3
= sshbn.
$(OBJ
) sshpubk.
$(OBJ
) ssh.
$(OBJ
) pageantc.
$(OBJ
) sshzlib.
$(OBJ
)
103 OBJS4
= x11fwd.
$(OBJ
) portfwd.
$(OBJ
) sshaes.
$(OBJ
)
105 PAGE1
= pageant.
$(OBJ
) sshrsa.
$(OBJ
) sshpubk.
$(OBJ
) sshdes.
$(OBJ
) sshbn.
$(OBJ
)
106 PAGE2
= sshmd5.
$(OBJ
) version.
$(OBJ
) tree234.
$(OBJ
) misc.
$(OBJ
) sshaes.
$(OBJ
)
107 PAGE3
= sshsha.
$(OBJ
) pageantc.
$(OBJ
)
108 ##-- objects puttygen
109 GEN1
= puttygen.
$(OBJ
) sshrsag.
$(OBJ
) sshprime.
$(OBJ
) sshdes.
$(OBJ
)
110 GEN2
= sshbn.
$(OBJ
) sshmd5.
$(OBJ
) version.
$(OBJ
) sshrand.
$(OBJ
) noise.
$(OBJ
)
111 GEN3
= sshsha.
$(OBJ
) winstore.
$(OBJ
) misc.
$(OBJ
) winctrls.
$(OBJ
)
112 GEN4
= sshrsa.
$(OBJ
) sshpubk.
$(OBJ
) sshaes.
$(OBJ
)
113 ##-- resources putty puttytel
114 PRESRC
= win_res.
$(RES
)
115 ##-- resources pageant
116 PAGERC
= pageant.
$(RES
)
117 ##-- resources puttygen
118 GENRC
= puttygen.
$(RES
)
119 ##-- resources pscp psftp
122 LRESRC
= plink.
$(RES
)
136 LIBS1
= advapi32.lib user32.lib gdi32.lib
137 LIBS2
= comctl32.lib comdlg32.lib
138 LIBS3
= shell32.lib winmm.lib imm32.lib
142 all: putty.exe puttytel.exe pscp.exe psftp.exe \
143 plink.exe pageant.exe puttygen.exe
145 putty.exe
: $(GOBJS1
) $(GOBJS2
) $(LOBJS1
) $(POBJS
) $(MOBJS
) $(MOBJ2
) $(OBJS1
) $(OBJS2
) $(OBJS3
) $(OBJS4
) $(PRESRC
) putty.rsp
146 link
$(LFLAGS
) -out
:putty.exe
-map
:putty.map @putty.rsp
148 puttytel.exe
: $(GOBJS1
) $(GOBJS2
) $(LOBJS1
) $(TOBJS
) $(MOBJS
) $(MOBJ2
) $(PRESRC
) puttytel.rsp
149 link
$(LFLAGS
) -out
:puttytel.exe
-map
:puttytel.map @puttytel.rsp
151 pageant.exe
: $(PAGE1
) $(PAGE2
) $(PAGE3
) $(PAGERC
) pageant.rsp
152 link
$(LFLAGS
) -out
:pageant.exe
-map
:pageant.map @pageant.rsp
154 puttygen.exe
: $(GEN1
) $(GEN2
) $(GEN3
) $(GEN4
) $(GENRC
) puttygen.rsp
155 link
$(LFLAGS
) -out
:puttygen.exe
-map
:puttygen.map @puttygen.rsp
157 pscp.exe
: $(SOBJS
) $(SFOBJS
) $(MOBJS
) $(MOBJ2
) $(OBJS1
) $(OBJS2
) $(OBJS3
) $(OBJS4
) $(SRESRC
) pscp.rsp
158 link
$(LFLAGS
) -out
:pscp.exe
-map
:pscp.map @pscp.rsp
160 psftp.exe
: $(FOBJS
) $(SFOBJS
) $(MOBJS
) $(MOBJ2
) $(OBJS1
) $(OBJS2
) $(OBJS3
) $(OBJS4
) $(SRESRC
) psftp.rsp
161 link
$(LFLAGS
) -out
:psftp.exe
-map
:psftp.map @psftp.rsp
163 plink.exe
: $(LOBJS1
) $(POBJS
) $(PLOBJS
) $(MOBJS
) $(MOBJ2
) $(OBJS1
) $(OBJS2
) $(OBJS3
) $(OBJS4
) $(LRESRC
) plink.rsp
164 link
$(LFLAGS
) -out
:plink.exe
-map
:plink.map @plink.rsp
167 cl
$(FWHACK
) $(VER
) $(CFLAGS
) /Gi-
/c ssh.c
170 echo
/nologo
/subsystem
:windows
> putty.rsp
171 echo
$(GOBJS1
) >> putty.rsp
172 echo
$(GOBJS2
) >> putty.rsp
173 echo
$(LOBJS1
) >> putty.rsp
174 echo
$(POBJS
) >> putty.rsp
175 echo
$(MOBJS
) >> putty.rsp
176 echo
$(MOBJ2
) >> putty.rsp
177 echo
$(OBJS1
) >> putty.rsp
178 echo
$(OBJS2
) >> putty.rsp
179 echo
$(OBJS3
) >> putty.rsp
180 echo
$(OBJS4
) >> putty.rsp
181 echo
$(PRESRC
) >> putty.rsp
182 echo
$(LIBS1
) >> putty.rsp
183 echo
$(LIBS2
) >> putty.rsp
184 echo
$(LIBS3
) >> putty.rsp
185 echo
$(SOCK1
) >> putty.rsp
187 puttytel.rsp
: makefile
188 echo
/nologo
/subsystem
:windows
> puttytel.rsp
189 echo
$(GOBJS1
) >> puttytel.rsp
190 echo
$(GOBJS2
) >> puttytel.rsp
191 echo
$(LOBJS1
) >> puttytel.rsp
192 echo
$(TOBJS
) >> puttytel.rsp
193 echo
$(MOBJS
) >> puttytel.rsp
194 echo
$(MOBJ2
) >> puttytel.rsp
195 echo
$(PRESRC
) >> puttytel.rsp
196 echo
$(LIBS1
) >> puttytel.rsp
197 echo
$(LIBS2
) >> puttytel.rsp
198 echo
$(LIBS3
) >> puttytel.rsp
199 echo
$(SOCK1
) >> puttytel.rsp
201 pageant.rsp
: makefile
202 echo
/nologo
/subsystem
:windows
> pageant.rsp
203 echo
$(PAGE1
) >> pageant.rsp
204 echo
$(PAGE2
) >> pageant.rsp
205 echo
$(PAGE3
) >> pageant.rsp
206 echo
$(PAGERC
) >> pageant.rsp
207 echo
$(LIBS1
) >> pageant.rsp
208 echo
$(LIBS2
) >> pageant.rsp
209 echo
$(LIBS3
) >> pageant.rsp
211 puttygen.rsp
: makefile
212 echo
/nologo
/subsystem
:windows
> puttygen.rsp
213 echo
$(GEN1
) >> puttygen.rsp
214 echo
$(GEN2
) >> puttygen.rsp
215 echo
$(GEN3
) >> puttygen.rsp
216 echo
$(GEN4
) >> puttygen.rsp
217 echo
$(GENRC
) >> puttygen.rsp
218 echo
$(LIBS1
) >> puttygen.rsp
219 echo
$(LIBS2
) >> puttygen.rsp
220 echo
$(LIBS3
) >> puttygen.rsp
223 echo
/nologo
/subsystem
:console
> pscp.rsp
224 echo
$(SOBJS
) >> pscp.rsp
225 echo
$(SFOBJS
) >> pscp.rsp
226 echo
$(MOBJS
) >> pscp.rsp
227 echo
$(MOBJ2
) >> pscp.rsp
228 echo
$(OBJS1
) >> pscp.rsp
229 echo
$(OBJS2
) >> pscp.rsp
230 echo
$(OBJS3
) >> pscp.rsp
231 echo
$(OBJS4
) >> pscp.rsp
232 echo
$(SRESRC
) >> pscp.rsp
233 echo
$(LIBS1
) >> pscp.rsp
234 echo
$(LIBS2
) >> pscp.rsp
235 echo
$(SOCK1
) >> pscp.rsp
238 echo
/nologo
/subsystem
:console
> psftp.rsp
239 echo
$(FOBJS
) >> psftp.rsp
240 echo
$(SFOBJS
) >> psftp.rsp
241 echo
$(MOBJS
) >> psftp.rsp
242 echo
$(MOBJ2
) >> psftp.rsp
243 echo
$(OBJS1
) >> psftp.rsp
244 echo
$(OBJS2
) >> psftp.rsp
245 echo
$(OBJS3
) >> psftp.rsp
246 echo
$(OBJS4
) >> psftp.rsp
247 echo
$(SRESRC
) >> psftp.rsp
248 echo
$(LIBS1
) >> psftp.rsp
249 echo
$(LIBS2
) >> psftp.rsp
250 echo
$(SOCK1
) >> psftp.rsp
253 echo
/nologo
/subsystem
:console
> plink.rsp
254 echo
$(LOBJS1
) >> plink.rsp
255 echo
$(POBJS
) >> plink.rsp
256 echo
$(PLOBJS
) >> plink.rsp
257 echo
$(MOBJS
) >> plink.rsp
258 echo
$(MOBJ2
) >> plink.rsp
259 echo
$(OBJS1
) >> plink.rsp
260 echo
$(OBJS2
) >> plink.rsp
261 echo
$(OBJS3
) >> plink.rsp
262 echo
$(OBJS4
) >> plink.rsp
263 echo
$(LRESRC
) >> plink.rsp
264 echo
$(LIBS1
) >> plink.rsp
265 echo
$(LIBS2
) >> plink.rsp
266 echo
$(SOCK2
) >> plink.rsp
269 be_all.
$(OBJ
): be_all.c network.h puttymem.h putty.h
270 be_none.
$(OBJ
): be_none.c network.h puttymem.h putty.h
271 be_nossh.
$(OBJ
): be_nossh.c network.h puttymem.h putty.h
272 bntest.
$(OBJ
): bntest.c puttymem.h ssh.h
273 int64.
$(OBJ
): int64.c
274 ldisc.
$(OBJ
): ldisc.c network.h puttymem.h putty.h
275 misc.
$(OBJ
): misc.c network.h puttymem.h putty.h
276 mscrypto.
$(OBJ
): mscrypto.c puttymem.h ssh.h
277 noise.
$(OBJ
): noise.c network.h puttymem.h storage.h ssh.h putty.h
278 pageant.
$(OBJ
): pageant.c puttymem.h ssh.h tree234.h
279 pageantc.
$(OBJ
): pageantc.c puttymem.h
280 plink.
$(OBJ
): plink.c network.h puttymem.h storage.h putty.h tree234.h
281 psftp.
$(OBJ
): psftp.c network.h puttymem.h int64.h sftp.h storage.h ssh.h putty.h
282 puttygen.
$(OBJ
): puttygen.c network.h puttymem.h winstuff.h ssh.h putty.h
283 raw.
$(OBJ
): raw.c network.h puttymem.h putty.h
284 rlogin.
$(OBJ
): rlogin.c network.h puttymem.h putty.h
285 scp.
$(OBJ
): scp.c network.h puttymem.h storage.h winstuff.h putty.h
286 settings.
$(OBJ
): settings.c network.h puttymem.h storage.h putty.h
287 sftp.
$(OBJ
): sftp.c sftp.h int64.h
288 sizetip.
$(OBJ
): sizetip.c network.h puttymem.h winstuff.h putty.h
289 ssh.
$(OBJ
): ssh.c network.h puttymem.h ssh.h putty.h tree234.h
290 sshaes.
$(OBJ
): sshaes.c puttymem.h ssh.h
291 sshblowf.
$(OBJ
): sshblowf.c puttymem.h ssh.h
292 sshbn.
$(OBJ
): sshbn.c network.h puttymem.h ssh.h putty.h
293 sshcrc.
$(OBJ
): sshcrc.c
294 sshdes.
$(OBJ
): sshdes.c puttymem.h ssh.h
295 sshdh.
$(OBJ
): sshdh.c puttymem.h ssh.h
296 sshdss.
$(OBJ
): sshdss.c puttymem.h ssh.h
297 sshmd5.
$(OBJ
): sshmd5.c puttymem.h ssh.h
298 sshprime.
$(OBJ
): sshprime.c puttymem.h ssh.h
299 sshpubk.
$(OBJ
): sshpubk.c puttymem.h ssh.h
300 sshrand.
$(OBJ
): sshrand.c puttymem.h ssh.h
301 sshrsa.
$(OBJ
): sshrsa.c puttymem.h ssh.h
302 sshrsag.
$(OBJ
): sshrsag.c puttymem.h ssh.h
303 sshsha.
$(OBJ
): sshsha.c puttymem.h ssh.h
304 sshzlib.
$(OBJ
): sshzlib.c network.h puttymem.h ssh.h putty.h
305 telnet.
$(OBJ
): telnet.c network.h puttymem.h putty.h
306 terminal.
$(OBJ
): terminal.c network.h puttymem.h putty.h tree234.h
307 tree234.
$(OBJ
): tree234.c tree234.h
308 version.
$(OBJ
): version.c
309 winctrls.
$(OBJ
): winctrls.c winstuff.h
310 windlg.
$(OBJ
): windlg.c network.h puttymem.h storage.h winstuff.h putty.h ssh.h win_res.h
311 window.
$(OBJ
): window.c network.h puttymem.h storage.h winstuff.h putty.h win_res.h
312 winnet.
$(OBJ
): winnet.c network.h puttymem.h putty.h tree234.h
313 winstore.
$(OBJ
): winstore.c network.h puttymem.h storage.h putty.h
314 x11fwd.
$(OBJ
): x11fwd.c network.h puttymem.h ssh.h putty.h
315 portfwd.
$(OBJ
): portfwd.c network.h puttymem.h ssh.h putty.h
316 xlat.
$(OBJ
): xlat.c network.h puttymem.h putty.h
319 # Hack to force version.obj to be rebuilt always
320 version.obj
: *.c
*.h
*.rc
321 cl
$(FWHACK
) $(VER
) $(CFLAGS
) /c version.c
324 win_res.
$(RES
): win_res.rc win_res.h putty.ico
327 rc
$(FWHACK
) $(RCFL
) -r
-DWIN32
-D_WIN32
-DWINVER
=0x0400 win_res.rc
330 scp.
$(RES
): scp.rc scp.ico
333 rc
$(FWHACK
) $(RCFL
) -r
-DWIN32
-D_WIN32
-DWINVER
=0x0400 scp.rc
336 pageant.
$(RES
): pageant.rc pageant.ico pageants.ico
339 rc
$(FWHACK
) $(RCFL
) -r
-DWIN32
-D_WIN32
-DWINVER
=0x0400 pageant.rc
342 puttygen.
$(RES
): puttygen.rc puttygen.ico
345 rc
$(FWHACK
) $(RCFL
) -r
-DWIN32
-D_WIN32
-DWINVER
=0x0400 puttygen.rc