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 /firmware | |
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 'firmware')
-rw-r--r-- | firmware/common/version.c | 2 | ||||
-rw-r--r-- | firmware/firmware.make | 6 | ||||
-rw-r--r-- | firmware/include/version.h | 26 |
3 files changed, 30 insertions, 4 deletions
diff --git a/firmware/common/version.c b/firmware/common/version.c index 762842c6de..bb856e4219 100644 --- a/firmware/common/version.c +++ b/firmware/common/version.c | |||
@@ -19,5 +19,5 @@ | |||
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #include "version.h" | 22 | #include "rbversion.h" |
23 | const char rbversion[] = RBVERSION; | 23 | const char rbversion[] = RBVERSION; |
diff --git a/firmware/firmware.make b/firmware/firmware.make index 8e2d475683..8f8014d82c 100644 --- a/firmware/firmware.make +++ b/firmware/firmware.make | |||
@@ -47,11 +47,11 @@ $(BUILDDIR)/sysfont.o: $(SYSFONT) $(BUILDDIR)/sysfont.h | |||
47 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$(BUILDDIR)/sysfont.c))$(CC) $(CFLAGS) -c $(BUILDDIR)/sysfont.c -o $@ | 47 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$(BUILDDIR)/sysfont.c))$(CC) $(CFLAGS) -c $(BUILDDIR)/sysfont.c -o $@ |
48 | 48 | ||
49 | SVNVERSION:=$(shell $(TOOLSDIR)/version.sh $(ROOTDIR)) | 49 | SVNVERSION:=$(shell $(TOOLSDIR)/version.sh $(ROOTDIR)) |
50 | OLDSVNVERSION:=$(shell grep 'RBVERSION' $(BUILDDIR)/version.h 2>/dev/null|cut -d '"' -f 2 || echo "NOREVISION") | 50 | OLDSVNVERSION:=$(shell grep 'RBVERSION' $(BUILDDIR)/rbversion.h 2>/dev/null|cut -d '"' -f 2 || echo "NOREVISION") |
51 | 51 | ||
52 | ifneq ($(SVNVERSION),$(OLDSVNVERSION)) | 52 | ifneq ($(SVNVERSION),$(OLDSVNVERSION)) |
53 | .PHONY: $(BUILDDIR)/version.h | 53 | .PHONY: $(BUILDDIR)/rbversion.h |
54 | endif | 54 | endif |
55 | 55 | ||
56 | $(BUILDDIR)/version.h: | 56 | $(BUILDDIR)/rbversion.h: |
57 | $(call PRINTS,GEN $(@F))$(TOOLSDIR)/genversion.sh $(BUILDDIR) $(TOOLSDIR)/version.sh $(ROOTDIR) | 57 | $(call PRINTS,GEN $(@F))$(TOOLSDIR)/genversion.sh $(BUILDDIR) $(TOOLSDIR)/version.sh $(ROOTDIR) |
diff --git a/firmware/include/version.h b/firmware/include/version.h new file mode 100644 index 0000000000..e9e291a8c4 --- /dev/null +++ b/firmware/include/version.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 by Frank Gevaerts | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #ifndef _RBVERSION_H_ | ||
22 | #define _RBVERSION_H_ | ||
23 | |||
24 | extern const char rbversion[]; | ||
25 | |||
26 | #endif /* _RBVERSION_H_ */ | ||