diff --git a/firmware/SOURCES b/firmware/SOURCES index 3d9c60de6c..c95946dd0d 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -64,6 +64,7 @@ libc/mktime.c #endif /* !defined(SIMULATOR)*/ /* Common */ +common/version.c common/config.c common/crc32.c #ifdef MI4_FORMAT diff --git a/firmware/common/version.c b/firmware/common/version.c new file mode 100644 index 0000000000..762842c6de --- /dev/null +++ b/firmware/common/version.c @@ -0,0 +1,23 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2010 by Frank Gevaerts + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "version.h" +const char rbversion[] = RBVERSION; diff --git a/firmware/firmware.make b/firmware/firmware.make index badd22ae76..3ccff00dde 100644 --- a/firmware/firmware.make +++ b/firmware/firmware.make @@ -17,7 +17,6 @@ FIRMLIB_OBJ := $(call c2obj, $(FIRMLIB_SRC)) ifeq (,$(findstring -DARCHOS_PLAYER,$(TARGET))) FIRMLIB_OBJ += $(BUILDDIR)/sysfont.o endif -FIRMLIB_OBJ += $(BUILDDIR)/version.o OTHER_SRC += $(FIRMLIB_SRC) FIRMLIB = $(BUILDDIR)/firmware/libfirmware.a @@ -51,8 +50,5 @@ ifneq ($(SVNVERSION),$(OLDSVNVERSION)) .PHONY: $(BUILDDIR)/version.h endif -$(BUILDDIR)/version.c: $(BUILDDIR)/version.h - $(TOOLSDIR)/genversion.sh c $(BUILDDIR) $(TOOLSDIR)/version.sh $(ROOTDIR) - $(BUILDDIR)/version.h: - $(TOOLSDIR)/genversion.sh h $(BUILDDIR) $(TOOLSDIR)/version.sh $(ROOTDIR) + $(TOOLSDIR)/genversion.sh $(BUILDDIR) $(TOOLSDIR)/version.sh $(ROOTDIR) diff --git a/tools/genversion.sh b/tools/genversion.sh index b49d9f30e7..485263d152 100755 --- a/tools/genversion.sh +++ b/tools/genversion.sh @@ -6,40 +6,24 @@ # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ # \/ \/ \/ \/ \/ -# Usage: genversion.sh c/h destination-dir path-to-version.sh [source-root] +# Usage: genversion.sh destination-dir path-to-version.sh [source-root] -# Generate version.[ch] files (if first argument is c or h) +# Generate version.h file # XXX DO NOT TWEAK VERSION HERE, EDIT version.sh INSTEAD -VERSION=`$3 $4` +VERSION=`$2 $3` -if [ "$1" = "h" ]; then - cat > "$2/_version.h" << EOF +cat > "$1/_version.h" << EOF /* Generated by genversion.sh */ extern const char rbversion[]; #define RBVERSION "$VERSION" EOF - if [ -f "$2/version.h" ] - then if diff "$2/_version.h" "$2/version.h" > /dev/null - then rm -f "$2/_version.h" - else mv "$2/_version.h" "$2/version.h" - fi - else mv "$2/_version.h" "$2/version.h" - fi -elif [ "$1" = "c" ]; then - cat > "$2/_version.c" << EOF -/* Generated by genversion.sh */ -#include "version.h" -const char rbversion[] = RBVERSION; -EOF - - if [ -f "$2/version.c" ] - then if diff "$2/_version.c" "$2/version.c" > /dev/null - then rm -f "$2/_version.c" - else mv "$2/_version.c" "$2/version.c" - fi - else mv "$2/_version.c" "$2/version.c" +if [ -f "$1/version.h" ] + then if diff "$1/_version.h" "$1/version.h" > /dev/null + then rm -f "$1/_version.h" + else mv "$1/_version.h" "$1/version.h" fi + else mv "$1/_version.h" "$1/version.h" fi