Add AES support in SSH2. Not yet complete: there's no way to select
[u/mdw/putty] / Makefile
CommitLineData
3d541627 1# Visual C++ Makefile for PuTTY.
2#
3# Use `nmake' to build.
4#
5
6##-- help
7#
8# Extra options you can set:
9#
10# - FWHACK=/DFWHACK
11# Enables a hack that tunnels through some firewall proxies.
12#
13# - VER=/DSNAPSHOT=1999-01-25
14# Generates executables whose About box report them as being a
15# development snapshot.
16#
17# - VER=/DRELEASE=0.43
18# Generates executables whose About box report them as being a
19# release version.
20#
4d331a77 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>.
24#
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
28# does this.
29#
6ed3635b 30# - RCFL=/DASCIICTLS
760858ff 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
34# problem with it.
35#
b191636d 36# - XFLAGS=/DMALLOC_LOG
37# Causes PuTTY to emit a file called putty_mem.log, logging every
38# memory allocation and free, so you can track memory leaks.
39#
40# - XFLAGS=/DMINEFIELD
41# Causes PuTTY to use a custom memory allocator, similar in
42# concept to Electric Fence, in place of regular malloc(). Wastes
43# huge amounts of RAM, but should cause heap-corruption bugs to
44# show up as GPFs at the point of failure rather than appearing
45# later on as second-level damage.
46#
3d541627 47##--
676c0556 48
5f48a59c 49CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd
373e94e9 50# LFLAGS = /debug
51
52# Use MSVC DLL
c9def1b8 53# CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /MD /Fd
373e94e9 54
55# Disable debug and incremental linking
56LFLAGS = /incremental:no
374330e2 57
58.c.obj:
b191636d 59 cl $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) /c $*.c
374330e2 60
3d541627 61OBJ=obj
62RES=res
63
89ee5268 64##-- objects putty puttytel
8c3cd914 65GOBJS1 = window.$(OBJ) windlg.$(OBJ) winctrls.$(OBJ) terminal.$(OBJ)
4017be6d 66GOBJS2 = xlat.$(OBJ) sizetip.$(OBJ)
67##-- objects putty puttytel plink
c91409da 68LOBJS1 = telnet.$(OBJ) raw.$(OBJ) rlogin.$(OBJ) ldisc.$(OBJ) winnet.$(OBJ)
4017be6d 69##-- objects putty plink
5c58ad2d 70POBJS = be_all.$(OBJ)
89ee5268 71##-- objects puttytel
72TOBJS = be_nossh.$(OBJ)
4017be6d 73##-- objects plink
a9422f39 74PLOBJS = plink.$(OBJ)
3d541627 75##-- objects pscp
8df7a775 76SOBJS = scp.$(OBJ) winnet.$(OBJ) be_none.$(OBJ)
4a8fc3c4 77##-- objects psftp
79fc73e2 78FOBJS = psftp.$(OBJ) sftp.$(OBJ) int64.$(OBJ) winnet.$(OBJ) be_none.$(OBJ)
4a8fc3c4 79##-- objects putty puttytel pscp psftp plink
a9422f39 80MOBJS = misc.$(OBJ) version.$(OBJ) winstore.$(OBJ) settings.$(OBJ)
8df7a775 81MOBJ2 = tree234.$(OBJ)
4a8fc3c4 82##-- objects putty pscp psftp plink
89ee5268 83OBJS1 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ)
e5574168 84OBJS2 = sshsha.$(OBJ) sshblowf.$(OBJ) noise.$(OBJ) sshdh.$(OBJ) sshdss.$(OBJ)
4ba9b64b 85OBJS3 = sshbn.$(OBJ) sshpubk.$(OBJ) ssh.$(OBJ) pageantc.$(OBJ) sshzlib.$(OBJ)
8479e33c 86OBJS4 = x11fwd.$(OBJ) sshaes.$(OBJ)
5c58ad2d 87##-- objects pageant
88PAGE1 = pageant.$(OBJ) sshrsa.$(OBJ) sshpubk.$(OBJ) sshdes.$(OBJ) sshbn.$(OBJ)
8479e33c 89PAGE2 = sshmd5.$(OBJ) version.$(OBJ) tree234.$(OBJ) misc.$(OBJ) sshaes.$(OBJ)
6e522441 90##-- objects puttygen
91GEN1 = puttygen.$(OBJ) sshrsag.$(OBJ) sshprime.$(OBJ) sshdes.$(OBJ)
92GEN2 = sshbn.$(OBJ) sshmd5.$(OBJ) version.$(OBJ) sshrand.$(OBJ) noise.$(OBJ)
93GEN3 = sshsha.$(OBJ) winstore.$(OBJ) misc.$(OBJ) winctrls.$(OBJ)
8479e33c 94GEN4 = sshrsa.$(OBJ) sshpubk.$(OBJ) sshaes.$(OBJ)
9d01fc92 95##-- resources putty puttytel
3d541627 96PRESRC = win_res.$(RES)
5c58ad2d 97##-- resources pageant
98PAGERC = pageant.$(RES)
6e522441 99##-- resources puttygen
100GENRC = puttygen.$(RES)
4a8fc3c4 101##-- resources pscp psftp
3d541627 102SRESRC = scp.$(RES)
4017be6d 103##-- resources plink
104LRESRC = plink.$(RES)
3d541627 105##--
106
107##-- gui-apps
108# putty
89ee5268 109# puttytel
5c58ad2d 110# pageant
6e522441 111# puttygen
3d541627 112##-- console-apps
113# pscp
4a8fc3c4 114# psftp
6d2d5e8d 115# plink ws2_32
3d541627 116##--
117
374330e2 118LIBS1 = advapi32.lib user32.lib gdi32.lib
4017be6d 119LIBS2 = comctl32.lib comdlg32.lib
5c58ad2d 120LIBS3 = shell32.lib
4017be6d 121SOCK1 = wsock32.lib
122SOCK2 = ws2_32.lib
4585985c 123
79fc73e2 124all: putty.exe puttytel.exe pscp.exe psftp.exe \
125 plink.exe pageant.exe puttygen.exe
89ee5268 126
9c964e85 127putty.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(POBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(PRESRC) putty.rsp
4491fef5 128 link $(LFLAGS) -out:putty.exe -map:putty.map @putty.rsp
89ee5268 129
8df7a775 130puttytel.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(TOBJS) $(MOBJS) $(MOBJ2) $(PRESRC) puttytel.rsp
4491fef5 131 link $(LFLAGS) -out:puttytel.exe -map:puttytel.map @puttytel.rsp
89ee5268 132
5c58ad2d 133pageant.exe: $(PAGE1) $(PAGE2) $(PAGERC) pageant.rsp
4491fef5 134 link $(LFLAGS) -out:pageant.exe -map:pageant.map @pageant.rsp
5c58ad2d 135
6e522441 136puttygen.exe: $(GEN1) $(GEN2) $(GEN3) $(GEN4) $(GENRC) puttygen.rsp
4491fef5 137 link $(LFLAGS) -out:puttygen.exe -map:puttygen.map @puttygen.rsp
6e522441 138
9c964e85 139pscp.exe: $(SOBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(SRESRC) pscp.rsp
4491fef5 140 link $(LFLAGS) -out:pscp.exe -map:pscp.map @pscp.rsp
89ee5268 141
79fc73e2 142psftp.exe: $(FOBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(SRESRC) psftp.rsp
143 link $(LFLAGS) -out:psftp.exe -map:psftp.map @psftp.rsp
144
9c964e85 145plink.exe: $(LOBJS1) $(POBJS) $(PLOBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(LRESRC) plink.rsp
4491fef5 146 link $(LFLAGS) -out:plink.exe -map:plink.map @plink.rsp
4017be6d 147
89ee5268 148putty.rsp: makefile
149 echo /nologo /subsystem:windows > putty.rsp
150 echo $(GOBJS1) >> putty.rsp
151 echo $(GOBJS2) >> putty.rsp
4017be6d 152 echo $(LOBJS1) >> putty.rsp
89ee5268 153 echo $(POBJS) >> putty.rsp
154 echo $(MOBJS) >> putty.rsp
8df7a775 155 echo $(MOBJ2) >> putty.rsp
89ee5268 156 echo $(OBJS1) >> putty.rsp
157 echo $(OBJS2) >> putty.rsp
e5574168 158 echo $(OBJS3) >> putty.rsp
9c964e85 159 echo $(OBJS4) >> putty.rsp
89ee5268 160 echo $(PRESRC) >> putty.rsp
161 echo $(LIBS1) >> putty.rsp
162 echo $(LIBS2) >> putty.rsp
4017be6d 163 echo $(SOCK1) >> putty.rsp
89ee5268 164
165puttytel.rsp: makefile
166 echo /nologo /subsystem:windows > puttytel.rsp
167 echo $(GOBJS1) >> puttytel.rsp
168 echo $(GOBJS2) >> puttytel.rsp
4017be6d 169 echo $(LOBJS1) >> puttytel.rsp
89ee5268 170 echo $(TOBJS) >> puttytel.rsp
171 echo $(MOBJS) >> puttytel.rsp
8df7a775 172 echo $(MOBJ2) >> puttytel.rsp
9d01fc92 173 echo $(PRESRC) >> puttytel.rsp
89ee5268 174 echo $(LIBS1) >> puttytel.rsp
175 echo $(LIBS2) >> puttytel.rsp
4017be6d 176 echo $(SOCK1) >> puttytel.rsp
89ee5268 177
5c58ad2d 178pageant.rsp: makefile
179 echo /nologo /subsystem:windows > pageant.rsp
6e522441 180 echo $(PAGE1) >> pageant.rsp
181 echo $(PAGE2) >> pageant.rsp
182 echo $(PAGERC) >> pageant.rsp
5c58ad2d 183 echo $(LIBS1) >> pageant.rsp
184 echo $(LIBS2) >> pageant.rsp
185 echo $(LIBS3) >> pageant.rsp
186
6e522441 187puttygen.rsp: makefile
188 echo /nologo /subsystem:windows > puttygen.rsp
189 echo $(GEN1) >> puttygen.rsp
190 echo $(GEN2) >> puttygen.rsp
191 echo $(GEN3) >> puttygen.rsp
192 echo $(GEN4) >> puttygen.rsp
193 echo $(GENRC) >> puttygen.rsp
194 echo $(LIBS1) >> puttygen.rsp
195 echo $(LIBS2) >> puttygen.rsp
196 echo $(LIBS3) >> puttygen.rsp
197
89ee5268 198pscp.rsp: makefile
199 echo /nologo /subsystem:console > pscp.rsp
200 echo $(SOBJS) >> pscp.rsp
201 echo $(MOBJS) >> pscp.rsp
8df7a775 202 echo $(MOBJ2) >> pscp.rsp
89ee5268 203 echo $(OBJS1) >> pscp.rsp
204 echo $(OBJS2) >> pscp.rsp
e5574168 205 echo $(OBJS3) >> pscp.rsp
9c964e85 206 echo $(OBJS4) >> pscp.rsp
89ee5268 207 echo $(SRESRC) >> pscp.rsp
208 echo $(LIBS1) >> pscp.rsp
209 echo $(LIBS2) >> pscp.rsp
4017be6d 210 echo $(SOCK1) >> pscp.rsp
211
79fc73e2 212psftp.rsp: makefile
213 echo /nologo /subsystem:console > psftp.rsp
214 echo $(FOBJS) >> psftp.rsp
215 echo $(MOBJS) >> psftp.rsp
216 echo $(MOBJ2) >> psftp.rsp
217 echo $(OBJS1) >> psftp.rsp
218 echo $(OBJS2) >> psftp.rsp
219 echo $(OBJS3) >> psftp.rsp
220 echo $(OBJS4) >> psftp.rsp
221 echo $(SRESRC) >> psftp.rsp
222 echo $(LIBS1) >> psftp.rsp
223 echo $(LIBS2) >> psftp.rsp
224 echo $(SOCK1) >> psftp.rsp
225
4017be6d 226plink.rsp: makefile
227 echo /nologo /subsystem:console > plink.rsp
228 echo $(LOBJS1) >> plink.rsp
229 echo $(POBJS) >> plink.rsp
230 echo $(PLOBJS) >> plink.rsp
231 echo $(MOBJS) >> plink.rsp
8df7a775 232 echo $(MOBJ2) >> plink.rsp
4017be6d 233 echo $(OBJS1) >> plink.rsp
234 echo $(OBJS2) >> plink.rsp
235 echo $(OBJS3) >> plink.rsp
9c964e85 236 echo $(OBJS4) >> plink.rsp
4017be6d 237 echo $(LRESRC) >> plink.rsp
238 echo $(LIBS1) >> plink.rsp
239 echo $(LIBS2) >> plink.rsp
240 echo $(SOCK2) >> plink.rsp
3d541627 241
242##-- dependencies
dcbde236 243window.$(OBJ): window.c putty.h puttymem.h network.h win_res.h storage.h winstuff.h
244windlg.$(OBJ): windlg.c putty.h puttymem.h network.h ssh.h win_res.h winstuff.h
8c3cd914 245winctrls.$(OBJ): winctrls.c winstuff.h winstuff.h
dcbde236 246settings.$(OBJ): settings.c putty.h puttymem.h network.h storage.h
247winstore.$(OBJ): winstore.c putty.h puttymem.h network.h storage.h
248terminal.$(OBJ): terminal.c putty.h puttymem.h network.h
249sizetip.$(OBJ): sizetip.c putty.h puttymem.h network.h winstuff.h
250telnet.$(OBJ): telnet.c putty.h puttymem.h network.h
251raw.$(OBJ): raw.c putty.h puttymem.h network.h
c91409da 252rlogin.$(OBJ): rlogin.c putty.h puttymem.h network.h
dcbde236 253xlat.$(OBJ): xlat.c putty.h puttymem.h network.h
254ldisc.$(OBJ): ldisc.c putty.h puttymem.h network.h
255misc.$(OBJ): misc.c putty.h puttymem.h network.h
256noise.$(OBJ): noise.c putty.h puttymem.h network.h ssh.h storage.h
257ssh.$(OBJ): ssh.c ssh.h putty.h puttymem.h network.h tree234.h
258sshcrc.$(OBJ): sshcrc.c ssh.h puttymem.h
259sshdes.$(OBJ): sshdes.c ssh.h puttymem.h
8479e33c 260sshaes.$(OBJ): sshaes.c ssh.h puttymem.h
dcbde236 261sshmd5.$(OBJ): sshmd5.c ssh.h puttymem.h
262sshrsa.$(OBJ): sshrsa.c ssh.h puttymem.h
263sshsha.$(OBJ): sshsha.c ssh.h puttymem.h
264sshrand.$(OBJ): sshrand.c ssh.h puttymem.h
265sshblowf.$(OBJ): sshblowf.c ssh.h puttymem.h
266sshdh.$(OBJ): sshdh.c ssh.h puttymem.h
267sshdss.$(OBJ): sshdss.c ssh.h puttymem.h
268sshbn.$(OBJ): sshbn.c ssh.h puttymem.h
269sshpubk.$(OBJ): sshpubk.c ssh.h puttymem.h
270sshzlib.$(OBJ): sshzlib.c ssh.h puttymem.h
271scp.$(OBJ): scp.c putty.h puttymem.h network.h winstuff.h
3d541627 272version.$(OBJ): version.c
89ee5268 273be_all.$(OBJ): be_all.c
274be_nossh.$(OBJ): be_nossh.c
275be_none.$(OBJ): be_none.c
dcbde236 276plink.$(OBJ): plink.c putty.h puttymem.h network.h winstuff.h
277pageant.$(OBJ): pageant.c ssh.h puttymem.h tree234.h
278pageantc.$(OBJ): pageantc.c puttymem.h
279tree234.$(OBJ): tree234.c tree234.h puttymem.h
3332c06e 280puttygen.$(OBJ): puttygen.c putty.h ssh.h winstuff.h
4a8fc3c4 281psftp.$(OBJ): psftp.c putty.h ssh.h storage.h sftp.h int64.h
791ed432 282sftp.$(OBJ): sftp.c sftp.h int64.h
4a8fc3c4 283int64.$(OBJ): int64.c int64.h
3d541627 284##--
067a15ea 285
286# Hack to force version.obj to be rebuilt always
3d541627 287version.obj: versionpseudotarget
288 @echo (built version.obj)
067a15ea 289versionpseudotarget:
290 cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
374330e2 291
3d541627 292##-- dependencies
293win_res.$(RES): win_res.rc win_res.h putty.ico
294##--
295win_res.$(RES):
6ed3635b 296 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
374330e2 297
3d541627 298##-- dependencies
299scp.$(RES): scp.rc scp.ico
300##--
301scp.$(RES):
6ed3635b 302 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc
4585985c 303
5c58ad2d 304##-- dependencies
305pageant.$(RES): pageant.rc pageant.ico pageants.ico
306##--
307pageant.$(RES):
308 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 pageant.rc
309
6e522441 310##-- dependencies
311puttygen.$(RES): puttygen.rc puttygen.ico
312##--
313puttygen.$(RES):
314 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 puttygen.rc
315
1a5adedf 316clean: tidy
374330e2 317 del *.exe
1a5adedf 318
319tidy:
320 del *.obj
374330e2 321 del *.res
322 del *.pch
323 del *.aps
324 del *.ilk
325 del *.pdb
067a15ea 326 del *.rsp
1ee529ed 327 del *.dsp
328 del *.dsw
329 del *.ncb
330 del *.opt
331 del *.plg
1a5adedf 332 del *.map