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 |
49 | CFLAGS = /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 |
56 | LFLAGS = /incremental:no |
374330e2 |
57 | |
58 | .c.obj: |
b191636d |
59 | cl $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) /c $*.c |
374330e2 |
60 | |
3d541627 |
61 | OBJ=obj |
62 | RES=res |
63 | |
89ee5268 |
64 | ##-- objects putty puttytel |
8c3cd914 |
65 | GOBJS1 = window.$(OBJ) windlg.$(OBJ) winctrls.$(OBJ) terminal.$(OBJ) |
4017be6d |
66 | GOBJS2 = xlat.$(OBJ) sizetip.$(OBJ) |
67 | ##-- objects putty puttytel plink |
c91409da |
68 | LOBJS1 = telnet.$(OBJ) raw.$(OBJ) rlogin.$(OBJ) ldisc.$(OBJ) winnet.$(OBJ) |
4017be6d |
69 | ##-- objects putty plink |
5c58ad2d |
70 | POBJS = be_all.$(OBJ) |
89ee5268 |
71 | ##-- objects puttytel |
72 | TOBJS = be_nossh.$(OBJ) |
4017be6d |
73 | ##-- objects plink |
a9422f39 |
74 | PLOBJS = plink.$(OBJ) |
3d541627 |
75 | ##-- objects pscp |
8df7a775 |
76 | SOBJS = scp.$(OBJ) winnet.$(OBJ) be_none.$(OBJ) |
4a8fc3c4 |
77 | ##-- objects psftp |
79fc73e2 |
78 | FOBJS = psftp.$(OBJ) sftp.$(OBJ) int64.$(OBJ) winnet.$(OBJ) be_none.$(OBJ) |
4a8fc3c4 |
79 | ##-- objects putty puttytel pscp psftp plink |
a9422f39 |
80 | MOBJS = misc.$(OBJ) version.$(OBJ) winstore.$(OBJ) settings.$(OBJ) |
8df7a775 |
81 | MOBJ2 = tree234.$(OBJ) |
4a8fc3c4 |
82 | ##-- objects putty pscp psftp plink |
89ee5268 |
83 | OBJS1 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ) |
e5574168 |
84 | OBJS2 = sshsha.$(OBJ) sshblowf.$(OBJ) noise.$(OBJ) sshdh.$(OBJ) sshdss.$(OBJ) |
4ba9b64b |
85 | OBJS3 = sshbn.$(OBJ) sshpubk.$(OBJ) ssh.$(OBJ) pageantc.$(OBJ) sshzlib.$(OBJ) |
8479e33c |
86 | OBJS4 = x11fwd.$(OBJ) sshaes.$(OBJ) |
5c58ad2d |
87 | ##-- objects pageant |
88 | PAGE1 = pageant.$(OBJ) sshrsa.$(OBJ) sshpubk.$(OBJ) sshdes.$(OBJ) sshbn.$(OBJ) |
8479e33c |
89 | PAGE2 = sshmd5.$(OBJ) version.$(OBJ) tree234.$(OBJ) misc.$(OBJ) sshaes.$(OBJ) |
afc47154 |
90 | PAGE3 = sshsha.$(OBJ) |
6e522441 |
91 | ##-- objects puttygen |
92 | GEN1 = puttygen.$(OBJ) sshrsag.$(OBJ) sshprime.$(OBJ) sshdes.$(OBJ) |
93 | GEN2 = sshbn.$(OBJ) sshmd5.$(OBJ) version.$(OBJ) sshrand.$(OBJ) noise.$(OBJ) |
94 | GEN3 = sshsha.$(OBJ) winstore.$(OBJ) misc.$(OBJ) winctrls.$(OBJ) |
8479e33c |
95 | GEN4 = sshrsa.$(OBJ) sshpubk.$(OBJ) sshaes.$(OBJ) |
9d01fc92 |
96 | ##-- resources putty puttytel |
3d541627 |
97 | PRESRC = win_res.$(RES) |
5c58ad2d |
98 | ##-- resources pageant |
99 | PAGERC = pageant.$(RES) |
6e522441 |
100 | ##-- resources puttygen |
101 | GENRC = puttygen.$(RES) |
4a8fc3c4 |
102 | ##-- resources pscp psftp |
3d541627 |
103 | SRESRC = scp.$(RES) |
4017be6d |
104 | ##-- resources plink |
105 | LRESRC = plink.$(RES) |
3d541627 |
106 | ##-- |
107 | |
108 | ##-- gui-apps |
109 | # putty |
89ee5268 |
110 | # puttytel |
5c58ad2d |
111 | # pageant |
6e522441 |
112 | # puttygen |
3d541627 |
113 | ##-- console-apps |
114 | # pscp |
4a8fc3c4 |
115 | # psftp |
6d2d5e8d |
116 | # plink ws2_32 |
3d541627 |
117 | ##-- |
118 | |
374330e2 |
119 | LIBS1 = advapi32.lib user32.lib gdi32.lib |
4017be6d |
120 | LIBS2 = comctl32.lib comdlg32.lib |
5c58ad2d |
121 | LIBS3 = shell32.lib |
4017be6d |
122 | SOCK1 = wsock32.lib |
123 | SOCK2 = ws2_32.lib |
4585985c |
124 | |
79fc73e2 |
125 | all: putty.exe puttytel.exe pscp.exe psftp.exe \ |
126 | plink.exe pageant.exe puttygen.exe |
89ee5268 |
127 | |
9c964e85 |
128 | putty.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(POBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(PRESRC) putty.rsp |
4491fef5 |
129 | link $(LFLAGS) -out:putty.exe -map:putty.map @putty.rsp |
89ee5268 |
130 | |
8df7a775 |
131 | puttytel.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(TOBJS) $(MOBJS) $(MOBJ2) $(PRESRC) puttytel.rsp |
4491fef5 |
132 | link $(LFLAGS) -out:puttytel.exe -map:puttytel.map @puttytel.rsp |
89ee5268 |
133 | |
afc47154 |
134 | pageant.exe: $(PAGE1) $(PAGE2) $(PAGE3) $(PAGERC) pageant.rsp |
4491fef5 |
135 | link $(LFLAGS) -out:pageant.exe -map:pageant.map @pageant.rsp |
5c58ad2d |
136 | |
6e522441 |
137 | puttygen.exe: $(GEN1) $(GEN2) $(GEN3) $(GEN4) $(GENRC) puttygen.rsp |
4491fef5 |
138 | link $(LFLAGS) -out:puttygen.exe -map:puttygen.map @puttygen.rsp |
6e522441 |
139 | |
9c964e85 |
140 | pscp.exe: $(SOBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(SRESRC) pscp.rsp |
4491fef5 |
141 | link $(LFLAGS) -out:pscp.exe -map:pscp.map @pscp.rsp |
89ee5268 |
142 | |
79fc73e2 |
143 | psftp.exe: $(FOBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(SRESRC) psftp.rsp |
144 | link $(LFLAGS) -out:psftp.exe -map:psftp.map @psftp.rsp |
145 | |
9c964e85 |
146 | plink.exe: $(LOBJS1) $(POBJS) $(PLOBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(LRESRC) plink.rsp |
4491fef5 |
147 | link $(LFLAGS) -out:plink.exe -map:plink.map @plink.rsp |
4017be6d |
148 | |
89ee5268 |
149 | putty.rsp: makefile |
150 | echo /nologo /subsystem:windows > putty.rsp |
151 | echo $(GOBJS1) >> putty.rsp |
152 | echo $(GOBJS2) >> putty.rsp |
4017be6d |
153 | echo $(LOBJS1) >> putty.rsp |
89ee5268 |
154 | echo $(POBJS) >> putty.rsp |
155 | echo $(MOBJS) >> putty.rsp |
8df7a775 |
156 | echo $(MOBJ2) >> putty.rsp |
89ee5268 |
157 | echo $(OBJS1) >> putty.rsp |
158 | echo $(OBJS2) >> putty.rsp |
e5574168 |
159 | echo $(OBJS3) >> putty.rsp |
9c964e85 |
160 | echo $(OBJS4) >> putty.rsp |
89ee5268 |
161 | echo $(PRESRC) >> putty.rsp |
162 | echo $(LIBS1) >> putty.rsp |
163 | echo $(LIBS2) >> putty.rsp |
4017be6d |
164 | echo $(SOCK1) >> putty.rsp |
89ee5268 |
165 | |
166 | puttytel.rsp: makefile |
167 | echo /nologo /subsystem:windows > puttytel.rsp |
168 | echo $(GOBJS1) >> puttytel.rsp |
169 | echo $(GOBJS2) >> puttytel.rsp |
4017be6d |
170 | echo $(LOBJS1) >> puttytel.rsp |
89ee5268 |
171 | echo $(TOBJS) >> puttytel.rsp |
172 | echo $(MOBJS) >> puttytel.rsp |
8df7a775 |
173 | echo $(MOBJ2) >> puttytel.rsp |
9d01fc92 |
174 | echo $(PRESRC) >> puttytel.rsp |
89ee5268 |
175 | echo $(LIBS1) >> puttytel.rsp |
176 | echo $(LIBS2) >> puttytel.rsp |
4017be6d |
177 | echo $(SOCK1) >> puttytel.rsp |
89ee5268 |
178 | |
5c58ad2d |
179 | pageant.rsp: makefile |
180 | echo /nologo /subsystem:windows > pageant.rsp |
6e522441 |
181 | echo $(PAGE1) >> pageant.rsp |
182 | echo $(PAGE2) >> pageant.rsp |
afc47154 |
183 | echo $(PAGE3) >> pageant.rsp |
6e522441 |
184 | echo $(PAGERC) >> pageant.rsp |
5c58ad2d |
185 | echo $(LIBS1) >> pageant.rsp |
186 | echo $(LIBS2) >> pageant.rsp |
187 | echo $(LIBS3) >> pageant.rsp |
188 | |
6e522441 |
189 | puttygen.rsp: makefile |
190 | echo /nologo /subsystem:windows > puttygen.rsp |
191 | echo $(GEN1) >> puttygen.rsp |
192 | echo $(GEN2) >> puttygen.rsp |
193 | echo $(GEN3) >> puttygen.rsp |
194 | echo $(GEN4) >> puttygen.rsp |
195 | echo $(GENRC) >> puttygen.rsp |
196 | echo $(LIBS1) >> puttygen.rsp |
197 | echo $(LIBS2) >> puttygen.rsp |
198 | echo $(LIBS3) >> puttygen.rsp |
199 | |
89ee5268 |
200 | pscp.rsp: makefile |
201 | echo /nologo /subsystem:console > pscp.rsp |
202 | echo $(SOBJS) >> pscp.rsp |
203 | echo $(MOBJS) >> pscp.rsp |
8df7a775 |
204 | echo $(MOBJ2) >> pscp.rsp |
89ee5268 |
205 | echo $(OBJS1) >> pscp.rsp |
206 | echo $(OBJS2) >> pscp.rsp |
e5574168 |
207 | echo $(OBJS3) >> pscp.rsp |
9c964e85 |
208 | echo $(OBJS4) >> pscp.rsp |
89ee5268 |
209 | echo $(SRESRC) >> pscp.rsp |
210 | echo $(LIBS1) >> pscp.rsp |
211 | echo $(LIBS2) >> pscp.rsp |
4017be6d |
212 | echo $(SOCK1) >> pscp.rsp |
213 | |
79fc73e2 |
214 | psftp.rsp: makefile |
215 | echo /nologo /subsystem:console > psftp.rsp |
216 | echo $(FOBJS) >> psftp.rsp |
217 | echo $(MOBJS) >> psftp.rsp |
218 | echo $(MOBJ2) >> psftp.rsp |
219 | echo $(OBJS1) >> psftp.rsp |
220 | echo $(OBJS2) >> psftp.rsp |
221 | echo $(OBJS3) >> psftp.rsp |
222 | echo $(OBJS4) >> psftp.rsp |
223 | echo $(SRESRC) >> psftp.rsp |
224 | echo $(LIBS1) >> psftp.rsp |
225 | echo $(LIBS2) >> psftp.rsp |
226 | echo $(SOCK1) >> psftp.rsp |
227 | |
4017be6d |
228 | plink.rsp: makefile |
229 | echo /nologo /subsystem:console > plink.rsp |
230 | echo $(LOBJS1) >> plink.rsp |
231 | echo $(POBJS) >> plink.rsp |
232 | echo $(PLOBJS) >> plink.rsp |
233 | echo $(MOBJS) >> plink.rsp |
8df7a775 |
234 | echo $(MOBJ2) >> plink.rsp |
4017be6d |
235 | echo $(OBJS1) >> plink.rsp |
236 | echo $(OBJS2) >> plink.rsp |
237 | echo $(OBJS3) >> plink.rsp |
9c964e85 |
238 | echo $(OBJS4) >> plink.rsp |
4017be6d |
239 | echo $(LRESRC) >> plink.rsp |
240 | echo $(LIBS1) >> plink.rsp |
241 | echo $(LIBS2) >> plink.rsp |
242 | echo $(SOCK2) >> plink.rsp |
3d541627 |
243 | |
244 | ##-- dependencies |
dcbde236 |
245 | window.$(OBJ): window.c putty.h puttymem.h network.h win_res.h storage.h winstuff.h |
246 | windlg.$(OBJ): windlg.c putty.h puttymem.h network.h ssh.h win_res.h winstuff.h |
8c3cd914 |
247 | winctrls.$(OBJ): winctrls.c winstuff.h winstuff.h |
dcbde236 |
248 | settings.$(OBJ): settings.c putty.h puttymem.h network.h storage.h |
249 | winstore.$(OBJ): winstore.c putty.h puttymem.h network.h storage.h |
250 | terminal.$(OBJ): terminal.c putty.h puttymem.h network.h |
251 | sizetip.$(OBJ): sizetip.c putty.h puttymem.h network.h winstuff.h |
252 | telnet.$(OBJ): telnet.c putty.h puttymem.h network.h |
253 | raw.$(OBJ): raw.c putty.h puttymem.h network.h |
c91409da |
254 | rlogin.$(OBJ): rlogin.c putty.h puttymem.h network.h |
dcbde236 |
255 | xlat.$(OBJ): xlat.c putty.h puttymem.h network.h |
256 | ldisc.$(OBJ): ldisc.c putty.h puttymem.h network.h |
257 | misc.$(OBJ): misc.c putty.h puttymem.h network.h |
258 | noise.$(OBJ): noise.c putty.h puttymem.h network.h ssh.h storage.h |
259 | ssh.$(OBJ): ssh.c ssh.h putty.h puttymem.h network.h tree234.h |
260 | sshcrc.$(OBJ): sshcrc.c ssh.h puttymem.h |
261 | sshdes.$(OBJ): sshdes.c ssh.h puttymem.h |
8479e33c |
262 | sshaes.$(OBJ): sshaes.c ssh.h puttymem.h |
dcbde236 |
263 | sshmd5.$(OBJ): sshmd5.c ssh.h puttymem.h |
264 | sshrsa.$(OBJ): sshrsa.c ssh.h puttymem.h |
265 | sshsha.$(OBJ): sshsha.c ssh.h puttymem.h |
266 | sshrand.$(OBJ): sshrand.c ssh.h puttymem.h |
267 | sshblowf.$(OBJ): sshblowf.c ssh.h puttymem.h |
268 | sshdh.$(OBJ): sshdh.c ssh.h puttymem.h |
269 | sshdss.$(OBJ): sshdss.c ssh.h puttymem.h |
270 | sshbn.$(OBJ): sshbn.c ssh.h puttymem.h |
271 | sshpubk.$(OBJ): sshpubk.c ssh.h puttymem.h |
272 | sshzlib.$(OBJ): sshzlib.c ssh.h puttymem.h |
273 | scp.$(OBJ): scp.c putty.h puttymem.h network.h winstuff.h |
3d541627 |
274 | version.$(OBJ): version.c |
89ee5268 |
275 | be_all.$(OBJ): be_all.c |
276 | be_nossh.$(OBJ): be_nossh.c |
277 | be_none.$(OBJ): be_none.c |
dcbde236 |
278 | plink.$(OBJ): plink.c putty.h puttymem.h network.h winstuff.h |
279 | pageant.$(OBJ): pageant.c ssh.h puttymem.h tree234.h |
280 | pageantc.$(OBJ): pageantc.c puttymem.h |
281 | tree234.$(OBJ): tree234.c tree234.h puttymem.h |
3332c06e |
282 | puttygen.$(OBJ): puttygen.c putty.h ssh.h winstuff.h |
4a8fc3c4 |
283 | psftp.$(OBJ): psftp.c putty.h ssh.h storage.h sftp.h int64.h |
791ed432 |
284 | sftp.$(OBJ): sftp.c sftp.h int64.h |
4a8fc3c4 |
285 | int64.$(OBJ): int64.c int64.h |
8ddd7f4e |
286 | x11fwd.$(OBJ): x11fwd.c putty.h network.h puttymem.h ssh.h |
3d541627 |
287 | ##-- |
067a15ea |
288 | |
289 | # Hack to force version.obj to be rebuilt always |
3d541627 |
290 | version.obj: versionpseudotarget |
291 | @echo (built version.obj) |
067a15ea |
292 | versionpseudotarget: |
293 | cl $(FWHACK) $(VER) $(CFLAGS) /c version.c |
374330e2 |
294 | |
3d541627 |
295 | ##-- dependencies |
296 | win_res.$(RES): win_res.rc win_res.h putty.ico |
297 | ##-- |
298 | win_res.$(RES): |
6ed3635b |
299 | rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc |
374330e2 |
300 | |
3d541627 |
301 | ##-- dependencies |
302 | scp.$(RES): scp.rc scp.ico |
303 | ##-- |
304 | scp.$(RES): |
6ed3635b |
305 | rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc |
4585985c |
306 | |
5c58ad2d |
307 | ##-- dependencies |
308 | pageant.$(RES): pageant.rc pageant.ico pageants.ico |
309 | ##-- |
310 | pageant.$(RES): |
311 | rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 pageant.rc |
312 | |
6e522441 |
313 | ##-- dependencies |
314 | puttygen.$(RES): puttygen.rc puttygen.ico |
315 | ##-- |
316 | puttygen.$(RES): |
317 | rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 puttygen.rc |
318 | |
1a5adedf |
319 | clean: tidy |
374330e2 |
320 | del *.exe |
1a5adedf |
321 | |
322 | tidy: |
323 | del *.obj |
374330e2 |
324 | del *.res |
325 | del *.pch |
326 | del *.aps |
327 | del *.ilk |
328 | del *.pdb |
067a15ea |
329 | del *.rsp |
1ee529ed |
330 | del *.dsp |
331 | del *.dsw |
332 | del *.ncb |
333 | del *.opt |
334 | del *.plg |
1a5adedf |
335 | del *.map |