c141399b4455f39fbd41bd84375c4b1a2428f2ba
[u/mdw/putty] / Makefile
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
32 CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd
33
34 .c.obj:
35 cl $(COMPAT) $(FWHACK) $(CFLAGS) /c $*.c
36
37 OBJ=obj
38 RES=res
39
40 ##-- objects putty
41 POBJS1 = window.$(OBJ) windlg.$(OBJ) terminal.$(OBJ) telnet.$(OBJ) raw.$(OBJ)
42 POBJS2 = xlat.$(OBJ) ldisc.$(OBJ) sizetip.$(OBJ) ssh.$(OBJ)
43 ##-- objects pscp
44 SOBJS = scp.$(OBJ) windlg.$(OBJ) scpssh.$(OBJ)
45 ##-- objects putty pscp
46 OBJS1 = misc.$(OBJ) noise.$(OBJ)
47 OBJS2 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ)
48 OBJS3 = sshsha.$(OBJ) sshblowf.$(OBJ) version.$(OBJ)
49 ##-- resources putty
50 PRESRC = win_res.$(RES)
51 ##-- resources pscp
52 SRESRC = scp.$(RES)
53 ##--
54
55 ##-- gui-apps
56 # putty
57 ##-- console-apps
58 # pscp
59 ##--
60
61 LIBS1 = advapi32.lib user32.lib gdi32.lib
62 LIBS2 = wsock32.lib comctl32.lib comdlg32.lib
63
64 all: putty.exe pscp.exe
65
66 putty.exe: $(POBJS1) $(POBJS2) $(OBJS1) $(OBJS2) $(OBJS3) $(PRESRC) link.rsp
67 link /debug -out:putty.exe @link.rsp
68
69 pscp.exe: $(SOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(SRESRC) scp.rsp
70 link /debug -out:pscp.exe @scp.rsp
71
72 link.rsp: makefile
73 echo /nologo /subsystem:windows > link.rsp
74 echo $(POBJS1) >> link.rsp
75 echo $(POBJS2) >> link.rsp
76 echo $(OBJS1) >> link.rsp
77 echo $(OBJS2) >> link.rsp
78 echo $(OBJS3) >> link.rsp
79 echo $(PRESRC) >> link.rsp
80 echo $(LIBS1) >> link.rsp
81 echo $(LIBS2) >> link.rsp
82
83 scp.rsp: makefile
84 echo /nologo /subsystem:console > scp.rsp
85 echo $(SOBJS) >> scp.rsp
86 echo $(OBJS1) >> scp.rsp
87 echo $(OBJS2) >> scp.rsp
88 echo $(OBJS3) >> scp.rsp
89 echo $(SRESRC) >> scp.rsp
90 echo $(LIBS1) >> scp.rsp
91 echo $(LIBS2) >> scp.rsp
92
93 ##-- dependencies
94 window.$(OBJ): window.c putty.h win_res.h
95 windlg.$(OBJ): windlg.c putty.h ssh.h win_res.h
96 terminal.$(OBJ): terminal.c putty.h
97 sizetip.$(OBJ): sizetip.c putty.h
98 telnet.$(OBJ): telnet.c putty.h
99 raw.$(OBJ): raw.c putty.h
100 xlat.$(OBJ): xlat.c putty.h
101 ldisc.$(OBJ): ldisc.c putty.h
102 misc.$(OBJ): misc.c putty.h
103 noise.$(OBJ): noise.c putty.h ssh.h
104 ssh.$(OBJ): ssh.c ssh.h putty.h
105 sshcrc.$(OBJ): sshcrc.c ssh.h
106 sshdes.$(OBJ): sshdes.c ssh.h
107 sshmd5.$(OBJ): sshmd5.c ssh.h
108 sshrsa.$(OBJ): sshrsa.c ssh.h
109 sshsha.$(OBJ): sshsha.c ssh.h
110 sshrand.$(OBJ): sshrand.c ssh.h
111 sshblowf.$(OBJ): sshblowf.c ssh.h
112 scp.$(OBJ): scp.c putty.h scp.h
113 scpssh.$(OBJ): scpssh.c putty.h ssh.h scp.h
114 version.$(OBJ): version.c
115 ##--
116
117 # Hack to force version.obj to be rebuilt always
118 version.obj: versionpseudotarget
119 @echo (built version.obj)
120 versionpseudotarget:
121 cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
122
123 ##-- dependencies
124 win_res.$(RES): win_res.rc win_res.h putty.ico
125 ##--
126 win_res.$(RES):
127 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
128
129 ##-- dependencies
130 scp.$(RES): scp.rc scp.ico
131 ##--
132 scp.$(RES):
133 rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc
134
135 clean:
136 del *.obj
137 del *.exe
138 del *.res
139 del *.pch
140 del *.aps
141 del *.ilk
142 del *.pdb
143 del *.rsp