]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - Makefile
Oops - actually check in portfwd.c itself! (Makefile also modified
[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 #  - RCFL=/DASCIICTLS
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 #
36 #  - XFLAGS=/DDEBUG
37 #      Causes PuTTY to enable internal debugging.
38 #
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.
42 #
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.
49 #
50 ##--
51
52 # Enable debug and incremental linking and compiling
53 # CFLAGS = /nologo /W3 /YX /Yd /O1 /Gi /D_WINDOWS /DDEBUG /D_WIN32_WINDOWS=0x401
54 # LFLAGS = /debug
55
56 # Disable debug and incremental linking and compiling
57 CFLAGS = /nologo /W3 /O1 /D_WINDOWS /D_WIN32_WINDOWS=0x401
58 LFLAGS = /incremental:no /fixed
59
60 # Use MSVC DLL
61 # CFLAGS = /nologo /W3 /O1 /MD /D_WINDOWS /D_WIN32_WINDOWS=0x401
62 # LFLAGS = /incremental:no
63
64 .c.obj:
65         cl $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) /c $*.c
66
67 OBJ=obj
68 RES=res
69
70 ##-- objects putty puttytel
71 GOBJS1 = window.$(OBJ) windlg.$(OBJ) winctrls.$(OBJ) terminal.$(OBJ)
72 GOBJS2 = sizetip.$(OBJ) wcwidth.$(OBJ) unicode.$(OBJ)
73 ##-- objects putty puttytel plink
74 LOBJS1 = telnet.$(OBJ) raw.$(OBJ) rlogin.$(OBJ) ldisc.$(OBJ) winnet.$(OBJ)
75 ##-- objects putty plink
76 POBJS = be_all.$(OBJ)
77 ##-- objects puttytel
78 TOBJS = be_nossh.$(OBJ)
79 ##-- objects plink
80 PLOBJS = plink.$(OBJ)
81 ##-- objects pscp
82 SOBJS = scp.$(OBJ) winnet.$(OBJ) be_none.$(OBJ)
83 ##-- objects psftp
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) portfwd.$(OBJ) sshaes.$(OBJ)
93 ##-- objects pageant
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)
97 ##-- objects puttygen
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
109 SRESRC = scp.$(RES)
110 ##-- resources plink
111 LRESRC = plink.$(RES)
112 ##--
113
114 ##-- gui-apps
115 # putty
116 # puttytel
117 # pageant
118 # puttygen
119 ##-- console-apps
120 # pscp
121 # psftp
122 # plink ws2_32
123 ##--
124
125 LIBS1 = advapi32.lib user32.lib gdi32.lib
126 LIBS2 = comctl32.lib comdlg32.lib
127 LIBS3 = shell32.lib winmm.lib imm32.lib
128 SOCK1 = wsock32.lib
129 SOCK2 = ws2_32.lib
130
131 all: putty.exe puttytel.exe pscp.exe psftp.exe \
132      plink.exe pageant.exe puttygen.exe
133
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
136
137 puttytel.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(TOBJS) $(MOBJS) $(MOBJ2) $(PRESRC) puttytel.rsp
138         link $(LFLAGS) -out:puttytel.exe -map:puttytel.map @puttytel.rsp
139
140 pageant.exe: $(PAGE1) $(PAGE2) $(PAGE3) $(PAGERC) pageant.rsp
141         link $(LFLAGS) -out:pageant.exe -map:pageant.map @pageant.rsp
142
143 puttygen.exe: $(GEN1) $(GEN2) $(GEN3) $(GEN4) $(GENRC) puttygen.rsp
144         link $(LFLAGS) -out:puttygen.exe -map:puttygen.map @puttygen.rsp
145
146 pscp.exe: $(SOBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(SRESRC) pscp.rsp
147         link $(LFLAGS) -out:pscp.exe -map:pscp.map @pscp.rsp
148
149 psftp.exe: $(FOBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(SRESRC) psftp.rsp
150         link $(LFLAGS) -out:psftp.exe -map:psftp.map @psftp.rsp
151
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
154
155 ssh.obj:
156         cl $(FWHACK) $(VER) $(CFLAGS) /Gi- /c ssh.c
157
158 putty.rsp: makefile
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
175
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
189
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
199
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
210
211 pscp.rsp: makefile
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
224
225 psftp.rsp: makefile
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
238
239 plink.rsp: makefile
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
254
255 ##-- dependencies
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 portfwd.$(OBJ): portfwd.c network.h puttymem.h ssh.h putty.h
303 xlat.$(OBJ): xlat.c network.h puttymem.h putty.h 
304 ##--
305
306 # Hack to force version.obj to be rebuilt always
307 version.obj: *.c *.h *.rc
308         cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
309
310 ##-- dependencies
311 win_res.$(RES): win_res.rc win_res.h putty.ico
312 ##--
313 win_res.$(RES):
314         rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
315
316 ##-- dependencies
317 scp.$(RES): scp.rc scp.ico
318 ##--
319 scp.$(RES):
320         rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc
321
322 ##-- dependencies
323 pageant.$(RES): pageant.rc pageant.ico pageants.ico
324 ##--
325 pageant.$(RES):
326         rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 pageant.rc
327
328 ##-- dependencies
329 puttygen.$(RES): puttygen.rc puttygen.ico
330 ##--
331 puttygen.$(RES):
332         rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 puttygen.rc
333
334 clean: tidy
335         -del *.exe
336
337 tidy:
338         -del *.obj
339         -del *.res
340         -del *.pch
341         -del *.aps
342         -del *.ilk
343         -del *.pdb
344         -del *.rsp
345         -del *.dsp
346         -del *.dsw
347         -del *.ncb
348         -del *.opt
349         -del *.plg
350         -del *.map
351         -del *.idb
352         -del debug.log