summaryrefslogtreecommitdiffstats
path: root/tools/genversion.sh
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2010-06-21 00:18:29 +0000
committerFrank Gevaerts <frank@gevaerts.be>2010-06-21 00:18:29 +0000
commit2b0ef19900295ef4e8da0fa52a13a04ccf76cb65 (patch)
tree6c6e445a398904780e4843bedf7c543e238197b1 /tools/genversion.sh
parenta2ab719d57c2da0a66ece6d6ab1e2eb2a9192413 (diff)
downloadrockbox-2b0ef19900295ef4e8da0fa52a13a04ccf76cb65.tar.gz
rockbox-2b0ef19900295ef4e8da0fa52a13a04ccf76cb65.tar.bz2
rockbox-2b0ef19900295ef4e8da0fa52a13a04ccf76cb65.zip
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
Diffstat (limited to 'tools/genversion.sh')
-rwxr-xr-xtools/genversion.sh34
1 files changed, 9 insertions, 25 deletions
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