Added automatic version distinguishing code, to differentiate releases
[u/mdw/putty] / Makefile
CommitLineData
374330e2 1# Makefile for PuTTY. Use `FWHACK=/DFWHACK' to cause the firewall hack
2# to be built in. (requires rebuild of ssh.obj only)
3
067a15ea 4# Can also build with `VER=/DSNAPSHOT=1999-01-25' or
5# `VER=/DRELEASE=0.43' to get version numbering; otherwise you'll
6# get `Unidentified build'.
7
5f48a59c 8CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd
374330e2 9
10.c.obj:
11 cl $(FWHACK) $(CFLAGS) /c $*.c
12
067a15ea 13PUTTYOBJS = window.obj windlg.obj terminal.obj telnet.obj
14OBJS1 = misc.obj noise.obj
374330e2 15OBJS2 = ssh.obj sshcrc.obj sshdes.obj sshmd5.obj sshrsa.obj sshrand.obj
067a15ea 16OBJS3 = sshsha.obj version.obj
374330e2 17RESRC = win_res.res
18LIBS1 = advapi32.lib user32.lib gdi32.lib
067a15ea 19LIBS2 = ws2_32.lib comctl32.lib comdlg32.lib
374330e2 20
067a15ea 21putty.exe: $(PUTTYOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(RESRC) link.rsp
374330e2 22 link /debug -out:putty.exe @link.rsp
23
067a15ea 24puttyd.exe: $(PUTTYOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(RESRC) link.rsp
374330e2 25 link /debug -out:puttyd.exe @link.rsp
26
27link.rsp: makefile
28 echo /nologo /subsystem:windows > link.rsp
067a15ea 29 echo $(PUTTYOBJS) >> link.rsp
374330e2 30 echo $(OBJS1) >> link.rsp
31 echo $(OBJS2) >> link.rsp
32 echo $(OBJS3) >> link.rsp
33 echo $(RESRC) >> link.rsp
34 echo $(LIBS1) >> link.rsp
35 echo $(LIBS2) >> link.rsp
36
37window.obj: window.c putty.h win_res.h
38windlg.obj: windlg.c putty.h ssh.h win_res.h
39terminal.obj: terminal.c putty.h
40telnet.obj: telnet.c putty.h
41misc.obj: misc.c putty.h
42noise.obj: noise.c putty.h ssh.h
43ssh.obj: ssh.c ssh.h putty.h
44sshcrc.obj: sshcrc.c ssh.h
45sshdes.obj: sshdes.c ssh.h
46sshmd5.obj: sshmd5.c ssh.h
47sshrsa.obj: sshrsa.c ssh.h
48sshsha.obj: sshsha.c ssh.h
49sshrand.obj: sshrand.c ssh.h
067a15ea 50version.obj: versionpseudotarget
51
52# Hack to force version.obj to be rebuilt always
53versionpseudotarget:
54 cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
374330e2 55
56win_res.res: win_res.rc win_res.h putty.ico
067a15ea 57 rc $(FWHACK) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
374330e2 58
59clean:
60 del *.obj
61 del *.exe
62 del *.res
63 del *.pch
64 del *.aps
65 del *.ilk
66 del *.pdb
067a15ea 67 del *.rsp