From 21e2b595c2797c226699cf19a2a2ad4abf22b210 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 27 Aug 2014 20:47:46 -0400 Subject: Prevent spurious recompiles on account of changed version. After a local commit, any file that included version.h would have to be recompiled on account of the changed version string. This changes version.h in the build directory to rbversion.h and includes the preprocessor macro from rbversion.h in firmware/common/version.c so that only that one file needs to be recompiled after a local commit rather than a whole slew of them. Change-Id: I900d97e3a24a0610698283416d97b4fa3a3a2cf6 Reviewed-on: http://gerrit.rockbox.org/937 Reviewed-by: Michael Sevakis Tested: Michael Sevakis --- tools/genversion.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'tools/genversion.sh') diff --git a/tools/genversion.sh b/tools/genversion.sh index 485263d152..bd80ceb597 100755 --- a/tools/genversion.sh +++ b/tools/genversion.sh @@ -8,22 +8,21 @@ # Usage: genversion.sh destination-dir path-to-version.sh [source-root] -# Generate version.h file +# Generate rbversion.h file # XXX DO NOT TWEAK VERSION HERE, EDIT version.sh INSTEAD VERSION=`$2 $3` -cat > "$1/_version.h" << EOF +cat > "$1/_rbversion.h" << EOF /* Generated by genversion.sh */ -extern const char rbversion[]; #define RBVERSION "$VERSION" EOF -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" +if [ -f "$1/rbversion.h" ] + then if diff "$1/_rbversion.h" "$1/rbversion.h" > /dev/null + then rm -f "$1/_rbversion.h" + else mv "$1/_rbversion.h" "$1/rbversion.h" fi - else mv "$1/_version.h" "$1/version.h" + else mv "$1/_rbversion.h" "$1/rbversion.h" fi -- cgit v1.2.3