mirror of
https://github.com/cc65/cc65.git
synced 2024-11-12 22:07:16 +00:00
Move the version numbers from the interface of the version module into a new
implementation. Allow for release candidates to be specified and disinguished. git-svn-id: svn://svn.cc65.org/cc65/trunk@4260 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
3c6e8087f1
commit
7b847321a8
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2003 Ullrich von Bassewitz */
|
||||
/* Römerstraße 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 1998-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -121,8 +121,8 @@ int main (int argc, char* argv [])
|
||||
|
||||
case 'V':
|
||||
fprintf (stderr,
|
||||
"ar65 V%u.%u.%u - (C) Copyright 1998-2003 Ullrich von Bassewitz\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
"ar65 V%s - (C) Copyright 1998-2009 Ullrich von Bassewitz\n",
|
||||
GetVersionAsString ());
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2008 Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 1998-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -945,7 +945,7 @@ static ExprNode* Factor (void)
|
||||
break;
|
||||
|
||||
case TOK_VERSION:
|
||||
N = GenLiteralExpr (VERSION);
|
||||
N = GenLiteralExpr (GetVersionAsNumber ());
|
||||
NextTok ();
|
||||
break;
|
||||
|
||||
|
@ -224,12 +224,11 @@ static void PrintPageHeader (FILE* F, const ListLine* L)
|
||||
|
||||
/* Print the header on the new page */
|
||||
fprintf (F,
|
||||
"ca65 V%u.%u.%u - %s\n"
|
||||
"ca65 V%s - %s\n"
|
||||
"Main file : %s\n"
|
||||
"Current file: %.*s\n"
|
||||
"\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH,
|
||||
Copyright,
|
||||
GetVersionAsString (), Copyright,
|
||||
InFile,
|
||||
(int) SB_GetLen (CurFile), SB_GetConstBuf (CurFile));
|
||||
|
||||
|
@ -132,7 +132,7 @@ static void SetOptions (void)
|
||||
StrBuf Buf = STATIC_STRBUF_INITIALIZER;
|
||||
|
||||
/* Set the translator */
|
||||
SB_Printf (&Buf, "ca65 V%u.%u.%u", VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
SB_Printf (&Buf, "ca65 V%s", GetVersionAsString ());
|
||||
OptTranslator (&Buf);
|
||||
|
||||
/* Set date and time */
|
||||
@ -521,9 +521,7 @@ static void OptVersion (const char* Opt attribute ((unused)),
|
||||
const char* Arg attribute ((unused)))
|
||||
/* Print the assembler version */
|
||||
{
|
||||
fprintf (stderr,
|
||||
"ca65 V%u.%u.%u - %s\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH, Copyright);
|
||||
fprintf (stderr, "ca65 V%s - %s\n", GetVersionAsString (), Copyright);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2009 Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 1998-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -151,13 +151,12 @@ void g_preamble (void)
|
||||
|
||||
/* Identify the compiler version */
|
||||
AddTextLine (";");
|
||||
AddTextLine ("; File generated by cc65 v %u.%u.%u",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
AddTextLine ("; File generated by cc65 v %s", GetVersionAsString ());
|
||||
AddTextLine (";");
|
||||
|
||||
/* Insert some object file options */
|
||||
AddTextLine ("\t.fopt\t\tcompiler,\"cc65 v %u.%u.%u\"",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
AddTextLine ("\t.fopt\t\tcompiler,\"cc65 v %s\"",
|
||||
GetVersionAsString ());
|
||||
|
||||
/* If we're producing code for some other CPU, switch the command set */
|
||||
switch (CPU) {
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2000-2009 Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 2000-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -300,7 +300,7 @@ void Compile (const char* FileName)
|
||||
};
|
||||
|
||||
/* Add macros that are always defined */
|
||||
DefineNumericMacro ("__CC65__", VERSION);
|
||||
DefineNumericMacro ("__CC65__", GetVersionAsNumber ());
|
||||
|
||||
/* Language standard that is supported */
|
||||
DefineNumericMacro ("__CC65_STD_C89__", STD_C89);
|
||||
|
@ -667,9 +667,8 @@ static void OptVersion (const char* Opt attribute ((unused)),
|
||||
/* Print the compiler version */
|
||||
{
|
||||
fprintf (stderr,
|
||||
"cc65 V%u.%u.%u\n"
|
||||
"SVN version: %s\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH, SVNVersion);
|
||||
"cc65 V%s\nSVN version: %s\n",
|
||||
GetVersionAsString (), SVNVersion);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
@ -1128,8 +1128,8 @@ static void OptVersion (const char* Opt attribute ((unused)),
|
||||
/* Print version number */
|
||||
{
|
||||
fprintf (stderr,
|
||||
"cl65 V%u.%u.%u - (C) Copyright 1998-2005 Ullrich von Bassewitz\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
"cl65 V%s - (C) Copyright 1998-2009 Ullrich von Bassewitz\n",
|
||||
GetVersionAsString ());
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2003 Ullrich von Bassewitz */
|
||||
/* Römerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 2003-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -454,8 +454,8 @@ void Convert (const O65Data* D)
|
||||
}
|
||||
|
||||
/* Create a header */
|
||||
fprintf (F, ";\n; File generated by co65 v %u.%u.%u using model `%s'\n;\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH, GetModelName (Model));
|
||||
fprintf (F, ";\n; File generated by co65 v %s using model `%s'\n;\n",
|
||||
GetVersionAsString (), GetModelName (Model));
|
||||
|
||||
/* Select the CPU */
|
||||
if ((D->Header.mode & O65_CPU_MASK) == O65_CPU_65816) {
|
||||
@ -463,8 +463,7 @@ void Convert (const O65Data* D)
|
||||
}
|
||||
|
||||
/* Object file options */
|
||||
fprintf (F, ".fopt\t\tcompiler,\"co65 v %u.%u.%u\"\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
fprintf (F, ".fopt\t\tcompiler,\"co65 v %s\"\n", GetVersionAsString ());
|
||||
if (Author) {
|
||||
fprintf (F, ".fopt\t\tauthor, \"%s\"\n", Author);
|
||||
xfree (Author);
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2003 Ullrich von Bassewitz */
|
||||
/* Römerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 2003-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -264,8 +264,8 @@ static void OptVersion (const char* Opt attribute ((unused)),
|
||||
/* Print the assembler version */
|
||||
{
|
||||
fprintf (stderr,
|
||||
"co65 V%u.%u.%u - (C) Copyright 1998-2003 Ullrich von Bassewitz\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
"co65 V%s - (C) Copyright 1998-2009 Ullrich von Bassewitz\n",
|
||||
GetVersionAsString ());
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,6 +39,7 @@ OBJS = abend.o \
|
||||
strutil.o \
|
||||
target.o \
|
||||
tgttrans.o \
|
||||
version.o \
|
||||
xmalloc.o \
|
||||
xsprintf.o
|
||||
|
||||
|
@ -85,6 +85,7 @@ OBJS = abend.obj \
|
||||
strutil.obj \
|
||||
target.obj \
|
||||
tgttrans.obj \
|
||||
version.obj \
|
||||
wildargv.obj \
|
||||
xmalloc.obj \
|
||||
xsprintf.obj
|
||||
|
82
src/common/version.c
Normal file
82
src/common/version.c
Normal file
@ -0,0 +1,82 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* version.c */
|
||||
/* */
|
||||
/* Version information for the cc65 compiler package */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
/* warranty. In no event will the authors be held liable for any damages */
|
||||
/* arising from the use of this software. */
|
||||
/* */
|
||||
/* Permission is granted to anyone to use this software for any purpose, */
|
||||
/* including commercial applications, and to alter it and redistribute it */
|
||||
/* freely, subject to the following restrictions: */
|
||||
/* */
|
||||
/* 1. The origin of this software must not be misrepresented; you must not */
|
||||
/* claim that you wrote the original software. If you use this software */
|
||||
/* in a product, an acknowledgment in the product documentation would be */
|
||||
/* appreciated but is not required. */
|
||||
/* 2. Altered source versions must be plainly marked as such, and must not */
|
||||
/* be misrepresented as being the original software. */
|
||||
/* 3. This notice may not be removed or altered from any source */
|
||||
/* distribution. */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
#include "version.h"
|
||||
#include "xsprintf.h"
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
#define VER_MAJOR 2U
|
||||
#define VER_MINOR 13U
|
||||
#define VER_PATCH 0U
|
||||
#define VER_RC 0U
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Code */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
const char* GetVersionAsString (void)
|
||||
/* Returns the version number as a string in a static buffer */
|
||||
{
|
||||
static char Buf[20];
|
||||
#if defined(VER_RC) && (VER_RC > 0U)
|
||||
xsnprintf (Buf, sizeof (Buf), "%u.%u.%u-rc%u", VER_MAJOR, VER_MINOR, VER_PATCH, VER_RC);
|
||||
#else
|
||||
xsnprintf (Buf, sizeof (Buf), "%u.%u.%u", VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
#endif
|
||||
return Buf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned GetVersionAsNumber (void)
|
||||
/* Returns the version number as a combined unsigned for use in a #define */
|
||||
{
|
||||
return ((VER_MAJOR * 0x100) + (VER_MINOR * 0x10) + VER_PATCH);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2008, Ullrich von Bassewitz */
|
||||
/* (C) 1998-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@ -39,16 +39,16 @@
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
/* Code */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
#define VER_MAJOR 2U
|
||||
#define VER_MINOR 12U
|
||||
#define VER_PATCH 9U
|
||||
const char* GetVersionAsString (void);
|
||||
/* Returns the version number as a string in a static buffer */
|
||||
|
||||
#define VERSION ((VER_MAJOR * 0x100) + (VER_MINOR * 0x10) + VER_PATCH)
|
||||
unsigned GetVersionAsNumber (void);
|
||||
/* Returns the version number as a combined unsigned for use in a #define */
|
||||
|
||||
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2007 Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 1998-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -340,8 +340,8 @@ static void OptVersion (const char* Opt attribute ((unused)),
|
||||
/* Print the disassembler version */
|
||||
{
|
||||
fprintf (stderr,
|
||||
"da65 V%u.%u.%u - (C) Copyright 2000-2006, Ullrich von Bassewitz\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
"da65 V%s - (C) Copyright 2000-2009, Ullrich von Bassewitz\n",
|
||||
GetVersionAsString ());
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2000-2007 Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 2000-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -75,11 +75,11 @@ static void PageHeader (void)
|
||||
/* Print a page header */
|
||||
{
|
||||
fprintf (F,
|
||||
"; da65 V%u.%u.%u - (C) Copyright 2000-2005, Ullrich von Bassewitz\n"
|
||||
"; da65 V%s - (C) Copyright 2000-2009, Ullrich von Bassewitz\n"
|
||||
"; Created: %s\n"
|
||||
"; Input file: %s\n"
|
||||
"; Page: %u\n\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH,
|
||||
GetVersionAsString (),
|
||||
Now,
|
||||
InFile,
|
||||
Page);
|
||||
@ -188,7 +188,7 @@ void DefForward (const char* Name, const char* Comment, unsigned Offs)
|
||||
LineFeed ();
|
||||
}
|
||||
|
||||
/* Output the forward definition */
|
||||
/* Output the forward definition */
|
||||
Output ("%s", Name);
|
||||
Indent (ACol);
|
||||
if (UseHexOffs) {
|
||||
|
@ -490,8 +490,8 @@ static void OptVersion (const char* Opt attribute ((unused)),
|
||||
/* Print the assembler version */
|
||||
{
|
||||
fprintf (stderr,
|
||||
"ld65 V%u.%u.%u - (C) Copyright 1998-2005 Ullrich von Bassewitz\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
"ld65 V%s - (C) Copyright 1998-2009, Ullrich von Bassewitz\n",
|
||||
GetVersionAsString ());
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1999-2007 Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 1999-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -1385,7 +1385,7 @@ void O65WriteTarget (O65Desc* D, File* F)
|
||||
}
|
||||
OptBuf[OptLen] = '\0';
|
||||
O65SetOption (D, O65OPT_TIMESTAMP, OptBuf, OptLen + 1);
|
||||
sprintf (OptBuf, "ld65 V%u.%u.%u", VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
sprintf (OptBuf, "ld65 V%s", GetVersionAsString ());
|
||||
O65SetOption (D, O65OPT_ASM, OptBuf, strlen (OptBuf) + 1);
|
||||
|
||||
/* Write the header */
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2000-2002 Ullrich von Bassewitz */
|
||||
/* Wacholderweg 14 */
|
||||
/* D-70597 Stuttgart */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 2000-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -201,8 +201,8 @@ static void OptVersion (const char* Opt attribute ((unused)),
|
||||
/* Print the assembler version */
|
||||
{
|
||||
fprintf (stderr,
|
||||
"%s V%u.%u.%u - (C) Copyright 2000-2002 Ullrich von Bassewitz\n",
|
||||
ProgName, VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
"%s V%s - (C) Copyright 2000-2009, Ullrich von Bassewitz\n",
|
||||
ProgName, GetVersionAsString ());
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2002-2005 Ullrich von Bassewitz */
|
||||
/* Römerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 2002-2009, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -207,9 +207,7 @@ static void OptVersion (const char* Opt attribute ((unused)),
|
||||
const char* Arg attribute ((unused)))
|
||||
/* Print the assembler version */
|
||||
{
|
||||
fprintf (stderr,
|
||||
"sim65 V%u.%u.%u\n",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
fprintf (stderr, "sim65 V%s\n", GetVersionAsString ());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user