Create settings.c and move the load/save session code out of
[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#
6ed3635b 30# - RCFL=/DASCIICTLS
760858ff 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#
3d541627 36##--
676c0556 37
5f48a59c 38CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd
373e94e9 39# LFLAGS = /debug
40
41# Use MSVC DLL
c9def1b8 42# CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /MD /Fd
373e94e9 43
44# Disable debug and incremental linking
45LFLAGS = /incremental:no
374330e2 46
47.c.obj:
676c0556 48 cl $(COMPAT) $(FWHACK) $(CFLAGS) /c $*.c
374330e2 49
3d541627 50OBJ=obj
51RES=res
52
89ee5268 53##-- objects putty puttytel
4017be6d 54GOBJS1 = window.$(OBJ) windlg.$(OBJ) terminal.$(OBJ)
55GOBJS2 = xlat.$(OBJ) sizetip.$(OBJ)
56##-- objects putty puttytel plink
57LOBJS1 = telnet.$(OBJ) raw.$(OBJ) ldisc.$(OBJ)
58##-- objects putty plink
5c58ad2d 59POBJS = be_all.$(OBJ)
89ee5268 60##-- objects puttytel
61TOBJS = be_nossh.$(OBJ)
4017be6d 62##-- objects plink
a9422f39 63PLOBJS = plink.$(OBJ)
3d541627 64##-- objects pscp
a9422f39 65SOBJS = scp.$(OBJ) be_none.$(OBJ)
4017be6d 66##-- objects putty puttytel pscp plink
a9422f39 67MOBJS = misc.$(OBJ) version.$(OBJ) winstore.$(OBJ) settings.$(OBJ)
4017be6d 68##-- objects putty pscp plink
89ee5268 69OBJS1 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ)
e5574168 70OBJS2 = sshsha.$(OBJ) sshblowf.$(OBJ) noise.$(OBJ) sshdh.$(OBJ) sshdss.$(OBJ)
dacbd0e8 71OBJS3 = sshbn.$(OBJ) sshpubk.$(OBJ) ssh.$(OBJ) pageantc.$(OBJ) tree234.$(OBJ)
5c58ad2d 72##-- objects pageant
73PAGE1 = pageant.$(OBJ) sshrsa.$(OBJ) sshpubk.$(OBJ) sshdes.$(OBJ) sshbn.$(OBJ)
74PAGE2 = sshmd5.$(OBJ) version.$(OBJ) tree234.$(OBJ)
9d01fc92 75##-- resources putty puttytel
3d541627 76PRESRC = win_res.$(RES)
5c58ad2d 77##-- resources pageant
78PAGERC = pageant.$(RES)
3d541627 79##-- resources pscp
80SRESRC = scp.$(RES)
4017be6d 81##-- resources plink
82LRESRC = plink.$(RES)
3d541627 83##--
84
85##-- gui-apps
86# putty
89ee5268 87# puttytel
5c58ad2d 88# pageant
3d541627 89##-- console-apps
90# pscp
5c58ad2d 91# plink
3d541627 92##--
93
374330e2 94LIBS1 = advapi32.lib user32.lib gdi32.lib
4017be6d 95LIBS2 = comctl32.lib comdlg32.lib
5c58ad2d 96LIBS3 = shell32.lib
4017be6d 97SOCK1 = wsock32.lib
98SOCK2 = ws2_32.lib
4585985c 99
5c58ad2d 100all: putty.exe puttytel.exe pscp.exe plink.exe pageant.exe
89ee5268 101
4017be6d 102putty.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(POBJS) $(MOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(PRESRC) putty.rsp
373e94e9 103 link $(LFLAGS) -out:putty.exe @putty.rsp
89ee5268 104
9d01fc92 105puttytel.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(TOBJS) $(MOBJS) $(PRESRC) puttytel.rsp
373e94e9 106 link $(LFLAGS) -out:puttytel.exe @puttytel.rsp
89ee5268 107
5c58ad2d 108pageant.exe: $(PAGE1) $(PAGE2) $(PAGERC) pageant.rsp
109 link $(LFLAGS) -out:pageant.exe @pageant.rsp
110
0ac99c2f 111pscp.exe: $(SOBJS) $(MOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(SRESRC) pscp.rsp
373e94e9 112 link $(LFLAGS) -out:pscp.exe @pscp.rsp
89ee5268 113
4017be6d 114plink.exe: $(LOBJS1) $(POBJS) $(PLOBJS) $(MOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(LRESRC) plink.rsp
115 link $(LFLAGS) -out:plink.exe @plink.rsp
116
89ee5268 117putty.rsp: makefile
118 echo /nologo /subsystem:windows > putty.rsp
119 echo $(GOBJS1) >> putty.rsp
120 echo $(GOBJS2) >> putty.rsp
4017be6d 121 echo $(LOBJS1) >> putty.rsp
89ee5268 122 echo $(POBJS) >> putty.rsp
123 echo $(MOBJS) >> putty.rsp
124 echo $(OBJS1) >> putty.rsp
125 echo $(OBJS2) >> putty.rsp
e5574168 126 echo $(OBJS3) >> putty.rsp
89ee5268 127 echo $(PRESRC) >> putty.rsp
128 echo $(LIBS1) >> putty.rsp
129 echo $(LIBS2) >> putty.rsp
4017be6d 130 echo $(SOCK1) >> putty.rsp
89ee5268 131
132puttytel.rsp: makefile
133 echo /nologo /subsystem:windows > puttytel.rsp
134 echo $(GOBJS1) >> puttytel.rsp
135 echo $(GOBJS2) >> puttytel.rsp
4017be6d 136 echo $(LOBJS1) >> puttytel.rsp
89ee5268 137 echo $(TOBJS) >> puttytel.rsp
138 echo $(MOBJS) >> puttytel.rsp
9d01fc92 139 echo $(PRESRC) >> puttytel.rsp
89ee5268 140 echo $(LIBS1) >> puttytel.rsp
141 echo $(LIBS2) >> puttytel.rsp
4017be6d 142 echo $(SOCK1) >> puttytel.rsp
89ee5268 143
5c58ad2d 144pageant.rsp: makefile
145 echo /nologo /subsystem:windows > pageant.rsp
146 echo $(PAGE1) >> pageant.rsp
147 echo $(PAGE2) >> pageant.rsp
148 echo $(PAGERC) >> pageant.rsp
149 echo $(LIBS1) >> pageant.rsp
150 echo $(LIBS2) >> pageant.rsp
151 echo $(LIBS3) >> pageant.rsp
152
89ee5268 153pscp.rsp: makefile
154 echo /nologo /subsystem:console > pscp.rsp
155 echo $(SOBJS) >> pscp.rsp
156 echo $(MOBJS) >> pscp.rsp
157 echo $(OBJS1) >> pscp.rsp
158 echo $(OBJS2) >> pscp.rsp
e5574168 159 echo $(OBJS3) >> pscp.rsp
89ee5268 160 echo $(SRESRC) >> pscp.rsp
161 echo $(LIBS1) >> pscp.rsp
162 echo $(LIBS2) >> pscp.rsp
4017be6d 163 echo $(SOCK1) >> pscp.rsp
164
165plink.rsp: makefile
166 echo /nologo /subsystem:console > plink.rsp
167 echo $(LOBJS1) >> plink.rsp
168 echo $(POBJS) >> plink.rsp
169 echo $(PLOBJS) >> plink.rsp
170 echo $(MOBJS) >> plink.rsp
171 echo $(OBJS1) >> plink.rsp
172 echo $(OBJS2) >> plink.rsp
173 echo $(OBJS3) >> plink.rsp
174 echo $(LRESRC) >> plink.rsp
175 echo $(LIBS1) >> plink.rsp
176 echo $(LIBS2) >> plink.rsp
177 echo $(SOCK2) >> plink.rsp
3d541627 178
179##-- dependencies
d5859615 180window.$(OBJ): window.c putty.h win_res.h storage.h
a9422f39 181windlg.$(OBJ): windlg.c putty.h ssh.h win_res.h
182settings.$(OBJ): settings.c putty.h storage.h
d5859615 183winstore.$(OBJ): winstore.c putty.h storage.h
3d541627 184terminal.$(OBJ): terminal.c putty.h
185sizetip.$(OBJ): sizetip.c putty.h
186telnet.$(OBJ): telnet.c putty.h
187raw.$(OBJ): raw.c putty.h
188xlat.$(OBJ): xlat.c putty.h
189ldisc.$(OBJ): ldisc.c putty.h
190misc.$(OBJ): misc.c putty.h
d5859615 191noise.$(OBJ): noise.c putty.h ssh.h storage.h
dacbd0e8 192ssh.$(OBJ): ssh.c ssh.h putty.h tree234.h
3d541627 193sshcrc.$(OBJ): sshcrc.c ssh.h
194sshdes.$(OBJ): sshdes.c ssh.h
195sshmd5.$(OBJ): sshmd5.c ssh.h
196sshrsa.$(OBJ): sshrsa.c ssh.h
197sshsha.$(OBJ): sshsha.c ssh.h
198sshrand.$(OBJ): sshrand.c ssh.h
199sshblowf.$(OBJ): sshblowf.c ssh.h
e5574168 200sshdh.$(OBJ): sshdh.c ssh.h
201sshdss.$(OBJ): sshdss.c ssh.h
202sshbn.$(OBJ): sshbn.c ssh.h
7cca0d81 203sshpubk.$(OBJ): sshpubk.c ssh.h
3bdaf79d 204scp.$(OBJ): scp.c putty.h
3d541627 205version.$(OBJ): version.c
89ee5268 206be_all.$(OBJ): be_all.c
207be_nossh.$(OBJ): be_nossh.c
208be_none.$(OBJ): be_none.c
4017be6d 209plink.$(OBJ): plink.c putty.h
5c58ad2d 210pageant.$(OBJ): pageant.c ssh.h tree234.h
211tree234.$(OBJ): tree234.c tree234.h
3d541627 212##--
067a15ea 213
214# Hack to force version.obj to be rebuilt always
3d541627 215version.obj: versionpseudotarget
216 @echo (built version.obj)
067a15ea 217versionpseudotarget:
218 cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
374330e2 219
3d541627 220##-- dependencies
221win_res.$(RES): win_res.rc win_res.h putty.ico
222##--
223win_res.$(RES):
6ed3635b 224 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
374330e2 225
3d541627 226##-- dependencies
227scp.$(RES): scp.rc scp.ico
228##--
229scp.$(RES):
6ed3635b 230 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc
4585985c 231
5c58ad2d 232##-- dependencies
233pageant.$(RES): pageant.rc pageant.ico pageants.ico
234##--
235pageant.$(RES):
236 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 pageant.rc
237
374330e2 238clean:
239 del *.obj
240 del *.exe
241 del *.res
242 del *.pch
243 del *.aps
244 del *.ilk
245 del *.pdb
067a15ea 246 del *.rsp
1ee529ed 247 del *.dsp
248 del *.dsw
249 del *.ncb
250 del *.opt
251 del *.plg