ANSI remote printer support. Raw mode only.
[u/mdw/putty] / Makefile
CommitLineData
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#
2871113a 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#
fc35d05a 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#
9a1291fe 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#
6ed3635b 54# - RCFL=/DASCIICTLS
760858ff 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#
d9027fbd 60# - XFLAGS=/DDEBUG
61# Causes PuTTY to enable internal debugging.
62#
b191636d 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#
3d541627 74##--
676c0556 75
d9027fbd 76# Enable debug and incremental linking and compiling
dea851d6 77# CFLAGS = /nologo /W3 /YX /Yd /O1 /Gi /D_WINDOWS /DDEBUG /D_WIN32_WINDOWS=0x401
cdd6c586 78# LFLAGS = /debug
373e94e9 79
d9027fbd 80# Disable debug and incremental linking and compiling
a401e5f3 81CFLAGS = /nologo /W3 /O1 /D_WINDOWS /D_WIN32_WINDOWS=0x401 /DWINVER=0x401
cdd6c586 82LFLAGS = /incremental:no /fixed
373e94e9 83
d9027fbd 84# Use MSVC DLL
dea851d6 85# CFLAGS = /nologo /W3 /O1 /MD /D_WINDOWS /D_WIN32_WINDOWS=0x401
d9027fbd 86# LFLAGS = /incremental:no
374330e2 87
88.c.obj:
b191636d 89 cl $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) /c $*.c
374330e2 90
3d541627 91OBJ=obj
92RES=res
93
89ee5268 94##-- objects putty puttytel
8c3cd914 95GOBJS1 = window.$(OBJ) windlg.$(OBJ) winctrls.$(OBJ) terminal.$(OBJ)
00db133f 96GOBJS2 = sizetip.$(OBJ) wcwidth.$(OBJ) unicode.$(OBJ) logging.$(OBJ)
b44b307a 97GOBJS3 = printing.$(OBJ)
4017be6d 98##-- objects putty puttytel plink
c91409da 99LOBJS1 = telnet.$(OBJ) raw.$(OBJ) rlogin.$(OBJ) ldisc.$(OBJ) winnet.$(OBJ)
4017be6d 100##-- objects putty plink
5c58ad2d 101POBJS = be_all.$(OBJ)
89ee5268 102##-- objects puttytel
103TOBJS = be_nossh.$(OBJ)
4017be6d 104##-- objects plink
00db133f 105PLOBJS = plink.$(OBJ) logging.$(OBJ)
3d541627 106##-- objects pscp
4eb24e3a 107SOBJS = scp.$(OBJ) winnet.$(OBJ) be_none.$(OBJ) wildcard.$(OBJ)
4a8fc3c4 108##-- objects psftp
fd5e5847 109FOBJS = psftp.$(OBJ) winnet.$(OBJ) be_none.$(OBJ)
110##-- objects pscp psftp
00db133f 111SFOBJS = sftp.$(OBJ) int64.$(OBJ) logging.$(OBJ)
4a8fc3c4 112##-- objects putty puttytel pscp psftp plink
a9422f39 113MOBJS = misc.$(OBJ) version.$(OBJ) winstore.$(OBJ) settings.$(OBJ)
8df7a775 114MOBJ2 = tree234.$(OBJ)
ff2ae367 115##-- objects pscp psftp plink
116COBJS = console.$(OBJ)
4a8fc3c4 117##-- objects putty pscp psftp plink
89ee5268 118OBJS1 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ)
9a3a93a5 119OBJS2 = sshsha.$(OBJ) sshblowf.$(OBJ) noise.$(OBJ) sshdh.$(OBJ) sshcrcda.$(OBJ)
120OBJS3 = sshpubk.$(OBJ) ssh.$(OBJ) pageantc.$(OBJ) sshzlib.$(OBJ) sshdss.$(OBJ)
121OBJS4 = x11fwd.$(OBJ) portfwd.$(OBJ) sshaes.$(OBJ) sshsh512.$(OBJ) sshbn.$(OBJ)
5c58ad2d 122##-- objects pageant
123PAGE1 = pageant.$(OBJ) sshrsa.$(OBJ) sshpubk.$(OBJ) sshdes.$(OBJ) sshbn.$(OBJ)
8479e33c 124PAGE2 = sshmd5.$(OBJ) version.$(OBJ) tree234.$(OBJ) misc.$(OBJ) sshaes.$(OBJ)
5c72ca61 125PAGE3 = sshsha.$(OBJ) pageantc.$(OBJ) sshdss.$(OBJ) sshsh512.$(OBJ)
6e522441 126##-- objects puttygen
5c72ca61 127GEN1 = puttygen.$(OBJ) sshrsag.$(OBJ) sshdssg.$(OBJ) sshprime.$(OBJ)
128GEN2 = sshdes.$(OBJ) sshbn.$(OBJ) sshmd5.$(OBJ) version.$(OBJ) sshrand.$(OBJ)
129GEN3 = noise.$(OBJ) sshsha.$(OBJ) winstore.$(OBJ) misc.$(OBJ) winctrls.$(OBJ)
130GEN4 = sshrsa.$(OBJ) sshdss.$(OBJ) sshpubk.$(OBJ) sshaes.$(OBJ) sshsh512.$(OBJ)
9d01fc92 131##-- resources putty puttytel
3d541627 132PRESRC = win_res.$(RES)
5c58ad2d 133##-- resources pageant
134PAGERC = pageant.$(RES)
6e522441 135##-- resources puttygen
136GENRC = puttygen.$(RES)
4a8fc3c4 137##-- resources pscp psftp
3d541627 138SRESRC = scp.$(RES)
4017be6d 139##-- resources plink
140LRESRC = plink.$(RES)
3d541627 141##--
142
143##-- gui-apps
144# putty
89ee5268 145# puttytel
5c58ad2d 146# pageant
6e522441 147# puttygen
3d541627 148##-- console-apps
149# pscp
4a8fc3c4 150# psftp
6d2d5e8d 151# plink ws2_32
3d541627 152##--
153
374330e2 154LIBS1 = advapi32.lib user32.lib gdi32.lib
4017be6d 155LIBS2 = comctl32.lib comdlg32.lib
88485e4d 156LIBS3 = shell32.lib winmm.lib imm32.lib
4017be6d 157SOCK1 = wsock32.lib
158SOCK2 = ws2_32.lib
4585985c 159
79fc73e2 160all: putty.exe puttytel.exe pscp.exe psftp.exe \
161 plink.exe pageant.exe puttygen.exe
89ee5268 162
9c964e85 163putty.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(POBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(PRESRC) putty.rsp
4491fef5 164 link $(LFLAGS) -out:putty.exe -map:putty.map @putty.rsp
89ee5268 165
8df7a775 166puttytel.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(TOBJS) $(MOBJS) $(MOBJ2) $(PRESRC) puttytel.rsp
4491fef5 167 link $(LFLAGS) -out:puttytel.exe -map:puttytel.map @puttytel.rsp
89ee5268 168
afc47154 169pageant.exe: $(PAGE1) $(PAGE2) $(PAGE3) $(PAGERC) pageant.rsp
4491fef5 170 link $(LFLAGS) -out:pageant.exe -map:pageant.map @pageant.rsp
5c58ad2d 171
6e522441 172puttygen.exe: $(GEN1) $(GEN2) $(GEN3) $(GEN4) $(GENRC) puttygen.rsp
4491fef5 173 link $(LFLAGS) -out:puttygen.exe -map:puttygen.map @puttygen.rsp
6e522441 174
ff2ae367 175pscp.exe: $(SOBJS) $(SFOBJS) $(COBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(SRESRC) pscp.rsp
4491fef5 176 link $(LFLAGS) -out:pscp.exe -map:pscp.map @pscp.rsp
89ee5268 177
ff2ae367 178psftp.exe: $(FOBJS) $(SFOBJS) $(COBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(SRESRC) psftp.rsp
79fc73e2 179 link $(LFLAGS) -out:psftp.exe -map:psftp.map @psftp.rsp
180
ff2ae367 181plink.exe: $(LOBJS1) $(POBJS) $(PLOBJS) $(COBJS) $(MOBJS) $(MOBJ2) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(LRESRC) plink.rsp
4491fef5 182 link $(LFLAGS) -out:plink.exe -map:plink.map @plink.rsp
4017be6d 183
d9027fbd 184ssh.obj:
73e78a30 185 cl $(COMPAT) $(FWHACK) $(VER) $(XFLAGS) $(CFLAGS) /Gi- /c ssh.c
d9027fbd 186
89ee5268 187putty.rsp: makefile
188 echo /nologo /subsystem:windows > putty.rsp
189 echo $(GOBJS1) >> putty.rsp
190 echo $(GOBJS2) >> putty.rsp
4017be6d 191 echo $(LOBJS1) >> putty.rsp
89ee5268 192 echo $(POBJS) >> putty.rsp
193 echo $(MOBJS) >> putty.rsp
8df7a775 194 echo $(MOBJ2) >> putty.rsp
89ee5268 195 echo $(OBJS1) >> putty.rsp
196 echo $(OBJS2) >> putty.rsp
e5574168 197 echo $(OBJS3) >> putty.rsp
9c964e85 198 echo $(OBJS4) >> putty.rsp
89ee5268 199 echo $(PRESRC) >> putty.rsp
200 echo $(LIBS1) >> putty.rsp
201 echo $(LIBS2) >> putty.rsp
defab6b8 202 echo $(LIBS3) >> putty.rsp
4017be6d 203 echo $(SOCK1) >> putty.rsp
89ee5268 204
205puttytel.rsp: makefile
206 echo /nologo /subsystem:windows > puttytel.rsp
207 echo $(GOBJS1) >> puttytel.rsp
208 echo $(GOBJS2) >> puttytel.rsp
4017be6d 209 echo $(LOBJS1) >> puttytel.rsp
89ee5268 210 echo $(TOBJS) >> puttytel.rsp
211 echo $(MOBJS) >> puttytel.rsp
8df7a775 212 echo $(MOBJ2) >> puttytel.rsp
9d01fc92 213 echo $(PRESRC) >> puttytel.rsp
89ee5268 214 echo $(LIBS1) >> puttytel.rsp
215 echo $(LIBS2) >> puttytel.rsp
defab6b8 216 echo $(LIBS3) >> puttytel.rsp
4017be6d 217 echo $(SOCK1) >> puttytel.rsp
89ee5268 218
5c58ad2d 219pageant.rsp: makefile
220 echo /nologo /subsystem:windows > pageant.rsp
6e522441 221 echo $(PAGE1) >> pageant.rsp
222 echo $(PAGE2) >> pageant.rsp
afc47154 223 echo $(PAGE3) >> pageant.rsp
6e522441 224 echo $(PAGERC) >> pageant.rsp
5c58ad2d 225 echo $(LIBS1) >> pageant.rsp
226 echo $(LIBS2) >> pageant.rsp
227 echo $(LIBS3) >> pageant.rsp
228
6e522441 229puttygen.rsp: makefile
230 echo /nologo /subsystem:windows > puttygen.rsp
231 echo $(GEN1) >> puttygen.rsp
232 echo $(GEN2) >> puttygen.rsp
233 echo $(GEN3) >> puttygen.rsp
234 echo $(GEN4) >> puttygen.rsp
235 echo $(GENRC) >> puttygen.rsp
236 echo $(LIBS1) >> puttygen.rsp
237 echo $(LIBS2) >> puttygen.rsp
238 echo $(LIBS3) >> puttygen.rsp
239
89ee5268 240pscp.rsp: makefile
241 echo /nologo /subsystem:console > pscp.rsp
242 echo $(SOBJS) >> pscp.rsp
fd5e5847 243 echo $(SFOBJS) >> pscp.rsp
ff2ae367 244 echo $(COBJS) >> pscp.rsp
89ee5268 245 echo $(MOBJS) >> pscp.rsp
8df7a775 246 echo $(MOBJ2) >> pscp.rsp
89ee5268 247 echo $(OBJS1) >> pscp.rsp
248 echo $(OBJS2) >> pscp.rsp
e5574168 249 echo $(OBJS3) >> pscp.rsp
9c964e85 250 echo $(OBJS4) >> pscp.rsp
89ee5268 251 echo $(SRESRC) >> pscp.rsp
252 echo $(LIBS1) >> pscp.rsp
253 echo $(LIBS2) >> pscp.rsp
4017be6d 254 echo $(SOCK1) >> pscp.rsp
255
79fc73e2 256psftp.rsp: makefile
257 echo /nologo /subsystem:console > psftp.rsp
258 echo $(FOBJS) >> psftp.rsp
fd5e5847 259 echo $(SFOBJS) >> psftp.rsp
ff2ae367 260 echo $(COBJS) >> psftp.rsp
79fc73e2 261 echo $(MOBJS) >> psftp.rsp
262 echo $(MOBJ2) >> psftp.rsp
263 echo $(OBJS1) >> psftp.rsp
264 echo $(OBJS2) >> psftp.rsp
265 echo $(OBJS3) >> psftp.rsp
266 echo $(OBJS4) >> psftp.rsp
267 echo $(SRESRC) >> psftp.rsp
268 echo $(LIBS1) >> psftp.rsp
269 echo $(LIBS2) >> psftp.rsp
270 echo $(SOCK1) >> psftp.rsp
271
4017be6d 272plink.rsp: makefile
273 echo /nologo /subsystem:console > plink.rsp
274 echo $(LOBJS1) >> plink.rsp
275 echo $(POBJS) >> plink.rsp
276 echo $(PLOBJS) >> plink.rsp
ff2ae367 277 echo $(COBJS) >> plink.rsp
4017be6d 278 echo $(MOBJS) >> plink.rsp
8df7a775 279 echo $(MOBJ2) >> plink.rsp
4017be6d 280 echo $(OBJS1) >> plink.rsp
281 echo $(OBJS2) >> plink.rsp
282 echo $(OBJS3) >> plink.rsp
9c964e85 283 echo $(OBJS4) >> plink.rsp
4017be6d 284 echo $(LRESRC) >> plink.rsp
285 echo $(LIBS1) >> plink.rsp
286 echo $(LIBS2) >> plink.rsp
287 echo $(SOCK2) >> plink.rsp
3d541627 288
289##-- dependencies
2871113a 290be_all.$(OBJ): be_all.c network.h misc.h puttymem.h putty.h
291be_none.$(OBJ): be_none.c network.h misc.h puttymem.h putty.h
292be_nossh.$(OBJ): be_nossh.c network.h misc.h puttymem.h putty.h
827b76b3 293console.$(OBJ): console.c network.h misc.h puttymem.h int64.h storage.h ssh.h putty.h
2871113a 294int64.$(OBJ): int64.c int64.h
295ldisc.$(OBJ): ldisc.c network.h misc.h puttymem.h putty.h
827b76b3 296logging.$(OBJ): logging.c network.h misc.h puttymem.h putty.h
2871113a 297misc.$(OBJ): misc.c network.h misc.h puttymem.h putty.h
827b76b3 298noise.$(OBJ): noise.c network.h misc.h puttymem.h int64.h storage.h ssh.h putty.h
299pageant.$(OBJ): pageant.c network.h misc.h int64.h puttymem.h ssh.h tree234.h
8a23a541 300pageantc.$(OBJ): pageantc.c puttymem.h
2871113a 301plink.$(OBJ): plink.c network.h misc.h puttymem.h storage.h putty.h tree234.h
827b76b3 302portfwd.$(OBJ): portfwd.c network.h misc.h puttymem.h int64.h ssh.h putty.h
2871113a 303psftp.$(OBJ): psftp.c network.h misc.h sftp.h ssh.h storage.h int64.h puttymem.h putty.h
827b76b3 304puttygen.$(OBJ): puttygen.c network.h misc.h puttymem.h int64.h winstuff.h ssh.h putty.h
2871113a 305raw.$(OBJ): raw.c network.h misc.h puttymem.h putty.h
306rlogin.$(OBJ): rlogin.c network.h misc.h puttymem.h putty.h
827b76b3 307scp.$(OBJ): scp.c network.h misc.h sftp.h ssh.h storage.h int64.h puttymem.h putty.h winstuff.h
2871113a 308settings.$(OBJ): settings.c network.h misc.h puttymem.h storage.h putty.h
827b76b3 309sftp.$(OBJ): sftp.c misc.h puttymem.h sftp.h int64.h
2871113a 310sizetip.$(OBJ): sizetip.c network.h misc.h puttymem.h winstuff.h putty.h
827b76b3 311ssh.$(OBJ): ssh.c network.h misc.h puttymem.h int64.h ssh.h putty.h tree234.h
312sshaes.$(OBJ): sshaes.c network.h puttymem.h int64.h ssh.h
313sshblowf.$(OBJ): sshblowf.c network.h puttymem.h int64.h ssh.h
314sshbn.$(OBJ): sshbn.c network.h misc.h int64.h puttymem.h ssh.h
8a23a541 315sshcrc.$(OBJ): sshcrc.c
827b76b3 316sshcrcda.$(OBJ): sshcrcda.c network.h misc.h int64.h puttymem.h ssh.h
317sshdes.$(OBJ): sshdes.c network.h puttymem.h int64.h ssh.h
318sshdh.$(OBJ): sshdh.c network.h puttymem.h int64.h ssh.h
5c72ca61 319sshdss.$(OBJ): sshdss.c network.h misc.h int64.h puttymem.h ssh.h
320sshdssg.$(OBJ): sshdssg.c network.h misc.h int64.h puttymem.h ssh.h
827b76b3 321sshmd5.$(OBJ): sshmd5.c network.h puttymem.h int64.h ssh.h
322sshprime.$(OBJ): sshprime.c network.h puttymem.h int64.h ssh.h
323sshpubk.$(OBJ): sshpubk.c network.h misc.h int64.h puttymem.h ssh.h
324sshrand.$(OBJ): sshrand.c network.h puttymem.h int64.h ssh.h
325sshrsa.$(OBJ): sshrsa.c network.h misc.h int64.h puttymem.h ssh.h
326sshrsag.$(OBJ): sshrsag.c network.h puttymem.h int64.h ssh.h
327sshsh512.$(OBJ): sshsh512.c network.h puttymem.h int64.h ssh.h
328sshsha.$(OBJ): sshsha.c network.h puttymem.h int64.h ssh.h
329sshzlib.$(OBJ): sshzlib.c network.h puttymem.h int64.h ssh.h
2871113a 330telnet.$(OBJ): telnet.c network.h misc.h puttymem.h putty.h
331terminal.$(OBJ): terminal.c network.h misc.h puttymem.h putty.h tree234.h
8a23a541 332tree234.$(OBJ): tree234.c tree234.h
2871113a 333unicode.$(OBJ): unicode.c network.h misc.h puttymem.h putty.h
8a23a541 334version.$(OBJ): version.c
2871113a 335wcwidth.$(OBJ): wcwidth.c
336wildcard.$(OBJ): wildcard.c
337winctrls.$(OBJ): winctrls.c network.h misc.h puttymem.h putty.h winstuff.h
827b76b3 338windlg.$(OBJ): windlg.c network.h misc.h ssh.h storage.h int64.h puttymem.h putty.h winstuff.h win_res.h
2871113a 339window.$(OBJ): window.c network.h misc.h puttymem.h storage.h winstuff.h putty.h win_res.h
340winnet.$(OBJ): winnet.c network.h misc.h puttymem.h putty.h tree234.h
341winstore.$(OBJ): winstore.c network.h misc.h puttymem.h storage.h putty.h
827b76b3 342x11fwd.$(OBJ): x11fwd.c network.h misc.h puttymem.h int64.h ssh.h putty.h
3d541627 343##--
067a15ea 344
345# Hack to force version.obj to be rebuilt always
d9027fbd 346version.obj: *.c *.h *.rc
067a15ea 347 cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
374330e2 348
3d541627 349##-- dependencies
350win_res.$(RES): win_res.rc win_res.h putty.ico
351##--
352win_res.$(RES):
6ed3635b 353 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
374330e2 354
3d541627 355##-- dependencies
356scp.$(RES): scp.rc scp.ico
357##--
358scp.$(RES):
6ed3635b 359 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc
4585985c 360
5c58ad2d 361##-- dependencies
362pageant.$(RES): pageant.rc pageant.ico pageants.ico
363##--
364pageant.$(RES):
365 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 pageant.rc
366
6e522441 367##-- dependencies
368puttygen.$(RES): puttygen.rc puttygen.ico
369##--
370puttygen.$(RES):
371 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 puttygen.rc
372
1a5adedf 373clean: tidy
d9027fbd 374 -del *.exe
1a5adedf 375
376tidy:
d9027fbd 377 -del *.obj
378 -del *.res
379 -del *.pch
380 -del *.aps
381 -del *.ilk
382 -del *.pdb
383 -del *.rsp
384 -del *.dsp
385 -del *.dsw
386 -del *.ncb
387 -del *.opt
388 -del *.plg
389 -del *.map
390 -del *.idb
391 -del debug.log