Rationalised host key storage. Also started code reorg: persistent-state
[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#
21# - COMPAT=/DWIN32S_COMPAT
22# Generates a binary that works (minimally) with Win32s.
23#
4d331a77 24# - COMPAT=/DAUTO_WINSOCK
25# Causes PuTTY to assume that <windows.h> includes its own WinSock
26# header file, so that it won't try to include <winsock.h>.
27#
28# - COMPAT=/DWINSOCK_TWO
29# Causes the PuTTY utilities to include <winsock2.h> instead of
30# <winsock.h>, except Plink which _needs_ WinSock 2 so it already
31# does this.
32#
6ed3635b 33# - RCFL=/DASCIICTLS
760858ff 34# Uses ASCII rather than Unicode to specify the tab control in
35# the resource file. Probably most useful when compiling with
36# Cygnus/mingw32, whose resource compiler may have less of a
37# problem with it.
38#
3d541627 39##--
676c0556 40
5f48a59c 41CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd
373e94e9 42# LFLAGS = /debug
43
44# Use MSVC DLL
c9def1b8 45# CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /MD /Fd
373e94e9 46
47# Disable debug and incremental linking
48LFLAGS = /incremental:no
374330e2 49
50.c.obj:
676c0556 51 cl $(COMPAT) $(FWHACK) $(CFLAGS) /c $*.c
374330e2 52
3d541627 53OBJ=obj
54RES=res
55
89ee5268 56##-- objects putty puttytel
4017be6d 57GOBJS1 = window.$(OBJ) windlg.$(OBJ) terminal.$(OBJ)
58GOBJS2 = xlat.$(OBJ) sizetip.$(OBJ)
59##-- objects putty puttytel plink
60LOBJS1 = telnet.$(OBJ) raw.$(OBJ) ldisc.$(OBJ)
61##-- objects putty plink
5c58ad2d 62POBJS = be_all.$(OBJ)
89ee5268 63##-- objects puttytel
64TOBJS = be_nossh.$(OBJ)
4017be6d 65##-- objects plink
66PLOBJS = plink.$(OBJ) windlg.$(OBJ)
3d541627 67##-- objects pscp
5c58ad2d 68SOBJS = scp.$(OBJ) windlg.$(OBJ) be_none.$(OBJ)
4017be6d 69##-- objects putty puttytel pscp plink
d5859615 70MOBJS = misc.$(OBJ) version.$(OBJ) winstore.$(OBJ)
4017be6d 71##-- objects putty pscp plink
89ee5268 72OBJS1 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ)
e5574168 73OBJS2 = sshsha.$(OBJ) sshblowf.$(OBJ) noise.$(OBJ) sshdh.$(OBJ) sshdss.$(OBJ)
dacbd0e8 74OBJS3 = sshbn.$(OBJ) sshpubk.$(OBJ) ssh.$(OBJ) pageantc.$(OBJ) tree234.$(OBJ)
5c58ad2d 75##-- objects pageant
76PAGE1 = pageant.$(OBJ) sshrsa.$(OBJ) sshpubk.$(OBJ) sshdes.$(OBJ) sshbn.$(OBJ)
77PAGE2 = sshmd5.$(OBJ) version.$(OBJ) tree234.$(OBJ)
3d541627 78##-- resources putty
79PRESRC = win_res.$(RES)
89ee5268 80##-- resources puttytel
0ac99c2f 81TRESRC = nosshres.$(RES)
5c58ad2d 82##-- resources pageant
83PAGERC = pageant.$(RES)
3d541627 84##-- resources pscp
85SRESRC = scp.$(RES)
4017be6d 86##-- resources plink
87LRESRC = plink.$(RES)
3d541627 88##--
89
90##-- gui-apps
91# putty
89ee5268 92# puttytel
5c58ad2d 93# pageant
3d541627 94##-- console-apps
95# pscp
5c58ad2d 96# plink
3d541627 97##--
98
374330e2 99LIBS1 = advapi32.lib user32.lib gdi32.lib
4017be6d 100LIBS2 = comctl32.lib comdlg32.lib
5c58ad2d 101LIBS3 = shell32.lib
4017be6d 102SOCK1 = wsock32.lib
103SOCK2 = ws2_32.lib
4585985c 104
5c58ad2d 105all: putty.exe puttytel.exe pscp.exe plink.exe pageant.exe
89ee5268 106
4017be6d 107putty.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(POBJS) $(MOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(PRESRC) putty.rsp
373e94e9 108 link $(LFLAGS) -out:putty.exe @putty.rsp
89ee5268 109
4017be6d 110puttytel.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(TOBJS) $(MOBJS) $(TRESRC) puttytel.rsp
373e94e9 111 link $(LFLAGS) -out:puttytel.exe @puttytel.rsp
89ee5268 112
5c58ad2d 113pageant.exe: $(PAGE1) $(PAGE2) $(PAGERC) pageant.rsp
114 link $(LFLAGS) -out:pageant.exe @pageant.rsp
115
0ac99c2f 116pscp.exe: $(SOBJS) $(MOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(SRESRC) pscp.rsp
373e94e9 117 link $(LFLAGS) -out:pscp.exe @pscp.rsp
89ee5268 118
4017be6d 119plink.exe: $(LOBJS1) $(POBJS) $(PLOBJS) $(MOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(LRESRC) plink.rsp
120 link $(LFLAGS) -out:plink.exe @plink.rsp
121
89ee5268 122putty.rsp: makefile
123 echo /nologo /subsystem:windows > putty.rsp
124 echo $(GOBJS1) >> putty.rsp
125 echo $(GOBJS2) >> putty.rsp
4017be6d 126 echo $(LOBJS1) >> putty.rsp
89ee5268 127 echo $(POBJS) >> putty.rsp
128 echo $(MOBJS) >> putty.rsp
129 echo $(OBJS1) >> putty.rsp
130 echo $(OBJS2) >> putty.rsp
e5574168 131 echo $(OBJS3) >> putty.rsp
89ee5268 132 echo $(PRESRC) >> putty.rsp
133 echo $(LIBS1) >> putty.rsp
134 echo $(LIBS2) >> putty.rsp
4017be6d 135 echo $(SOCK1) >> putty.rsp
89ee5268 136
137puttytel.rsp: makefile
138 echo /nologo /subsystem:windows > puttytel.rsp
139 echo $(GOBJS1) >> puttytel.rsp
140 echo $(GOBJS2) >> puttytel.rsp
4017be6d 141 echo $(LOBJS1) >> puttytel.rsp
89ee5268 142 echo $(TOBJS) >> puttytel.rsp
143 echo $(MOBJS) >> puttytel.rsp
144 echo $(TRESRC) >> puttytel.rsp
145 echo $(LIBS1) >> puttytel.rsp
146 echo $(LIBS2) >> puttytel.rsp
4017be6d 147 echo $(SOCK1) >> puttytel.rsp
89ee5268 148
5c58ad2d 149pageant.rsp: makefile
150 echo /nologo /subsystem:windows > pageant.rsp
151 echo $(PAGE1) >> pageant.rsp
152 echo $(PAGE2) >> pageant.rsp
153 echo $(PAGERC) >> pageant.rsp
154 echo $(LIBS1) >> pageant.rsp
155 echo $(LIBS2) >> pageant.rsp
156 echo $(LIBS3) >> pageant.rsp
157
89ee5268 158pscp.rsp: makefile
159 echo /nologo /subsystem:console > pscp.rsp
160 echo $(SOBJS) >> pscp.rsp
161 echo $(MOBJS) >> pscp.rsp
162 echo $(OBJS1) >> pscp.rsp
163 echo $(OBJS2) >> pscp.rsp
e5574168 164 echo $(OBJS3) >> pscp.rsp
89ee5268 165 echo $(SRESRC) >> pscp.rsp
166 echo $(LIBS1) >> pscp.rsp
167 echo $(LIBS2) >> pscp.rsp
4017be6d 168 echo $(SOCK1) >> pscp.rsp
169
170plink.rsp: makefile
171 echo /nologo /subsystem:console > plink.rsp
172 echo $(LOBJS1) >> plink.rsp
173 echo $(POBJS) >> plink.rsp
174 echo $(PLOBJS) >> plink.rsp
175 echo $(MOBJS) >> plink.rsp
176 echo $(OBJS1) >> plink.rsp
177 echo $(OBJS2) >> plink.rsp
178 echo $(OBJS3) >> plink.rsp
179 echo $(LRESRC) >> plink.rsp
180 echo $(LIBS1) >> plink.rsp
181 echo $(LIBS2) >> plink.rsp
182 echo $(SOCK2) >> plink.rsp
3d541627 183
184##-- dependencies
d5859615 185window.$(OBJ): window.c putty.h win_res.h storage.h
186windlg.$(OBJ): windlg.c putty.h ssh.h win_res.h storage.h
187winstore.$(OBJ): winstore.c putty.h storage.h
3d541627 188terminal.$(OBJ): terminal.c putty.h
189sizetip.$(OBJ): sizetip.c putty.h
190telnet.$(OBJ): telnet.c putty.h
191raw.$(OBJ): raw.c putty.h
192xlat.$(OBJ): xlat.c putty.h
193ldisc.$(OBJ): ldisc.c putty.h
194misc.$(OBJ): misc.c putty.h
d5859615 195noise.$(OBJ): noise.c putty.h ssh.h storage.h
dacbd0e8 196ssh.$(OBJ): ssh.c ssh.h putty.h tree234.h
3d541627 197sshcrc.$(OBJ): sshcrc.c ssh.h
198sshdes.$(OBJ): sshdes.c ssh.h
199sshmd5.$(OBJ): sshmd5.c ssh.h
200sshrsa.$(OBJ): sshrsa.c ssh.h
201sshsha.$(OBJ): sshsha.c ssh.h
202sshrand.$(OBJ): sshrand.c ssh.h
203sshblowf.$(OBJ): sshblowf.c ssh.h
e5574168 204sshdh.$(OBJ): sshdh.c ssh.h
205sshdss.$(OBJ): sshdss.c ssh.h
206sshbn.$(OBJ): sshbn.c ssh.h
7cca0d81 207sshpubk.$(OBJ): sshpubk.c ssh.h
3bdaf79d 208scp.$(OBJ): scp.c putty.h
3d541627 209version.$(OBJ): version.c
89ee5268 210be_all.$(OBJ): be_all.c
211be_nossh.$(OBJ): be_nossh.c
212be_none.$(OBJ): be_none.c
4017be6d 213plink.$(OBJ): plink.c putty.h
5c58ad2d 214pageant.$(OBJ): pageant.c ssh.h tree234.h
215tree234.$(OBJ): tree234.c tree234.h
3d541627 216##--
067a15ea 217
218# Hack to force version.obj to be rebuilt always
3d541627 219version.obj: versionpseudotarget
220 @echo (built version.obj)
067a15ea 221versionpseudotarget:
222 cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
374330e2 223
3d541627 224##-- dependencies
225win_res.$(RES): win_res.rc win_res.h putty.ico
226##--
227win_res.$(RES):
6ed3635b 228 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
374330e2 229
3d541627 230##-- dependencies
0ac99c2f 231nosshres.$(RES): nosshres.rc win_res.rc win_res.h putty.ico
89ee5268 232##--
0ac99c2f 233nosshres.$(RES):
234 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 nosshres.rc
89ee5268 235
236##-- dependencies
3d541627 237scp.$(RES): scp.rc scp.ico
238##--
239scp.$(RES):
6ed3635b 240 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc
4585985c 241
5c58ad2d 242##-- dependencies
243pageant.$(RES): pageant.rc pageant.ico pageants.ico
244##--
245pageant.$(RES):
246 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 pageant.rc
247
374330e2 248clean:
249 del *.obj
250 del *.exe
251 del *.res
252 del *.pch
253 del *.aps
254 del *.ilk
255 del *.pdb
067a15ea 256 del *.rsp
1ee529ed 257 del *.dsp
258 del *.dsw
259 del *.ncb
260 del *.opt
261 del *.plg