-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
164 lines (146 loc) · 4.65 KB
/
Copy pathMakefile
File metadata and controls
164 lines (146 loc) · 4.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Visual C++ Makefile for PuTTY.
#
# Use `nmake' to build.
#
##-- help
#
# Extra options you can set:
#
# - FWHACK=/DFWHACK
# Enables a hack that tunnels through some firewall proxies.
#
# - VER=/DSNAPSHOT=1999-01-25
# Generates executables whose About box report them as being a
# development snapshot.
#
# - VER=/DRELEASE=0.43
# Generates executables whose About box report them as being a
# release version.
#
# - COMPAT=/DAUTO_WINSOCK
# Causes PuTTY to assume that <windows.h> includes its own WinSock
# header file, so that it won't try to include <winsock.h>.
#
# - COMPAT=/DWINSOCK_TWO
# Causes the PuTTY utilities to include <winsock2.h> instead of
# <winsock.h>, except Plink which _needs_ WinSock 2 so it already
# does this.
#
# - RCFL=/DASCIICTLS
# Uses ASCII rather than Unicode to specify the tab control in
# the resource file. Probably most useful when compiling with
# Cygnus/mingw32, whose resource compiler may have less of a
# problem with it.
#
# - XFLAGS=/DMALLOC_LOG
# Causes PuTTY to emit a file called putty_mem.log, logging every
# memory allocation and free, so you can track memory leaks.
#
# - XFLAGS=/DMINEFIELD
# Causes PuTTY to use a custom memory allocator, similar in
# concept to Electric Fence, in place of regular malloc(). Wastes
# huge amounts of RAM, but should cause heap-corruption bugs to
# show up as GPFs at the point of failure rather than appearing
# later on as second-level damage.
#
##--
CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd
# LFLAGS = /debug
# Use MSVC DLL
# CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /MD /Fd
# Disable debug and incremental linking
LFLAGS = /incremental:no
.c.obj:
cl $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) /c $*.c
OBJ=obj
RES=res
##-- objects putty puttytel
GOBJS1 = window.$(OBJ) windlg.$(OBJ) winctrls.$(OBJ) terminal.$(OBJ)
GOBJS2 = xlat.$(OBJ) sizetip.$(OBJ)
##-- objects puttytel
TOBJS = be_nossh.$(OBJ)
##-- resources putty puttytel
PRESRC = win_res.$(RES)
##-- resources pageant
PAGERC = pageant.$(RES)
##-- resources puttygen
GENRC = puttygen.$(RES)
##-- resources pscp
SRESRC = scp.$(RES)
##-- resources plink
LRESRC = plink.$(RES)
##-- objects putty puttytel pscp plink
MOBJS = misc.$(OBJ) version.$(OBJ) winstore.$(OBJ) settings.$(OBJ)
MOBJ2 = tree234.$(OBJ)
##-- gui-apps
# putty
# puttytel
# pageant
# puttygen
##-- console-apps
# pscp
# plink ws2_32
##--
LIBS1 = advapi32.lib user32.lib gdi32.lib
LIBS2 = comctl32.lib comdlg32.lib
LIBS3 = shell32.lib
SOCK1 = wsock32.lib
SOCK2 = ws2_32.lib
all: putty.exe puttytel.exe pscp.exe plink.exe pageant.exe puttygen.exe
puttytel.exe: $(GOBJS1) $(GOBJS2) $(LOBJS1) $(TOBJS) $(MOBJS) $(MOBJ2) $(PRESRC) puttytel.rsp
link $(LFLAGS) -out:puttytel.exe -map:puttytel.map @puttytel.rsp
puttytel.rsp: makefile
echo /nologo /subsystem:windows > puttytel.rsp
echo $(GOBJS1) >> puttytel.rsp
echo $(GOBJS2) >> puttytel.rsp
echo $(LOBJS1) >> puttytel.rsp
echo $(TOBJS) >> puttytel.rsp
echo $(MOBJS) >> puttytel.rsp
echo $(MOBJ2) >> puttytel.rsp
echo $(PRESRC) >> puttytel.rsp
echo $(LIBS1) >> puttytel.rsp
echo $(LIBS2) >> puttytel.rsp
echo $(SOCK2) >> puttytel.rsp
##-- dependencies
window.$(OBJ): window.c putty.h puttymem.h network.h win_res.h storage.h winstuff.h
windlg.$(OBJ): windlg.c putty.h puttymem.h network.h ssh.h win_res.h winstuff.h
winctrls.$(OBJ): winctrls.c winstuff.h winstuff.h
be_nossh.$(OBJ): be_nossh.c
version.$(OBJ): version.c
settings.$(OBJ): settings.c putty.h puttymem.h network.h storage.h
winstore.$(OBJ): winstore.c putty.h puttymem.h network.h storage.h
terminal.$(OBJ): terminal.c putty.h puttymem.h network.h
sizetip.$(OBJ): sizetip.c putty.h puttymem.h network.h winstuff.h
telnet.$(OBJ): telnet.c putty.h puttymem.h network.h
xlat.$(OBJ): xlat.c putty.h puttymem.h network.h
raw.$(OBJ): raw.c putty.h puttymem.h network.h
ldisc.$(OBJ): ldisc.c putty.h puttymem.h network.h
misc.$(OBJ): misc.c putty.h puttymem.h network.h
tree234.$(OBJ): tree234.c tree234.h puttymem.h
##--
# Hack to force version.obj to be rebuilt always
version.obj: versionpseudotarget
@echo (built version.obj)
versionpseudotarget:
cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
##-- dependencies
win_res.$(RES): win_res.rc win_res.h putty.ico
##--
win_res.$(RES):
rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
clean: tidy
del *.exe
tidy:
del *.obj
del *.res
del *.pch
del *.aps
del *.ilk
del *.pdb
del *.rsp
del *.dsp
del *.dsw
del *.ncb
del *.opt
del *.plg
del *.map