Don't autogenerate version.c. Just version.h is enough

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27003 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Frank Gevaerts 2010-06-21 00:18:29 +00:00
parent a2ab719d57
commit 2b0ef19900
4 changed files with 34 additions and 30 deletions

View file

@ -64,6 +64,7 @@ libc/mktime.c
#endif /* !defined(SIMULATOR)*/ #endif /* !defined(SIMULATOR)*/
/* Common */ /* Common */
common/version.c
common/config.c common/config.c
common/crc32.c common/crc32.c
#ifdef MI4_FORMAT #ifdef MI4_FORMAT

23
firmware/common/version.c Normal file
View file

@ -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;

View file

@ -17,7 +17,6 @@ FIRMLIB_OBJ := $(call c2obj, $(FIRMLIB_SRC))
ifeq (,$(findstring -DARCHOS_PLAYER,$(TARGET))) ifeq (,$(findstring -DARCHOS_PLAYER,$(TARGET)))
FIRMLIB_OBJ += $(BUILDDIR)/sysfont.o FIRMLIB_OBJ += $(BUILDDIR)/sysfont.o
endif endif
FIRMLIB_OBJ += $(BUILDDIR)/version.o
OTHER_SRC += $(FIRMLIB_SRC) OTHER_SRC += $(FIRMLIB_SRC)
FIRMLIB = $(BUILDDIR)/firmware/libfirmware.a FIRMLIB = $(BUILDDIR)/firmware/libfirmware.a
@ -51,8 +50,5 @@ ifneq ($(SVNVERSION),$(OLDSVNVERSION))
.PHONY: $(BUILDDIR)/version.h .PHONY: $(BUILDDIR)/version.h
endif endif
$(BUILDDIR)/version.c: $(BUILDDIR)/version.h
$(TOOLSDIR)/genversion.sh c $(BUILDDIR) $(TOOLSDIR)/version.sh $(ROOTDIR)
$(BUILDDIR)/version.h: $(BUILDDIR)/version.h:
$(TOOLSDIR)/genversion.sh h $(BUILDDIR) $(TOOLSDIR)/version.sh $(ROOTDIR) $(TOOLSDIR)/genversion.sh $(BUILDDIR) $(TOOLSDIR)/version.sh $(ROOTDIR)

View file

@ -6,40 +6,24 @@
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ # 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 # XXX DO NOT TWEAK VERSION HERE, EDIT version.sh INSTEAD
VERSION=`$3 $4` VERSION=`$2 $3`
if [ "$1" = "h" ]; then cat > "$1/_version.h" << EOF
cat > "$2/_version.h" << EOF
/* Generated by genversion.sh */ /* Generated by genversion.sh */
extern const char rbversion[]; extern const char rbversion[];
#define RBVERSION "$VERSION" #define RBVERSION "$VERSION"
EOF EOF
if [ -f "$2/version.h" ] if [ -f "$1/version.h" ]
then if diff "$2/_version.h" "$2/version.h" > /dev/null then if diff "$1/_version.h" "$1/version.h" > /dev/null
then rm -f "$2/_version.h" then rm -f "$1/_version.h"
else mv "$2/_version.h" "$2/version.h" else mv "$1/_version.h" "$1/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"
fi fi
else mv "$1/_version.h" "$1/version.h"
fi fi