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