public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH][RFC] Update U-Boot's build timestamp on every compile
@ 2008-10-17 22:51 Peter Tyser
  2008-10-17 22:55 ` Peter Tyser
  2008-10-21  0:59 ` Kim Phillips
  0 siblings, 2 replies; 14+ messages in thread
From: Peter Tyser @ 2008-10-17 22:51 UTC (permalink / raw)
  To: u-boot

Use the GNU 'date' command to auto-generate a new U-Boot
timestamp on every compile.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
---
I noticed that the build time of U-Boot was not updated on every
compile which occassionally threw me for a loop as to whether
a new U-Boot binary was programmed, etc.  This patch updates
a U_BOOT_DATE define on every compile which can then be used
in place of the multiple "__DATE__ - __TIME__" preprocessor
macros that are currently used.

This also ensures the timestamp will be the same for a board
if it uses __TIME__ in multiple files.

Let me know if this would be accepted into mainline and I'll
generate a formal patch updating all __DATE__/__TIME__
references.

 Makefile            |    2 ++
 cpu/mpc85xx/start.S |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index c711df6..2c76003 100644
--- a/Makefile
+++ b/Makefile
@@ -366,6 +366,8 @@ $(VERSION_FILE):
 		@( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \
 		 '$(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion $(TOPDIR))' \
 		 ) > $@.tmp
+		@( printf '#define U_BOOT_DATE "%s"\n' '$(shell date +"%b %d %C%y - %T")' \
+		 ) >> $@.tmp
 		@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
 
 gdbtools:
diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S
index 25d0390..dc55700 100644
--- a/cpu/mpc85xx/start.S
+++ b/cpu/mpc85xx/start.S
@@ -272,7 +272,7 @@ _start:
 	.globl	version_string
 version_string:
 	.ascii U_BOOT_VERSION
-	.ascii " (", __DATE__, " - ", __TIME__, ")"
+	.ascii " (", U_BOOT_DATE, ")"
 	.ascii CONFIG_IDENT_STRING, "\0"
 
 	.align	4
-- 
1.6.0.2.GIT

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-10-21 19:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-17 22:51 [U-Boot] [PATCH][RFC] Update U-Boot's build timestamp on every compile Peter Tyser
2008-10-17 22:55 ` Peter Tyser
2008-10-21  0:59 ` Kim Phillips
2008-10-21  2:02   ` Peter Tyser
2008-10-21  7:04     ` Wolfgang Denk
2008-10-21 14:40       ` Peter Tyser
2008-10-21 14:51         ` Jerry Van Baren
2008-10-21 15:02           ` Wolfgang Denk
2008-10-21 15:17             ` Peter Tyser
2008-10-21 14:57         ` Stefan Roese
2008-10-21 15:04           ` Wolfgang Denk
2008-10-21 14:59         ` Wolfgang Denk
2008-10-21 18:52           ` Andy Fleming
2008-10-21 19:03             ` Peter Tyser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox