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