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