1 # Visual C++ Makefile for PuTTY.
3 # Use `nmake' to build.
8 # Extra options you can set:
11 # Enables a hack that tunnels through some firewall proxies.
13 # - VER=/DSNAPSHOT=1999-01-25
14 # Generates executables whose About box report them as being a
15 # development snapshot.
17 # - VER=/DRELEASE=0.43
18 # Generates executables whose About box report them as being a
21 # - COMPAT=/DWIN32S_COMPAT
22 # Generates a binary that works (minimally) with Win32s.
26 CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd
29 cl $(COMPAT) $(FWHACK) $(CFLAGS) /c $*.c
35 POBJS1 = window.$(OBJ) windlg.$(OBJ) terminal.$(OBJ) telnet.$(OBJ) raw.$(OBJ)
36 POBJS2 = xlat.$(OBJ) ldisc.$(OBJ) sizetip.$(OBJ) ssh.$(OBJ)
38 SOBJS = scp.$(OBJ) windlg.$(OBJ) scpssh.$(OBJ)
39 ##-- objects putty pscp
40 OBJS1 = misc.$(OBJ) noise.$(OBJ)
41 OBJS2 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ)
42 OBJS3 = sshsha.$(OBJ) sshblowf.$(OBJ) version.$(OBJ)
44 PRESRC = win_res.$(RES)
55 LIBS1 = advapi32.lib user32.lib gdi32.lib
56 LIBS2 = wsock32.lib comctl32.lib comdlg32.lib
58 all: putty.exe pscp.exe
60 putty.exe: $(POBJS1) $(POBJS2) $(OBJS1) $(OBJS2) $(OBJS3) $(PRESRC) link.rsp
61 link /debug -out:putty.exe @link.rsp
63 pscp.exe: $(SOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(SRESRC) scp.rsp
64 link /debug -out:pscp.exe @scp.rsp
67 echo /nologo /subsystem:windows > link.rsp
68 echo $(POBJS1) >> link.rsp
69 echo $(POBJS2) >> link.rsp
70 echo $(OBJS1) >> link.rsp
71 echo $(OBJS2) >> link.rsp
72 echo $(OBJS3) >> link.rsp
73 echo $(PRESRC) >> link.rsp
74 echo $(LIBS1) >> link.rsp
75 echo $(LIBS2) >> link.rsp
78 echo /nologo /subsystem:console > scp.rsp
79 echo $(SOBJS) >> scp.rsp
80 echo $(OBJS1) >> scp.rsp
81 echo $(OBJS2) >> scp.rsp
82 echo $(OBJS3) >> scp.rsp
83 echo $(SRESRC) >> scp.rsp
84 echo $(LIBS1) >> scp.rsp
85 echo $(LIBS2) >> scp.rsp
88 window.$(OBJ): window.c putty.h win_res.h
89 windlg.$(OBJ): windlg.c putty.h ssh.h win_res.h
90 terminal.$(OBJ): terminal.c putty.h
91 sizetip.$(OBJ): sizetip.c putty.h
92 telnet.$(OBJ): telnet.c putty.h
93 raw.$(OBJ): raw.c putty.h
94 xlat.$(OBJ): xlat.c putty.h
95 ldisc.$(OBJ): ldisc.c putty.h
96 misc.$(OBJ): misc.c putty.h
97 noise.$(OBJ): noise.c putty.h ssh.h
98 ssh.$(OBJ): ssh.c ssh.h putty.h
99 sshcrc.$(OBJ): sshcrc.c ssh.h
100 sshdes.$(OBJ): sshdes.c ssh.h
101 sshmd5.$(OBJ): sshmd5.c ssh.h
102 sshrsa.$(OBJ): sshrsa.c ssh.h
103 sshsha.$(OBJ): sshsha.c ssh.h
104 sshrand.$(OBJ): sshrand.c ssh.h
105 sshblowf.$(OBJ): sshblowf.c ssh.h
106 scp.$(OBJ): scp.c putty.h scp.h
107 scpssh.$(OBJ): scpssh.c putty.h ssh.h scp.h
108 version.$(OBJ): version.c
111 # Hack to force version.obj to be rebuilt always
112 version.obj: versionpseudotarget
113 @echo (built version.obj)
115 cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
118 win_res.$(RES): win_res.rc win_res.h putty.ico
121 rc $(FWHACK) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
124 scp.$(RES): scp.rc scp.ico
127 rc $(FWHACK) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc