summaryrefslogtreecommitdiffstats
path: root/tools/genversion.sh
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-09-23 21:51:28 +0100
committerGerrit Rockbox <gerrit@rockbox.org>2016-09-23 23:03:23 +0200
commit50c1de7092fa75c6c5317ac5338d685191a443c0 (patch)
treeda0b2755e39f3607c45fa26ee10e654f95a22dc5 /tools/genversion.sh
parent92450a99240f5ab085248af13d67112f38d51b35 (diff)
downloadrockbox-50c1de7092fa75c6c5317ac5338d685191a443c0.tar.gz
rockbox-50c1de7092fa75c6c5317ac5338d685191a443c0.tar.bz2
rockbox-50c1de7092fa75c6c5317ac5338d685191a443c0.zip
Fix makefile not rebuilding rbversion.h in some cases
For example when running make VERSION="bla" Change-Id: I8f8833f0fb200828346ed0a6842a9340e3653932
Diffstat (limited to 'tools/genversion.sh')
-rwxr-xr-xtools/genversion.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/genversion.sh b/tools/genversion.sh
index bd80ceb597..c385c36924 100755
--- a/tools/genversion.sh
+++ b/tools/genversion.sh
@@ -6,19 +6,20 @@
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
-# Usage: genversion.sh destination-dir path-to-version.sh [source-root]
+# Usage: genversion.sh destination-dir version
# Generate rbversion.h file
# XXX DO NOT TWEAK VERSION HERE, EDIT version.sh INSTEAD
-VERSION=`$2 $3`
+VERSION="$2"
cat > "$1/_rbversion.h" << EOF
/* Generated by genversion.sh */
#define RBVERSION "$VERSION"
EOF
+# Don't touch rbversion.h if it hasn't change, to avoid rebuilding stuff
if [ -f "$1/rbversion.h" ]
then if diff "$1/_rbversion.h" "$1/rbversion.h" > /dev/null
then rm -f "$1/_rbversion.h"