]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - Makefile
Add single-DES support in SSH2
[PuTTY.git] / Makefile
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 #
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 #
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
37 #      control anyway).
38 #
39 #      Note that this definition is always enabled in the Cygwin
40 #      build, since at the time of writing this <aclapi.h> is known
41 #      not to be available in Cygwin.
42 #
43 #  - COMPAT=/DNO_MULTIMON
44 #      Disables PuTTY's use of <multimon.h>, which is not available
45 #      with some development environments. This means that PuTTY's
46 #      full-screen mode (configurable to work on Alt-Enter) will
47 #      not behave usefully in a multi-monitor environment.
48 #
49 #  - RCFL=/DASCIICTLS
50 #      Uses ASCII rather than Unicode to specify the tab control in
51 #      the resource file. Probably most useful when compiling with
52 #      Cygnus/mingw32, whose resource compiler may have less of a
53 #      problem with it.
54 #
55 #  - XFLAGS=/DDEBUG
56 #      Causes PuTTY to enable internal debugging.
57 #
58 #  - XFLAGS=/DMALLOC_LOG
59 #      Causes PuTTY to emit a file called putty_mem.log, logging every
60 #      memory allocation and free, so you can track memory leaks.
61 #
62 #  - XFLAGS=/DMINEFIELD
63 #      Causes PuTTY to use a custom memory allocator, similar in
64 #      concept to Electric Fence, in place of regular malloc(). Wastes
65 #      huge amounts of RAM, but should cause heap-corruption bugs to
66 #      show up as GPFs at the point of failure rather than appearing
67 #      later on as second-level damage.
68 #
69 ##--
70
71 # Enable debug and incremental linking and compiling
72 # CFLAGS = /nologo /W3 /YX /Yd /O1 /Gi /D_WINDOWS /DDEBUG /D_WIN32_WINDOWS=0x401
73 # LFLAGS = /debug
74
75 # Disable debug and incremental linking and compiling
76 CFLAGS = /nologo /W3 /O1 /D_WINDOWS /D_WIN32_WINDOWS=0x401 /DWINVER=0x401
77 LFLAGS = /incremental:no /fixed
78
79 # Use MSVC DLL
80 # CFLAGS = /nologo /W3 /O1 /MD /D_WINDOWS /D_WIN32_WINDOWS=0x401
81 # LFLAGS = /incremental:no
82
83 .c.obj:
84         cl $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) /c $*.c
85
86 OBJ=obj
87 RES=res
88
89 ##-- objects putty puttytel
90 GOBJS1 = window.$(OBJ) windlg.$(OBJ) winctrls.$(OBJ) terminal.$(OBJ)
91 GOBJS2 = sizetip.$(OBJ) wcwidth.$(OBJ) unicode.$(OBJ)
92 ##-- objects putty puttytel plink
93 LOBJS1 = telnet.$(OBJ) raw.$(OBJ) rlogin.$(OBJ) ldisc.$(OBJ) winnet.$(OBJ)
94 ##-- objects putty plink
95 POBJS = be_all.$(OBJ)
96 ##-- objects puttytel
97 TOBJS = be_nossh.$(OBJ)
98 ##-- objects plink
99 PLOBJS = plink.$(OBJ)
100 ##-- objects pscp
101 SOBJS = scp.$(OBJ) winnet.$(OBJ) be_none.$(OBJ) wildcard.$(OBJ)
102 ##-- objects psftp
103 FOBJS = psftp.$(OBJ) winnet.$(OBJ) be_none.$(OBJ)
104 ##-- objects pscp psftp
105 SFOBJS = sftp.$(OBJ) int64.$(OBJ)
106 ##-- objects putty puttytel pscp psftp plink
107 MOBJS = misc.$(OBJ) version.$(OBJ) winstore.$(OBJ) settings.$(OBJ)
108 MOBJ2 = tree234.$(OBJ)
109 ##-- objects putty pscp psftp plink
110 OBJS1 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ)
111 OBJS2 = sshsha.$(OBJ) sshblowf.$(OBJ) noise.$(OBJ) sshdh.$(OBJ) sshdss.$(OBJ)
112 OBJS3 = sshbn.$(OBJ) sshpubk.$(OBJ) ssh.$(OBJ) pageantc.$(OBJ) sshzlib.$(OBJ)
113 OBJS4 = x11fwd.$(OBJ) portfwd.$(OBJ) sshaes.$(OBJ) sshsh512.$(OBJ)
114 ##-- objects pageant
115 PAGE1 = pageant.$(OBJ) sshrsa.$(OBJ) sshpubk.$(OBJ) sshdes.$(OBJ) sshbn.$(OBJ)
116 PAGE2 = sshmd5.$(OBJ) version.$(OBJ) tree234.$(OBJ) misc.$(OBJ) sshaes.$(OBJ)
117 PAGE3 = sshsha.$(OBJ) pageantc.$(OBJ) sshdss.$(OBJ) sshsh512.$(OBJ)
118 ##-- objects puttygen
119 GEN1 = puttygen.$(OBJ) sshrsag.$(OBJ) sshdssg.$(OBJ) sshprime.$(OBJ)
120 GEN2 = sshdes.$(OBJ) sshbn.$(OBJ) sshmd5.$(OBJ) version.$(OBJ) sshrand.$(OBJ)
121 GEN3 = noise.$(OBJ) sshsha.$(OBJ) winstore.$(OBJ) misc.$(OBJ) winctrls.$(OBJ)
122 GEN4 = sshrsa.$(OBJ) sshdss.$(OBJ) sshpubk.$(OBJ) sshaes.$(OBJ) sshsh512.$(OBJ)
123 ##-- resources putty puttytel
124 PRESRC = win_res.$(RES)
125 ##-- resources pageant
126 PAGERC = pageant.$(RES)
127 ##-- resources puttygen
128 GENRC = puttygen.$(RES)
129 ##-- resources pscp psftp
130 SRESRC = scp.$(RES)
131 ##-- resources plink
132 LRESRC = plink.$(RES)
133 ##--
134
135 ##-- gui-apps
136 # putty
137 # puttytel
138 # pageant
139 # puttygen
140 ##-- console-apps
141 # pscp
142 # psftp
143 # plink ws2_32
144 ##--
145
146 LIBS1 = advapi32.lib user32.lib gdi32.lib
147 LIBS2 = comctl32.lib comdlg32.lib
148 LIBS3 = shell32.lib winmm.lib imm32.lib
149 SOCK1 = wsock32.lib
150 SOCK2 = ws2_32.lib
151
152 all: putty.exe puttytel.exe pscp.exe psftp.exe \
153      plink.exe pageant.exe puttygen.exe
154
155 putty.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(POBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(PRESRC) putty.rsp
156         link $(LFLAGS) -out:putty.exe -map:putty.map @putty.rsp
157
158 puttytel.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(TOBJS) $(MOBJS) $(MOBJ2) $(PRESRC) puttytel.rsp
159         link $(LFLAGS) -out:puttytel.exe -map:puttytel.map @puttytel.rsp
160
161 pageant.exe: $(PAGE1) $(PAGE2) $(PAGE3) $(PAGERC) pageant.rsp
162         link $(LFLAGS) -out:pageant.exe -map:pageant.map @pageant.rsp
163
164 puttygen.exe: $(GEN1) $(GEN2) $(GEN3) $(GEN4) $(GENRC) puttygen.rsp
165         link $(LFLAGS) -out:puttygen.exe -map:puttygen.map @puttygen.rsp
166
167 pscp.exe: $(SOBJS) $(SFOBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(SRESRC) pscp.rsp
168         link $(LFLAGS) -out:pscp.exe -map:pscp.map @pscp.rsp
169
170 psftp.exe: $(FOBJS) $(SFOBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(SRESRC) psftp.rsp
171         link $(LFLAGS) -out:psftp.exe -map:psftp.map @psftp.rsp
172
173 plink.exe: $(LOBJS1) $(POBJS) $(PLOBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(LRESRC) plink.rsp
174         link $(LFLAGS) -out:plink.exe -map:plink.map @plink.rsp
175
176 ssh.obj:
177         cl $(COMPAT) $(FWHACK) $(VER) $(XFLAGS) $(CFLAGS) /Gi- /c ssh.c
178
179 putty.rsp: makefile
180         echo /nologo /subsystem:windows > putty.rsp
181         echo $(GOBJS1) >> putty.rsp
182         echo $(GOBJS2) >> putty.rsp
183         echo $(LOBJS1) >> putty.rsp
184         echo $(POBJS) >> putty.rsp
185         echo $(MOBJS) >> putty.rsp
186         echo $(MOBJ2) >> putty.rsp
187         echo $(OBJS1) >> putty.rsp
188         echo $(OBJS2) >> putty.rsp
189         echo $(OBJS3) >> putty.rsp
190         echo $(OBJS4) >> putty.rsp
191         echo $(PRESRC) >> putty.rsp
192         echo $(LIBS1) >> putty.rsp
193         echo $(LIBS2) >> putty.rsp
194         echo $(LIBS3) >> putty.rsp
195         echo $(SOCK1) >> putty.rsp
196
197 puttytel.rsp: makefile
198         echo /nologo /subsystem:windows > puttytel.rsp
199         echo $(GOBJS1) >> puttytel.rsp
200         echo $(GOBJS2) >> puttytel.rsp
201         echo $(LOBJS1) >> puttytel.rsp
202         echo $(TOBJS) >> puttytel.rsp
203         echo $(MOBJS) >> puttytel.rsp
204         echo $(MOBJ2) >> puttytel.rsp
205         echo $(PRESRC) >> puttytel.rsp
206         echo $(LIBS1) >> puttytel.rsp
207         echo $(LIBS2) >> puttytel.rsp
208         echo $(LIBS3) >> puttytel.rsp
209         echo $(SOCK1) >> puttytel.rsp
210
211 pageant.rsp: makefile
212         echo /nologo /subsystem:windows > pageant.rsp
213         echo $(PAGE1) >> pageant.rsp
214         echo $(PAGE2) >> pageant.rsp
215         echo $(PAGE3) >> pageant.rsp
216         echo $(PAGERC) >> pageant.rsp
217         echo $(LIBS1) >> pageant.rsp
218         echo $(LIBS2) >> pageant.rsp
219         echo $(LIBS3) >> pageant.rsp
220
221 puttygen.rsp: makefile
222         echo /nologo /subsystem:windows > puttygen.rsp
223         echo $(GEN1) >> puttygen.rsp
224         echo $(GEN2) >> puttygen.rsp
225         echo $(GEN3) >> puttygen.rsp
226         echo $(GEN4) >> puttygen.rsp
227         echo $(GENRC) >> puttygen.rsp
228         echo $(LIBS1) >> puttygen.rsp
229         echo $(LIBS2) >> puttygen.rsp
230         echo $(LIBS3) >> puttygen.rsp
231
232 pscp.rsp: makefile
233         echo /nologo /subsystem:console > pscp.rsp
234         echo $(SOBJS) >> pscp.rsp
235         echo $(SFOBJS) >> pscp.rsp
236         echo $(MOBJS) >> pscp.rsp
237         echo $(MOBJ2) >> pscp.rsp
238         echo $(OBJS1) >> pscp.rsp
239         echo $(OBJS2) >> pscp.rsp
240         echo $(OBJS3) >> pscp.rsp
241         echo $(OBJS4) >> pscp.rsp
242         echo $(SRESRC) >> pscp.rsp
243         echo $(LIBS1) >> pscp.rsp
244         echo $(LIBS2) >> pscp.rsp
245         echo $(SOCK1) >> pscp.rsp
246
247 psftp.rsp: makefile
248         echo /nologo /subsystem:console > psftp.rsp
249         echo $(FOBJS) >> psftp.rsp
250         echo $(SFOBJS) >> psftp.rsp
251         echo $(MOBJS) >> psftp.rsp
252         echo $(MOBJ2) >> psftp.rsp
253         echo $(OBJS1) >> psftp.rsp
254         echo $(OBJS2) >> psftp.rsp
255         echo $(OBJS3) >> psftp.rsp
256         echo $(OBJS4) >> psftp.rsp
257         echo $(SRESRC) >> psftp.rsp
258         echo $(LIBS1) >> psftp.rsp
259         echo $(LIBS2) >> psftp.rsp
260         echo $(SOCK1) >> psftp.rsp
261
262 plink.rsp: makefile
263         echo /nologo /subsystem:console > plink.rsp
264         echo $(LOBJS1) >> plink.rsp
265         echo $(POBJS) >> plink.rsp
266         echo $(PLOBJS) >> plink.rsp
267         echo $(MOBJS) >> plink.rsp
268         echo $(MOBJ2) >> plink.rsp
269         echo $(OBJS1) >> plink.rsp
270         echo $(OBJS2) >> plink.rsp
271         echo $(OBJS3) >> plink.rsp
272         echo $(OBJS4) >> plink.rsp
273         echo $(LRESRC) >> plink.rsp
274         echo $(LIBS1) >> plink.rsp
275         echo $(LIBS2) >> plink.rsp
276         echo $(SOCK2) >> plink.rsp
277
278 ##-- dependencies
279 be_all.$(OBJ): be_all.c network.h misc.h puttymem.h putty.h 
280 be_none.$(OBJ): be_none.c network.h misc.h puttymem.h putty.h 
281 be_nossh.$(OBJ): be_nossh.c network.h misc.h puttymem.h putty.h 
282 ber.$(OBJ): ber.c network.h asn.h misc.h asnerror.h int64.h puttymem.h ssh.h putty.h 
283 cert.$(OBJ): cert.c asn.h asnerror.h misc.h puttymem.h cert.h crypto.h 
284 debug.$(OBJ): debug.c debug.h 
285 int64.$(OBJ): int64.c int64.h 
286 ldisc.$(OBJ): ldisc.c network.h misc.h puttymem.h putty.h 
287 misc.$(OBJ): misc.c network.h misc.h puttymem.h putty.h 
288 mscrypto.$(OBJ): mscrypto.c network.h int64.h puttymem.h ssh.h 
289 no_ssl.$(OBJ): no_ssl.c network.h misc.h puttymem.h putty.h 
290 noise.$(OBJ): noise.c network.h misc.h puttymem.h storage.h int64.h ssh.h putty.h 
291 pageant.$(OBJ): pageant.c network.h int64.h puttymem.h ssh.h tree234.h 
292 pageantc.$(OBJ): pageantc.c puttymem.h 
293 plink.$(OBJ): plink.c network.h misc.h puttymem.h storage.h putty.h tree234.h 
294 portfwd.$(OBJ): portfwd.c network.h misc.h int64.h puttymem.h ssh.h putty.h 
295 psftp.$(OBJ): psftp.c network.h misc.h sftp.h ssh.h storage.h int64.h puttymem.h putty.h 
296 puttygen.$(OBJ): puttygen.c network.h misc.h int64.h puttymem.h winstuff.h ssh.h putty.h 
297 raw.$(OBJ): raw.c network.h misc.h puttymem.h putty.h 
298 rlogin.$(OBJ): rlogin.c network.h misc.h puttymem.h putty.h 
299 scp.$(OBJ): scp.c network.h misc.h sftp.h ssh.h storage.h puttymem.h int64.h putty.h winstuff.h 
300 settings.$(OBJ): settings.c network.h misc.h puttymem.h storage.h putty.h 
301 sftp.$(OBJ): sftp.c sftp.h int64.h 
302 sizetip.$(OBJ): sizetip.c network.h misc.h puttymem.h winstuff.h putty.h 
303 ssh.$(OBJ): ssh.c network.h misc.h int64.h puttymem.h ssh.h putty.h tree234.h 
304 sshaes.$(OBJ): sshaes.c network.h int64.h puttymem.h ssh.h 
305 sshblowf.$(OBJ): sshblowf.c network.h int64.h puttymem.h ssh.h 
306 sshbn.$(OBJ): sshbn.c network.h misc.h int64.h puttymem.h ssh.h putty.h 
307 sshcrc.$(OBJ): sshcrc.c 
308 sshdes.$(OBJ): sshdes.c network.h int64.h puttymem.h ssh.h 
309 sshdh.$(OBJ): sshdh.c network.h int64.h puttymem.h ssh.h 
310 sshdss.$(OBJ): sshdss.c network.h misc.h int64.h puttymem.h ssh.h 
311 sshdssg.$(OBJ): sshdssg.c network.h misc.h int64.h puttymem.h ssh.h 
312 sshmd5.$(OBJ): sshmd5.c network.h int64.h puttymem.h ssh.h 
313 sshprime.$(OBJ): sshprime.c network.h int64.h puttymem.h ssh.h 
314 sshpubk.$(OBJ): sshpubk.c network.h int64.h puttymem.h ssh.h 
315 sshrand.$(OBJ): sshrand.c network.h int64.h puttymem.h ssh.h 
316 sshrsa.$(OBJ): sshrsa.c network.h int64.h puttymem.h ssh.h 
317 sshrsag.$(OBJ): sshrsag.c network.h int64.h puttymem.h ssh.h 
318 sshsh512.$(OBJ): sshsh512.c network.h int64.h puttymem.h ssh.h 
319 sshsha.$(OBJ): sshsha.c network.h int64.h puttymem.h ssh.h 
320 sshzlib.$(OBJ): sshzlib.c network.h int64.h puttymem.h ssh.h 
321 ssl.$(OBJ): ssl.c network.h asnerror.h misc.h cert.h crypto.h ssl.h int64.h puttymem.h 
322 telnet.$(OBJ): telnet.c network.h misc.h puttymem.h putty.h 
323 terminal.$(OBJ): terminal.c network.h misc.h puttymem.h putty.h tree234.h 
324 test.$(OBJ): test.c network.h int64.h puttymem.h ssh.h 
325 tree234.$(OBJ): tree234.c tree234.h 
326 unicode.$(OBJ): unicode.c network.h misc.h puttymem.h putty.h 
327 version.$(OBJ): version.c 
328 wcwidth.$(OBJ): wcwidth.c 
329 wildcard.$(OBJ): wildcard.c 
330 winctrls.$(OBJ): winctrls.c network.h misc.h puttymem.h putty.h winstuff.h 
331 windlg.$(OBJ): windlg.c network.h misc.h ssh.h storage.h puttymem.h int64.h putty.h winstuff.h win_res.h 
332 window.$(OBJ): window.c network.h misc.h puttymem.h storage.h winstuff.h putty.h win_res.h 
333 winnet.$(OBJ): winnet.c network.h misc.h puttymem.h putty.h tree234.h 
334 winstore.$(OBJ): winstore.c network.h misc.h puttymem.h storage.h putty.h 
335 x11fwd.$(OBJ): x11fwd.c network.h misc.h int64.h puttymem.h ssh.h putty.h 
336 ##--
337
338 # Hack to force version.obj to be rebuilt always
339 version.obj: *.c *.h *.rc
340         cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
341
342 ##-- dependencies
343 win_res.$(RES): win_res.rc win_res.h putty.ico
344 ##--
345 win_res.$(RES):
346         rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
347
348 ##-- dependencies
349 scp.$(RES): scp.rc scp.ico
350 ##--
351 scp.$(RES):
352         rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc
353
354 ##-- dependencies
355 pageant.$(RES): pageant.rc pageant.ico pageants.ico
356 ##--
357 pageant.$(RES):
358         rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 pageant.rc
359
360 ##-- dependencies
361 puttygen.$(RES): puttygen.rc puttygen.ico
362 ##--
363 puttygen.$(RES):
364         rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 puttygen.rc
365
366 clean: tidy
367         -del *.exe
368
369 tidy:
370         -del *.obj
371         -del *.res
372         -del *.pch
373         -del *.aps
374         -del *.ilk
375         -del *.pdb
376         -del *.rsp
377         -del *.dsp
378         -del *.dsw
379         -del *.ncb
380         -del *.opt
381         -del *.plg
382         -del *.map
383         -del *.idb
384         -del debug.log