1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Added automatic version distinguishing code, to differentiate releases

from nightly builds from random development builds

[originally from svn r28]
This commit is contained in:
Simon Tatham 1999-02-09 15:18:34 +00:00
parent 0fc1c0c9c9
commit 3b1389a474
6 changed files with 56 additions and 18 deletions

View File

@ -1,26 +1,32 @@
# Makefile for PuTTY. Use `FWHACK=/DFWHACK' to cause the firewall hack # Makefile for PuTTY. Use `FWHACK=/DFWHACK' to cause the firewall hack
# to be built in. (requires rebuild of ssh.obj only) # to be built in. (requires rebuild of ssh.obj only)
# Can also build with `VER=/DSNAPSHOT=1999-01-25' or
# `VER=/DRELEASE=0.43' to get version numbering; otherwise you'll
# get `Unidentified build'.
CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd
.c.obj: .c.obj:
cl $(FWHACK) $(CFLAGS) /c $*.c cl $(FWHACK) $(CFLAGS) /c $*.c
OBJS1 = window.obj windlg.obj terminal.obj telnet.obj misc.obj noise.obj PUTTYOBJS = window.obj windlg.obj terminal.obj telnet.obj
OBJS1 = misc.obj noise.obj
OBJS2 = ssh.obj sshcrc.obj sshdes.obj sshmd5.obj sshrsa.obj sshrand.obj OBJS2 = ssh.obj sshcrc.obj sshdes.obj sshmd5.obj sshrsa.obj sshrand.obj
OBJS3 = sshsha.obj OBJS3 = sshsha.obj version.obj
RESRC = win_res.res RESRC = win_res.res
LIBS1 = advapi32.lib user32.lib gdi32.lib LIBS1 = advapi32.lib user32.lib gdi32.lib
LIBS2 = wsock32.lib comctl32.lib comdlg32.lib LIBS2 = ws2_32.lib comctl32.lib comdlg32.lib
putty.exe: $(OBJS1) $(OBJS2) $(OBJS3) $(RESRC) link.rsp putty.exe: $(PUTTYOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(RESRC) link.rsp
link /debug -out:putty.exe @link.rsp link /debug -out:putty.exe @link.rsp
puttyd.exe: $(OBJS1) $(OBJS2) $(OBJS3) $(RESRC) link.rsp puttyd.exe: $(PUTTYOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(RESRC) link.rsp
link /debug -out:puttyd.exe @link.rsp link /debug -out:puttyd.exe @link.rsp
link.rsp: makefile link.rsp: makefile
echo /nologo /subsystem:windows > link.rsp echo /nologo /subsystem:windows > link.rsp
echo $(PUTTYOBJS) >> link.rsp
echo $(OBJS1) >> link.rsp echo $(OBJS1) >> link.rsp
echo $(OBJS2) >> link.rsp echo $(OBJS2) >> link.rsp
echo $(OBJS3) >> link.rsp echo $(OBJS3) >> link.rsp
@ -41,9 +47,14 @@ sshmd5.obj: sshmd5.c ssh.h
sshrsa.obj: sshrsa.c ssh.h sshrsa.obj: sshrsa.c ssh.h
sshsha.obj: sshsha.c ssh.h sshsha.obj: sshsha.c ssh.h
sshrand.obj: sshrand.c ssh.h sshrand.obj: sshrand.c ssh.h
version.obj: versionpseudotarget
# Hack to force version.obj to be rebuilt always
versionpseudotarget:
cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
win_res.res: win_res.rc win_res.h putty.ico win_res.res: win_res.rc win_res.h putty.ico
rc $(FWHACK) -r win_res.rc rc $(FWHACK) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
clean: clean:
del *.obj del *.obj
@ -53,4 +64,4 @@ clean:
del *.aps del *.aps
del *.ilk del *.ilk
del *.pdb del *.pdb
del link.rsp del *.rsp

View File

@ -226,6 +226,11 @@ void *safemalloc(size_t);
void *saferealloc(void *, size_t); void *saferealloc(void *, size_t);
void safefree(void *); void safefree(void *);
/*
* Exports from version.c.
*/
extern char ver[];
/* /*
* A debug system. * A debug system.
*/ */

20
version.c Normal file
View File

@ -0,0 +1,20 @@
/*
* PuTTY version numbering
*/
#define STR1(x) #x
#define STR(x) STR1(x)
#if defined SNAPSHOT
char ver[] = "Development snapshot " STR(SNAPSHOT);
#elif defined RELEASE
char ver[] = "Release " STR(RELEASE);
#else
char ver[] = "Unidentified build, " __DATE__ " " __TIME__;
#endif

View File

@ -19,8 +19,10 @@
#define IDN_LIST 1001 #define IDN_LIST 1001
#define IDA_ICON 1001 #define IDA_ICON 1001
#define IDA_TEXT 1002 #define IDA_TEXT1 1002
#define IDA_LICENCE 1003 #define IDA_VERSION 1003
#define IDA_TEXT2 1004
#define IDA_LICENCE 1005
#define IDC_TAB 1001 #define IDC_TAB 1001
#define IDC_ABOUT 1002 #define IDC_ABOUT 1002

View File

@ -4,18 +4,17 @@
#include "win_res.h" #include "win_res.h"
IDI_MAINICON ICON "putty.ico" IDD_ABOUTBOX DIALOG DISCARDABLE 140, 40, 136, 70
IDD_ABOUTBOX DIALOG DISCARDABLE 140, 40, 136, 58
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About PuTTY" CAPTION "About PuTTY"
FONT 8, "MS Sans Serif" FONT 8, "MS Sans Serif"
BEGIN BEGIN
DEFPUSHBUTTON "&Close", IDOK, 82, 40, 48, 14 DEFPUSHBUTTON "&Close", IDOK, 82, 52, 48, 14
PUSHBUTTON "View &Licence", IDA_LICENCE, 6, 40, 70, 14 PUSHBUTTON "View &Licence", IDA_LICENCE, 6, 52, 70, 14
ICON IDI_MAINICON, IDA_ICON, 10, 10, 0, 0 CTEXT "PuTTY", IDA_TEXT1, 10, 6, 120, 8
LTEXT "PuTTY Beta 0.45\n\251 1997-8 Simon Tatham\nAll rights reserved.", CTEXT "", IDA_VERSION, 10, 16, 120, 16
IDA_TEXT, 40, 6, 96, 24 CTEXT "\251 1997-9 Simon Tatham. All rights reserved.",
IDA_TEXT2, 10, 34, 120, 16
END END
IDD_MAINBOX DIALOG DISCARDABLE 0, 0, 180, 216 IDD_MAINBOX DIALOG DISCARDABLE 0, 0, 180, 216
@ -210,7 +209,7 @@ FONT 8, "MS Sans Serif"
BEGIN BEGIN
DEFPUSHBUTTON "OK", IDOK, 98, 211, 44, 14 DEFPUSHBUTTON "OK", IDOK, 98, 211, 44, 14
LTEXT "Copyright \251 1998 Simon Tatham", 1000, 10, 10, 206, 8 LTEXT "Copyright \251 1997-9 Simon Tatham", 1000, 10, 10, 206, 8
LTEXT "Portions copyright Gary S. Brown and Eric Young", 1100, 10, 18, 206, 8 LTEXT "Portions copyright Gary S. Brown and Eric Young", 1100, 10, 18, 206, 8
LTEXT "Permission is hereby granted, free of charge, to any person", 1002, 10, 34, 206, 8 LTEXT "Permission is hereby granted, free of charge, to any person", 1002, 10, 34, 206, 8

View File

@ -367,6 +367,7 @@ static int CALLBACK AboutProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) { WPARAM wParam, LPARAM lParam) {
switch (msg) { switch (msg) {
case WM_INITDIALOG: case WM_INITDIALOG:
SetDlgItemText (hwnd, IDA_VERSION, ver);
return 1; return 1;
/* case WM_CTLCOLORDLG: */ /* case WM_CTLCOLORDLG: */
/* return (int) GetStockObject (LTGRAY_BRUSH); */ /* return (int) GetStockObject (LTGRAY_BRUSH); */