| 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 |
| 54 | # LFLAGS = /debug |
| 55 | |
| 56 | # Disable debug and incremental linking and compiling |
| 57 | CFLAGS = /nologo /W3 /O1 /D_WINDOWS |
| 58 | LFLAGS = /incremental:no /fixed |
| 59 | |
| 60 | # Use MSVC DLL |
| 61 | # CFLAGS = /nologo /W3 /O1 /MD /D_WINDOWS |
| 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 = xlat.$(OBJ) sizetip.$(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) 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 |
| 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 | window.$(OBJ): window.c putty.h puttymem.h network.h win_res.h storage.h winstuff.h |
| 257 | windlg.$(OBJ): windlg.c putty.h puttymem.h network.h ssh.h win_res.h winstuff.h |
| 258 | winctrls.$(OBJ): winctrls.c winstuff.h winstuff.h |
| 259 | settings.$(OBJ): settings.c putty.h puttymem.h network.h storage.h |
| 260 | winstore.$(OBJ): winstore.c putty.h puttymem.h network.h storage.h |
| 261 | terminal.$(OBJ): terminal.c putty.h puttymem.h network.h |
| 262 | sizetip.$(OBJ): sizetip.c putty.h puttymem.h network.h winstuff.h |
| 263 | telnet.$(OBJ): telnet.c putty.h puttymem.h network.h |
| 264 | raw.$(OBJ): raw.c putty.h puttymem.h network.h |
| 265 | rlogin.$(OBJ): rlogin.c putty.h puttymem.h network.h |
| 266 | xlat.$(OBJ): xlat.c putty.h puttymem.h network.h |
| 267 | ldisc.$(OBJ): ldisc.c putty.h puttymem.h network.h |
| 268 | misc.$(OBJ): misc.c putty.h puttymem.h network.h |
| 269 | noise.$(OBJ): noise.c putty.h puttymem.h network.h ssh.h storage.h |
| 270 | ssh.$(OBJ): ssh.c ssh.h putty.h puttymem.h network.h tree234.h |
| 271 | sshcrc.$(OBJ): sshcrc.c ssh.h puttymem.h |
| 272 | sshdes.$(OBJ): sshdes.c ssh.h puttymem.h |
| 273 | sshaes.$(OBJ): sshaes.c ssh.h puttymem.h |
| 274 | sshmd5.$(OBJ): sshmd5.c ssh.h puttymem.h |
| 275 | sshrsa.$(OBJ): sshrsa.c ssh.h puttymem.h |
| 276 | sshsha.$(OBJ): sshsha.c ssh.h puttymem.h |
| 277 | sshrand.$(OBJ): sshrand.c ssh.h puttymem.h |
| 278 | sshblowf.$(OBJ): sshblowf.c ssh.h puttymem.h |
| 279 | sshdh.$(OBJ): sshdh.c ssh.h puttymem.h |
| 280 | sshdss.$(OBJ): sshdss.c ssh.h puttymem.h |
| 281 | sshbn.$(OBJ): sshbn.c ssh.h puttymem.h |
| 282 | sshpubk.$(OBJ): sshpubk.c ssh.h puttymem.h |
| 283 | sshzlib.$(OBJ): sshzlib.c ssh.h puttymem.h |
| 284 | scp.$(OBJ): scp.c putty.h puttymem.h network.h winstuff.h |
| 285 | version.$(OBJ): version.c |
| 286 | be_all.$(OBJ): be_all.c |
| 287 | be_nossh.$(OBJ): be_nossh.c |
| 288 | be_none.$(OBJ): be_none.c |
| 289 | plink.$(OBJ): plink.c putty.h puttymem.h network.h winstuff.h |
| 290 | pageant.$(OBJ): pageant.c ssh.h puttymem.h tree234.h |
| 291 | pageantc.$(OBJ): pageantc.c puttymem.h |
| 292 | tree234.$(OBJ): tree234.c tree234.h puttymem.h |
| 293 | puttygen.$(OBJ): puttygen.c putty.h ssh.h winstuff.h |
| 294 | psftp.$(OBJ): psftp.c putty.h ssh.h storage.h sftp.h int64.h |
| 295 | sftp.$(OBJ): sftp.c sftp.h int64.h |
| 296 | int64.$(OBJ): int64.c int64.h |
| 297 | x11fwd.$(OBJ): x11fwd.c putty.h network.h puttymem.h ssh.h |
| 298 | ##-- |
| 299 | |
| 300 | # Hack to force version.obj to be rebuilt always |
| 301 | version.obj: *.c *.h *.rc |
| 302 | cl $(FWHACK) $(VER) $(CFLAGS) /c version.c |
| 303 | |
| 304 | ##-- dependencies |
| 305 | win_res.$(RES): win_res.rc win_res.h putty.ico |
| 306 | ##-- |
| 307 | win_res.$(RES): |
| 308 | rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc |
| 309 | |
| 310 | ##-- dependencies |
| 311 | scp.$(RES): scp.rc scp.ico |
| 312 | ##-- |
| 313 | scp.$(RES): |
| 314 | rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc |
| 315 | |
| 316 | ##-- dependencies |
| 317 | pageant.$(RES): pageant.rc pageant.ico pageants.ico |
| 318 | ##-- |
| 319 | pageant.$(RES): |
| 320 | rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 pageant.rc |
| 321 | |
| 322 | ##-- dependencies |
| 323 | puttygen.$(RES): puttygen.rc puttygen.ico |
| 324 | ##-- |
| 325 | puttygen.$(RES): |
| 326 | rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 puttygen.rc |
| 327 | |
| 328 | clean: tidy |
| 329 | -del *.exe |
| 330 | |
| 331 | tidy: |
| 332 | -del *.obj |
| 333 | -del *.res |
| 334 | -del *.pch |
| 335 | -del *.aps |
| 336 | -del *.ilk |
| 337 | -del *.pdb |
| 338 | -del *.rsp |
| 339 | -del *.dsp |
| 340 | -del *.dsw |
| 341 | -del *.ncb |
| 342 | -del *.opt |
| 343 | -del *.plg |
| 344 | -del *.map |
| 345 | -del *.idb |
| 346 | -del debug.log |