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