diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2014-08-27 20:47:46 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2014-08-28 15:48:56 +0200 |
commit | 21e2b595c2797c226699cf19a2a2ad4abf22b210 (patch) | |
tree | 172d26fe3d2673266560c1fad0378028e2dbe033 /tools/genversion.sh | |
parent | 25f73d62079b63e4420fd037ad9460004179b026 (diff) | |
download | rockbox-21e2b595c2797c226699cf19a2a2ad4abf22b210.tar.gz rockbox-21e2b595c2797c226699cf19a2a2ad4abf22b210.zip |
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 <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
Diffstat (limited to 'tools/genversion.sh')
-rwxr-xr-x | tools/genversion.sh | 15 |
1 files changed, 7 insertions, 8 deletions
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 @@ | |||
8 | 8 | ||
9 | # Usage: genversion.sh destination-dir path-to-version.sh [source-root] | 9 | # Usage: genversion.sh destination-dir path-to-version.sh [source-root] |
10 | 10 | ||
11 | # Generate version.h file | 11 | # Generate rbversion.h file |
12 | 12 | ||
13 | # XXX DO NOT TWEAK VERSION HERE, EDIT version.sh INSTEAD | 13 | # XXX DO NOT TWEAK VERSION HERE, EDIT version.sh INSTEAD |
14 | 14 | ||
15 | VERSION=`$2 $3` | 15 | VERSION=`$2 $3` |
16 | 16 | ||
17 | cat > "$1/_version.h" << EOF | 17 | cat > "$1/_rbversion.h" << EOF |
18 | /* Generated by genversion.sh */ | 18 | /* Generated by genversion.sh */ |
19 | extern const char rbversion[]; | ||
20 | #define RBVERSION "$VERSION" | 19 | #define RBVERSION "$VERSION" |
21 | EOF | 20 | EOF |
22 | 21 | ||
23 | if [ -f "$1/version.h" ] | 22 | if [ -f "$1/rbversion.h" ] |
24 | then if diff "$1/_version.h" "$1/version.h" > /dev/null | 23 | then if diff "$1/_rbversion.h" "$1/rbversion.h" > /dev/null |
25 | then rm -f "$1/_version.h" | 24 | then rm -f "$1/_rbversion.h" |
26 | else mv "$1/_version.h" "$1/version.h" | 25 | else mv "$1/_rbversion.h" "$1/rbversion.h" |
27 | fi | 26 | fi |
28 | else mv "$1/_version.h" "$1/version.h" | 27 | else mv "$1/_rbversion.h" "$1/rbversion.h" |
29 | fi | 28 | fi |