Robert de Bath's Big Patch, part 1
[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=/DWIN32S_COMPAT
22# Generates a binary that works (minimally) with Win32s.
23#
24# - RCFL=/DASCIICTLS
25# Uses ASCII rather than Unicode to specify the tab control in
26# the resource file. Probably most useful when compiling with
27# Cygnus/mingw32, whose resource compiler may have less of a
28# problem with it.
29#
30##--
31
32CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd
33# LFLAGS = /debug
34
35# Use MSVC DLL
36# CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /MD /Fd
37
38# Disable debug and incremental linking
39LFLAGS = /incremental:no
40
41.c.obj:
42 cl $(COMPAT) $(FWHACK) $(CFLAGS) /c $*.c
43
44OBJ=obj
45RES=res
46
47##-- objects putty puttytel
48GOBJS1 = window.$(OBJ) windlg.$(OBJ) terminal.$(OBJ) telnet.$(OBJ) raw.$(OBJ)
49GOBJS2 = xlat.$(OBJ) ldisc.$(OBJ) sizetip.$(OBJ)
50##-- objects putty
51POBJS = ssh.$(OBJ) be_all.$(OBJ)
52##-- objects puttytel
53TOBJS = be_nossh.$(OBJ)
54##-- objects pscp
55SOBJS = scp.$(OBJ) windlg.$(OBJ) ssh.$(OBJ) be_none.$(OBJ)
56##-- objects putty puttytel pscp
57MOBJS = misc.$(OBJ) version.$(OBJ)
58##-- objects putty pscp
59OBJS1 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ)
60OBJS2 = sshsha.$(OBJ) sshblowf.$(OBJ) noise.$(OBJ)
61##-- resources putty
62PRESRC = win_res.$(RES)
63##-- resources puttytel
64TRESRC = nosshres.$(RES)
65##-- resources pscp
66SRESRC = scp.$(RES)
67##--
68
69##-- gui-apps
70# putty
71# puttytel
72##-- console-apps
73# pscp
74##--
75
76LIBS1 = advapi32.lib user32.lib gdi32.lib
77LIBS2 = wsock32.lib comctl32.lib comdlg32.lib
78
79all: putty.exe puttytel.exe pscp.exe
80
81putty.exe: $(GOBJS1) $(GOBJS2) $(POBJS) $(MOBJS) $(OBJS1) $(OBJS2) $(PRESRC) putty.rsp
82 link $(LFLAGS) -out:putty.exe @putty.rsp
83
84puttytel.exe: $(GOBJS1) $(GOBJS2) $(TOBJS) $(MOBJS) $(TRESRC) puttytel.rsp
85 link $(LFLAGS) -out:puttytel.exe @puttytel.rsp
86
87pscp.exe: $(SOBJS) $(MOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(SRESRC) pscp.rsp
88 link $(LFLAGS) -out:pscp.exe @pscp.rsp
89
90putty.rsp: makefile
91 echo /nologo /subsystem:windows > putty.rsp
92 echo $(GOBJS1) >> putty.rsp
93 echo $(GOBJS2) >> putty.rsp
94 echo $(POBJS) >> putty.rsp
95 echo $(MOBJS) >> putty.rsp
96 echo $(OBJS1) >> putty.rsp
97 echo $(OBJS2) >> putty.rsp
98 echo $(PRESRC) >> putty.rsp
99 echo $(LIBS1) >> putty.rsp
100 echo $(LIBS2) >> putty.rsp
101
102puttytel.rsp: makefile
103 echo /nologo /subsystem:windows > puttytel.rsp
104 echo $(GOBJS1) >> puttytel.rsp
105 echo $(GOBJS2) >> puttytel.rsp
106 echo $(TOBJS) >> puttytel.rsp
107 echo $(MOBJS) >> puttytel.rsp
108 echo $(TRESRC) >> puttytel.rsp
109 echo $(LIBS1) >> puttytel.rsp
110 echo $(LIBS2) >> puttytel.rsp
111
112pscp.rsp: makefile
113 echo /nologo /subsystem:console > pscp.rsp
114 echo $(SOBJS) >> pscp.rsp
115 echo $(MOBJS) >> pscp.rsp
116 echo $(OBJS1) >> pscp.rsp
117 echo $(OBJS2) >> pscp.rsp
118 echo $(SRESRC) >> pscp.rsp
119 echo $(LIBS1) >> pscp.rsp
120 echo $(LIBS2) >> pscp.rsp
121
122##-- dependencies
123window.$(OBJ): window.c putty.h win_res.h
124windlg.$(OBJ): windlg.c putty.h ssh.h win_res.h
125terminal.$(OBJ): terminal.c putty.h
126sizetip.$(OBJ): sizetip.c putty.h
127telnet.$(OBJ): telnet.c putty.h
128raw.$(OBJ): raw.c putty.h
129xlat.$(OBJ): xlat.c putty.h
130ldisc.$(OBJ): ldisc.c putty.h
131misc.$(OBJ): misc.c putty.h
132noise.$(OBJ): noise.c putty.h ssh.h
133ssh.$(OBJ): ssh.c ssh.h putty.h
134sshcrc.$(OBJ): sshcrc.c ssh.h
135sshdes.$(OBJ): sshdes.c ssh.h
136sshmd5.$(OBJ): sshmd5.c ssh.h
137sshrsa.$(OBJ): sshrsa.c ssh.h
138sshsha.$(OBJ): sshsha.c ssh.h
139sshrand.$(OBJ): sshrand.c ssh.h
140sshblowf.$(OBJ): sshblowf.c ssh.h
141scp.$(OBJ): scp.c putty.h scp.h
142version.$(OBJ): version.c
143be_all.$(OBJ): be_all.c
144be_nossh.$(OBJ): be_nossh.c
145be_none.$(OBJ): be_none.c
146##--
147
148# Hack to force version.obj to be rebuilt always
149version.obj: versionpseudotarget
150 @echo (built version.obj)
151versionpseudotarget:
152 cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
153
154##-- dependencies
155win_res.$(RES): win_res.rc win_res.h putty.ico
156##--
157win_res.$(RES):
158 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
159
160##-- dependencies
161nosshres.$(RES): nosshres.rc win_res.rc win_res.h putty.ico
162##--
163nosshres.$(RES):
164 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 nosshres.rc
165
166##-- dependencies
167scp.$(RES): scp.rc scp.ico
168##--
169scp.$(RES):
170 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc
171
172clean:
173 del *.obj
174 del *.exe
175 del *.res
176 del *.pch
177 del *.aps
178 del *.ilk
179 del *.pdb
180 del *.rsp