Switch coldfire builds over to new toolchain using gcc 4.5.2 and binutils 2.20.1
[kugel-rb.git] / tools / genversion.sh
blob485263d152f39515ebf661dc10ea9218d8b5df98
1 #!/bin/sh
2 # __________ __ ___.
3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 # \/ \/ \/ \/ \/
9 # Usage: genversion.sh destination-dir path-to-version.sh [source-root]
11 # Generate version.h file
13 # XXX DO NOT TWEAK VERSION HERE, EDIT version.sh INSTEAD
15 VERSION=`$2 $3`
17 cat > "$1/_version.h" << EOF
18 /* Generated by genversion.sh */
19 extern const char rbversion[];
20 #define RBVERSION "$VERSION"
21 EOF
23 if [ -f "$1/version.h" ]
24 then if diff "$1/_version.h" "$1/version.h" > /dev/null
25 then rm -f "$1/_version.h"
26 else mv "$1/_version.h" "$1/version.h"
28 else mv "$1/_version.h" "$1/version.h"