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