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
31 # Uses ASCII rather than Unicode to specify the tab control in
32 # the resource file. Probably most useful when compiling with
33 # Cygnus/mingw32, whose resource compiler may have less of a
37 # Causes PuTTY to enable internal debugging.
39 # - XFLAGS=/DMALLOC_LOG
40 # Causes PuTTY to emit a file called putty_mem.log, logging every
41 # memory allocation and free, so you can track memory leaks.
43 # - XFLAGS=/DMINEFIELD
44 # Causes PuTTY to use a custom memory allocator, similar in
45 # concept to Electric Fence, in place of regular malloc(). Wastes
46 # huge amounts of RAM, but should cause heap-corruption bugs to
47 # show up as GPFs at the point of failure rather than appearing
48 # later on as second-level damage.
52 # Enable debug and incremental linking and compiling
53 # CFLAGS = /nologo /W3 /YX /Yd /O1 /Gi /D_WINDOWS /DDEBUG
56 # Disable debug and incremental linking and compiling
57 CFLAGS
= /nologo
/W3
/O1
/D_WINDOWS
58 LFLAGS
= /incremental
:no
/fixed
61 # CFLAGS = /nologo /W3 /O1 /MD /D_WINDOWS
62 # LFLAGS = /incremental:no
65 cl
$(COMPAT
) $(FWHACK
) $(XFLAGS
) $(CFLAGS
) /c
$*.c
70 ##-- objects putty puttytel
71 GOBJS1
= window.
$(OBJ
) windlg.
$(OBJ
) winctrls.
$(OBJ
) terminal.
$(OBJ
)
72 GOBJS2
= xlat.
$(OBJ
) sizetip.
$(OBJ
)
73 ##-- objects putty puttytel plink
74 LOBJS1
= telnet.
$(OBJ
) raw.
$(OBJ
) rlogin.
$(OBJ
) ldisc.
$(OBJ
) winnet.
$(OBJ
)
75 ##-- objects putty plink
78 TOBJS
= be_nossh.
$(OBJ
)
82 SOBJS
= scp.
$(OBJ
) winnet.
$(OBJ
) be_none.
$(OBJ
)
84 FOBJS
= psftp.
$(OBJ
) sftp.
$(OBJ
) int64.
$(OBJ
) winnet.
$(OBJ
) be_none.
$(OBJ
)
85 ##-- objects putty puttytel pscp psftp plink
86 MOBJS
= misc.
$(OBJ
) version.
$(OBJ
) winstore.
$(OBJ
) settings.
$(OBJ
)
87 MOBJ2
= tree234.
$(OBJ
)
88 ##-- objects putty pscp psftp plink
89 OBJS1
= sshcrc.
$(OBJ
) sshdes.
$(OBJ
) sshmd5.
$(OBJ
) sshrsa.
$(OBJ
) sshrand.
$(OBJ
)
90 OBJS2
= sshsha.
$(OBJ
) sshblowf.
$(OBJ
) noise.
$(OBJ
) sshdh.
$(OBJ
) sshdss.
$(OBJ
)
91 OBJS3
= sshbn.
$(OBJ
) sshpubk.
$(OBJ
) ssh.
$(OBJ
) pageantc.
$(OBJ
) sshzlib.
$(OBJ
)
92 OBJS4
= x11fwd.
$(OBJ
) sshaes.
$(OBJ
)
94 PAGE1
= pageant.
$(OBJ
) sshrsa.
$(OBJ
) sshpubk.
$(OBJ
) sshdes.
$(OBJ
) sshbn.
$(OBJ
)
95 PAGE2
= sshmd5.
$(OBJ
) version.
$(OBJ
) tree234.
$(OBJ
) misc.
$(OBJ
) sshaes.
$(OBJ
)
96 PAGE3
= sshsha.
$(OBJ
) pageantc.
$(OBJ
)
98 GEN1
= puttygen.
$(OBJ
) sshrsag.
$(OBJ
) sshprime.
$(OBJ
) sshdes.
$(OBJ
)
99 GEN2
= sshbn.
$(OBJ
) sshmd5.
$(OBJ
) version.
$(OBJ
) sshrand.
$(OBJ
) noise.
$(OBJ
)
100 GEN3
= sshsha.
$(OBJ
) winstore.
$(OBJ
) misc.
$(OBJ
) winctrls.
$(OBJ
)
101 GEN4
= sshrsa.
$(OBJ
) sshpubk.
$(OBJ
) sshaes.
$(OBJ
)
102 ##-- resources putty puttytel
103 PRESRC
= win_res.
$(RES
)
104 ##-- resources pageant
105 PAGERC
= pageant.
$(RES
)
106 ##-- resources puttygen
107 GENRC
= puttygen.
$(RES
)
108 ##-- resources pscp psftp
111 LRESRC
= plink.
$(RES
)
125 LIBS1
= advapi32.lib user32.lib gdi32.lib
126 LIBS2
= comctl32.lib comdlg32.lib
127 LIBS3
= shell32.lib winmm.lib
131 all: putty.exe puttytel.exe pscp.exe psftp.exe \
132 plink.exe pageant.exe puttygen.exe
134 putty.exe
: $(GOBJS1
) $(GOBJS2
) $(LOBJS1
) $(POBJS
) $(MOBJS
) $(MOBJ2
) $(OBJS1
) $(OBJS2
) $(OBJS3
) $(OBJS4
) $(PRESRC
) putty.rsp
135 link
$(LFLAGS
) -out
:putty.exe
-map
:putty.map @putty.rsp
137 puttytel.exe
: $(GOBJS1
) $(GOBJS2
) $(LOBJS1
) $(TOBJS
) $(MOBJS
) $(MOBJ2
) $(PRESRC
) puttytel.rsp
138 link
$(LFLAGS
) -out
:puttytel.exe
-map
:puttytel.map @puttytel.rsp
140 pageant.exe
: $(PAGE1
) $(PAGE2
) $(PAGE3
) $(PAGERC
) pageant.rsp
141 link
$(LFLAGS
) -out
:pageant.exe
-map
:pageant.map @pageant.rsp
143 puttygen.exe
: $(GEN1
) $(GEN2
) $(GEN3
) $(GEN4
) $(GENRC
) puttygen.rsp
144 link
$(LFLAGS
) -out
:puttygen.exe
-map
:puttygen.map @puttygen.rsp
146 pscp.exe
: $(SOBJS
) $(MOBJS
) $(MOBJ2
) $(OBJS1
) $(OBJS2
) $(OBJS3
) $(OBJS4
) $(SRESRC
) pscp.rsp
147 link
$(LFLAGS
) -out
:pscp.exe
-map
:pscp.map @pscp.rsp
149 psftp.exe
: $(FOBJS
) $(MOBJS
) $(MOBJ2
) $(OBJS1
) $(OBJS2
) $(OBJS3
) $(OBJS4
) $(SRESRC
) psftp.rsp
150 link
$(LFLAGS
) -out
:psftp.exe
-map
:psftp.map @psftp.rsp
152 plink.exe
: $(LOBJS1
) $(POBJS
) $(PLOBJS
) $(MOBJS
) $(MOBJ2
) $(OBJS1
) $(OBJS2
) $(OBJS3
) $(OBJS4
) $(LRESRC
) plink.rsp
153 link
$(LFLAGS
) -out
:plink.exe
-map
:plink.map @plink.rsp
156 cl
$(FWHACK
) $(VER
) $(CFLAGS
) /Gi-
/c ssh.c
159 echo
/nologo
/subsystem
:windows
> putty.rsp
160 echo
$(GOBJS1
) >> putty.rsp
161 echo
$(GOBJS2
) >> putty.rsp
162 echo
$(LOBJS1
) >> putty.rsp
163 echo
$(POBJS
) >> putty.rsp
164 echo
$(MOBJS
) >> putty.rsp
165 echo
$(MOBJ2
) >> putty.rsp
166 echo
$(OBJS1
) >> putty.rsp
167 echo
$(OBJS2
) >> putty.rsp
168 echo
$(OBJS3
) >> putty.rsp
169 echo
$(OBJS4
) >> putty.rsp
170 echo
$(PRESRC
) >> putty.rsp
171 echo
$(LIBS1
) >> putty.rsp
172 echo
$(LIBS2
) >> putty.rsp
173 echo
$(LIBS3
) >> putty.rsp
174 echo
$(SOCK1
) >> putty.rsp
176 puttytel.rsp
: makefile
177 echo
/nologo
/subsystem
:windows
> puttytel.rsp
178 echo
$(GOBJS1
) >> puttytel.rsp
179 echo
$(GOBJS2
) >> puttytel.rsp
180 echo
$(LOBJS1
) >> puttytel.rsp
181 echo
$(TOBJS
) >> puttytel.rsp
182 echo
$(MOBJS
) >> puttytel.rsp
183 echo
$(MOBJ2
) >> puttytel.rsp
184 echo
$(PRESRC
) >> puttytel.rsp
185 echo
$(LIBS1
) >> puttytel.rsp
186 echo
$(LIBS2
) >> puttytel.rsp
187 echo
$(LIBS3
) >> puttytel.rsp
188 echo
$(SOCK1
) >> puttytel.rsp
190 pageant.rsp
: makefile
191 echo
/nologo
/subsystem
:windows
> pageant.rsp
192 echo
$(PAGE1
) >> pageant.rsp
193 echo
$(PAGE2
) >> pageant.rsp
194 echo
$(PAGE3
) >> pageant.rsp
195 echo
$(PAGERC
) >> pageant.rsp
196 echo
$(LIBS1
) >> pageant.rsp
197 echo
$(LIBS2
) >> pageant.rsp
198 echo
$(LIBS3
) >> pageant.rsp
200 puttygen.rsp
: makefile
201 echo
/nologo
/subsystem
:windows
> puttygen.rsp
202 echo
$(GEN1
) >> puttygen.rsp
203 echo
$(GEN2
) >> puttygen.rsp
204 echo
$(GEN3
) >> puttygen.rsp
205 echo
$(GEN4
) >> puttygen.rsp
206 echo
$(GENRC
) >> puttygen.rsp
207 echo
$(LIBS1
) >> puttygen.rsp
208 echo
$(LIBS2
) >> puttygen.rsp
209 echo
$(LIBS3
) >> puttygen.rsp
212 echo
/nologo
/subsystem
:console
> pscp.rsp
213 echo
$(SOBJS
) >> pscp.rsp
214 echo
$(MOBJS
) >> pscp.rsp
215 echo
$(MOBJ2
) >> pscp.rsp
216 echo
$(OBJS1
) >> pscp.rsp
217 echo
$(OBJS2
) >> pscp.rsp
218 echo
$(OBJS3
) >> pscp.rsp
219 echo
$(OBJS4
) >> pscp.rsp
220 echo
$(SRESRC
) >> pscp.rsp
221 echo
$(LIBS1
) >> pscp.rsp
222 echo
$(LIBS2
) >> pscp.rsp
223 echo
$(SOCK1
) >> pscp.rsp
226 echo
/nologo
/subsystem
:console
> psftp.rsp
227 echo
$(FOBJS
) >> psftp.rsp
228 echo
$(MOBJS
) >> psftp.rsp
229 echo
$(MOBJ2
) >> psftp.rsp
230 echo
$(OBJS1
) >> psftp.rsp
231 echo
$(OBJS2
) >> psftp.rsp
232 echo
$(OBJS3
) >> psftp.rsp
233 echo
$(OBJS4
) >> psftp.rsp
234 echo
$(SRESRC
) >> psftp.rsp
235 echo
$(LIBS1
) >> psftp.rsp
236 echo
$(LIBS2
) >> psftp.rsp
237 echo
$(SOCK1
) >> psftp.rsp
240 echo
/nologo
/subsystem
:console
> plink.rsp
241 echo
$(LOBJS1
) >> plink.rsp
242 echo
$(POBJS
) >> plink.rsp
243 echo
$(PLOBJS
) >> plink.rsp
244 echo
$(MOBJS
) >> plink.rsp
245 echo
$(MOBJ2
) >> plink.rsp
246 echo
$(OBJS1
) >> plink.rsp
247 echo
$(OBJS2
) >> plink.rsp
248 echo
$(OBJS3
) >> plink.rsp
249 echo
$(OBJS4
) >> plink.rsp
250 echo
$(LRESRC
) >> plink.rsp
251 echo
$(LIBS1
) >> plink.rsp
252 echo
$(LIBS2
) >> plink.rsp
253 echo
$(SOCK2
) >> plink.rsp
256 be_all.
$(OBJ
): be_all.c network.h puttymem.h putty.h
257 be_none.
$(OBJ
): be_none.c network.h puttymem.h putty.h
258 be_nossh.
$(OBJ
): be_nossh.c network.h puttymem.h putty.h
259 bntest.
$(OBJ
): bntest.c puttymem.h ssh.h
260 int64.
$(OBJ
): int64.c
261 ldisc.
$(OBJ
): ldisc.c network.h puttymem.h putty.h
262 misc.
$(OBJ
): misc.c network.h puttymem.h putty.h
263 mscrypto.
$(OBJ
): mscrypto.c puttymem.h ssh.h
264 noise.
$(OBJ
): noise.c network.h puttymem.h storage.h ssh.h putty.h
265 pageant.
$(OBJ
): pageant.c puttymem.h ssh.h tree234.h
266 pageantc.
$(OBJ
): pageantc.c puttymem.h
267 plink.
$(OBJ
): plink.c network.h puttymem.h storage.h putty.h tree234.h
268 psftp.
$(OBJ
): psftp.c network.h puttymem.h int64.h sftp.h storage.h ssh.h putty.h
269 puttygen.
$(OBJ
): puttygen.c network.h puttymem.h winstuff.h ssh.h putty.h
270 raw.
$(OBJ
): raw.c network.h puttymem.h putty.h
271 rlogin.
$(OBJ
): rlogin.c network.h puttymem.h putty.h
272 scp.
$(OBJ
): scp.c network.h puttymem.h storage.h winstuff.h putty.h
273 settings.
$(OBJ
): settings.c network.h puttymem.h storage.h putty.h
274 sftp.
$(OBJ
): sftp.c sftp.h int64.h
275 sizetip.
$(OBJ
): sizetip.c network.h puttymem.h winstuff.h putty.h
276 ssh.
$(OBJ
): ssh.c network.h puttymem.h ssh.h putty.h tree234.h
277 sshaes.
$(OBJ
): sshaes.c puttymem.h ssh.h
278 sshblowf.
$(OBJ
): sshblowf.c puttymem.h ssh.h
279 sshbn.
$(OBJ
): sshbn.c network.h puttymem.h ssh.h putty.h
280 sshcrc.
$(OBJ
): sshcrc.c
281 sshdes.
$(OBJ
): sshdes.c puttymem.h ssh.h
282 sshdh.
$(OBJ
): sshdh.c puttymem.h ssh.h
283 sshdss.
$(OBJ
): sshdss.c puttymem.h ssh.h
284 sshmd5.
$(OBJ
): sshmd5.c puttymem.h ssh.h
285 sshprime.
$(OBJ
): sshprime.c puttymem.h ssh.h
286 sshpubk.
$(OBJ
): sshpubk.c puttymem.h ssh.h
287 sshrand.
$(OBJ
): sshrand.c puttymem.h ssh.h
288 sshrsa.
$(OBJ
): sshrsa.c puttymem.h ssh.h
289 sshrsag.
$(OBJ
): sshrsag.c puttymem.h ssh.h
290 sshsha.
$(OBJ
): sshsha.c puttymem.h ssh.h
291 sshzlib.
$(OBJ
): sshzlib.c network.h puttymem.h ssh.h putty.h
292 telnet.
$(OBJ
): telnet.c network.h puttymem.h putty.h
293 terminal.
$(OBJ
): terminal.c network.h puttymem.h putty.h tree234.h
294 tree234.
$(OBJ
): tree234.c tree234.h
295 version.
$(OBJ
): version.c
296 winctrls.
$(OBJ
): winctrls.c winstuff.h
297 windlg.
$(OBJ
): windlg.c network.h puttymem.h storage.h winstuff.h putty.h ssh.h win_res.h
298 window.
$(OBJ
): window.c network.h puttymem.h storage.h winstuff.h putty.h win_res.h
299 winnet.
$(OBJ
): winnet.c network.h puttymem.h putty.h tree234.h
300 winstore.
$(OBJ
): winstore.c network.h puttymem.h storage.h putty.h
301 x11fwd.
$(OBJ
): x11fwd.c network.h puttymem.h ssh.h putty.h
302 xlat.
$(OBJ
): xlat.c network.h puttymem.h putty.h
305 # Hack to force version.obj to be rebuilt always
306 version.obj
: *.c
*.h
*.rc
307 cl
$(FWHACK
) $(VER
) $(CFLAGS
) /c version.c
310 win_res.
$(RES
): win_res.rc win_res.h putty.ico
313 rc
$(FWHACK
) $(RCFL
) -r
-DWIN32
-D_WIN32
-DWINVER
=0x0400 win_res.rc
316 scp.
$(RES
): scp.rc scp.ico
319 rc
$(FWHACK
) $(RCFL
) -r
-DWIN32
-D_WIN32
-DWINVER
=0x0400 scp.rc
322 pageant.
$(RES
): pageant.rc pageant.ico pageants.ico
325 rc
$(FWHACK
) $(RCFL
) -r
-DWIN32
-D_WIN32
-DWINVER
=0x0400 pageant.rc
328 puttygen.
$(RES
): puttygen.rc puttygen.ico
331 rc
$(FWHACK
) $(RCFL
) -r
-DWIN32
-D_WIN32
-DWINVER
=0x0400 puttygen.rc