Improve version number handling

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@533 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl 2009-08-02 18:20:53 +00:00
parent 17d787ee2e
commit d4b64752eb
12 changed files with 26 additions and 26 deletions

View File

@ -38,8 +38,6 @@ AS_FLAGS+= -g
all: versions dictionaries host-libraries target-libraries host-executables target-executables all: versions dictionaries host-libraries target-libraries host-executables target-executables
VERSION := "1.0"
versions: $(ODIR)/target/include/openbios-version.h $(ODIR)/forth/version.fs versions: $(ODIR)/target/include/openbios-version.h $(ODIR)/forth/version.fs
$(ODIR)/forth/version.fs: $(ODIR)/forth/version.fs:
@ -51,8 +49,7 @@ $(ODIR)/forth/version.fs:
$(ODIR)/target/include/openbios-version.h: $(ODIR)/target/include/openbios-version.h:
@DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ; \ @DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ; \
( echo "#define OPENBIOS_BUILD_DATE \"$$DATE\"" ; \ ( echo "#define OPENBIOS_BUILD_DATE \"$$DATE\"" ; \
echo "#define OPENBIOS_VERSION_STR \"$(VERSION)\"" ; \ echo "#define OPENBIOS_VERSION_STR \"$(VERSION)\"" ; ) \
echo "#define OPENBIOS_RELEASE \"$(VERSION)\"" ; ) \
> $(dir $@)/openbios-version.h > $(dir $@)/openbios-version.h
info: info:

1
VERSION Normal file
View File

@ -0,0 +1 @@
1.0

View File

@ -61,7 +61,8 @@ entry( void )
printk("\n"); printk("\n");
printk("=============================================================\n"); printk("=============================================================\n");
printk("OpenBIOS %s [%s]\n", OPENBIOS_RELEASE, OPENBIOS_BUILD_DATE ); printk(PROGRAM_NAME " " OPENBIOS_VERSION_STR " [%s]\n",
OPENBIOS_BUILD_DATE);
ofmem_init(); ofmem_init();
initialize_forth(); initialize_forth();

View File

@ -57,7 +57,8 @@ entry( void )
printk("\n"); printk("\n");
printk("=============================================================\n"); printk("=============================================================\n");
printk("OpenBIOS %s [%s]\n", OPENBIOS_RELEASE, OPENBIOS_BUILD_DATE ); printk(PROGRAM_NAME " " OPENBIOS_VERSION_STR " [%s]\n",
OPENBIOS_BUILD_DATE);
ofmem_init(); ofmem_init();
initialize_forth(); initialize_forth();

View File

@ -64,7 +64,8 @@ entry( void )
printk("\n"); printk("\n");
printk("=============================================================\n"); printk("=============================================================\n");
printk("OpenBIOS %s [%s]\n", OPENBIOS_RELEASE, OPENBIOS_BUILD_DATE ); printk(PROGRAM_NAME " " OPENBIOS_VERSION_STR " [%s]\n",
OPENBIOS_BUILD_DATE);
ofmem_init(); ofmem_init();
initialize_forth(); initialize_forth();

View File

@ -461,7 +461,8 @@ arch_of_init( void )
printk("\n"); printk("\n");
printk("=============================================================\n"); printk("=============================================================\n");
printk("OpenBIOS %s [%s]\n", OPENBIOS_RELEASE, OPENBIOS_BUILD_DATE ); printk(PROGRAM_NAME " " OPENBIOS_VERSION_STR " [%s]\n",
OPENBIOS_BUILD_DATE);
fw_cfg_read(FW_CFG_SIGNATURE, buf, 4); fw_cfg_read(FW_CFG_SIGNATURE, buf, 4);
buf[4] = '\0'; buf[4] = '\0';

View File

@ -32,6 +32,7 @@
#include "openbios/stack.h" #include "openbios/stack.h"
#include "unix/plugins.h" #include "unix/plugins.h"
#include "openbios/bindings.h" #include "openbios/bindings.h"
#include "openbios-version.h"
#include "blk.h" #include "blk.h"
@ -415,11 +416,12 @@ int main(int argc, char *argv[])
switch (c) { switch (c) {
case 'V': case 'V':
printk(BANNER "Version " VERSION "\n"); printk(BANNER "Version " OPENBIOS_VERSION_STR "\n");
return 0; return 0;
case 'h': case 'h':
case '?': case '?':
printk(BANNER "Version " VERSION "\n" USAGE, argv[0]); printk(BANNER "Version " OPENBIOS_VERSION_STR "\n"
USAGE, argv[0]);
return 0; return 0;
case 'v': case 'v':
verbose = 1; verbose = 1;

View File

@ -93,6 +93,8 @@ if test "x$HOSTARCH" = "x"; then
archname archname
fi fi
VERSION=`head VERSION`
echo "Configuring OpenBIOS on $HOSTARCH for $*" echo "Configuring OpenBIOS on $HOSTARCH for $*"
for RULES_ARCH in $*; do for RULES_ARCH in $*; do
ARCH=`echo $RULES_ARCH | sed s/cross-//g` ARCH=`echo $RULES_ARCH | sed s/cross-//g`
@ -173,6 +175,7 @@ for RULES_ARCH in $*; do
echo "AS_FLAGS=$AS_FLAGS" >> $ODIR/config.mak echo "AS_FLAGS=$AS_FLAGS" >> $ODIR/config.mak
echo "HOSTARCH?=$HOSTARCH" >> $ODIR/config.mak echo "HOSTARCH?=$HOSTARCH" >> $ODIR/config.mak
echo "CROSSCFLAGS=$CROSSCFLAGS" >> $ODIR/config.mak echo "CROSSCFLAGS=$CROSSCFLAGS" >> $ODIR/config.mak
echo "VERSION=\"$VERSION\"" >> $ODIR/config.mak
ln -s $SRCDIR/config/xml/rules.xml $ODIR/rules.xml ln -s $SRCDIR/config/xml/rules.xml $ODIR/rules.xml
ln -s $SRCDIR/config/examples/${RULES_ARCH}_config.xml $ODIR/config.xml ln -s $SRCDIR/config/examples/${RULES_ARCH}_config.xml $ODIR/config.xml
ln -s ../Makefile.target $ODIR/Makefile ln -s ../Makefile.target $ODIR/Makefile

View File

@ -41,9 +41,6 @@
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1 #define HAVE_UNISTD_H 1
/* Minor OpenBIOS version */
#define MINOR_VERSION 0
/* Define to the address where bug reports for this package should be sent. */ /* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "" #define PACKAGE_BUGREPORT ""
@ -59,15 +56,9 @@
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "" #define PACKAGE_VERSION ""
/* Patchlevel */
#define PATCH_LEVEL RC1
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Version */
#define VERSION "1.0"
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */ `char[]'. */
#define YYTEXT_POINTER 1 #define YYTEXT_POINTER 1

View File

@ -22,7 +22,6 @@
#include "asm/types.h" #include "asm/types.h"
#define PROGRAM_NAME "OpenBIOS" #define PROGRAM_NAME "OpenBIOS"
#define PROGRAM_VERSION VERSION
#ifndef BOOTSTRAP #ifndef BOOTSTRAP

View File

@ -27,6 +27,7 @@
#include "openbios/kernel.h" #include "openbios/kernel.h"
#include "dict.h" #include "dict.h"
#include "cross.h" #include "cross.h"
#include "openbios-version.h"
#define MEMORY_SIZE (1024*1024) /* 1M ram for hosted system */ #define MEMORY_SIZE (1024*1024) /* 1M ram for hosted system */
@ -992,11 +993,12 @@ int main(int argc, char *argv[])
switch (c) { switch (c) {
case 'V': case 'V':
printk("Version " VERSION "\n"); printk("Version " OPENBIOS_VERSION_STR "\n");
return 0; return 0;
case 'h': case 'h':
case '?': case '?':
printk("Version " VERSION "\n" USAGE, argv[0]); printk("Version " OPENBIOS_VERSION_STR "\n" USAGE,
argv[0]);
return 0; return 0;
case 'v': case 'v':
verbose = 1; verbose = 1;

View File

@ -4,6 +4,7 @@
#include "sys_info.h" #include "sys_info.h"
#include "asm/io.h" #include "asm/io.h"
#include "ipchecksum.h" #include "ipchecksum.h"
#include "openbios-version.h"
#define printf printk #define printf printk
#define debug printk #define debug printk
@ -19,7 +20,7 @@ struct elf_image_note {
Elf_Nhdr hdr1; Elf_Nhdr hdr1;
char name1[sizeof(ELF_NOTE_BOOT)]; char name1[sizeof(ELF_NOTE_BOOT)];
char version[sizeof(PROGRAM_VERSION)]; char version[sizeof(OPENBIOS_VERSION_STR)];
Elf_Nhdr hdr2; Elf_Nhdr hdr2;
char name2[sizeof(ELF_NOTE_BOOT)]; char name2[sizeof(ELF_NOTE_BOOT)];
@ -39,11 +40,11 @@ const struct elf_image_note elf_image_notes
.hdr1 = { .hdr1 = {
.n_namesz = sizeof(ELF_NOTE_BOOT), .n_namesz = sizeof(ELF_NOTE_BOOT),
.n_descsz = sizeof(PROGRAM_VERSION), .n_descsz = sizeof(OPENBIOS_VERSION_STR),
.n_type = EIN_PROGRAM_VERSION, .n_type = EIN_PROGRAM_VERSION,
}, },
.name1 = ELF_NOTE_BOOT, .name1 = ELF_NOTE_BOOT,
.version = PROGRAM_VERSION, .version = OPENBIOS_VERSION_STR,
.hdr2 = { .hdr2 = {
.n_namesz = sizeof(ELF_NOTE_BOOT), .n_namesz = sizeof(ELF_NOTE_BOOT),
@ -81,7 +82,7 @@ const char *program_version = elf_image_notes.version;
.int EIN_PROGRAM_VERSION .int EIN_PROGRAM_VERSION
1: .asciz "ELFBoot" 1: .asciz "ELFBoot"
2: .align 4 2: .align 4
3: .asciz PROGRAM_VERSION 3: .asciz OPENBIOS_VERSION_STR
4: 4:
.align 4 .align 4