Skip to content

Commit

Permalink
Update U-Boot's build timestamp on every compile
Browse files Browse the repository at this point in the history
Use the GNU 'date' command to auto-generate a new U-Boot
timestamp on every compile.

Signed-off-by: Peter Tyser <[email protected]>
  • Loading branch information
Peter Tyser authored and wdenx committed Dec 6, 2008
1 parent 1450c4a commit 561858e
Show file tree
Hide file tree
Showing 47 changed files with 135 additions and 52 deletions.
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
else
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
endif
TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h
VERSION_FILE = $(obj)include/version_autogenerated.h

HOSTARCH := $(shell uname -m | \
Expand Down Expand Up @@ -261,7 +262,7 @@ LIBS += api/libapi.a
LIBS += post/libpost.a

LIBS := $(addprefix $(obj),$(LIBS))
.PHONY : $(LIBS) $(VERSION_FILE)
.PHONY : $(LIBS) $(TIMESTAMP_FILE) $(VERSION_FILE)

LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).a
LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
Expand Down Expand Up @@ -353,13 +354,13 @@ $(SUBDIRS): depend $(obj)include/autoconf.mk
$(LDSCRIPT): depend $(obj)include/autoconf.mk
$(MAKE) -C $(dir $@) $(notdir $@)

$(NAND_SPL): $(VERSION_FILE) $(obj)include/autoconf.mk
$(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
$(MAKE) -C nand_spl/board/$(BOARDDIR) all

$(U_BOOT_NAND): $(NAND_SPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin

$(ONENAND_IPL): $(VERSION_FILE) $(obj)include/autoconf.mk
$(ONENAND_IPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
$(MAKE) -C onenand_ipl/board/$(BOARDDIR) all

$(U_BOOT_ONENAND): $(ONENAND_IPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
Expand All @@ -372,6 +373,10 @@ $(VERSION_FILE):
) > $@.tmp
@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@

$(TIMESTAMP_FILE):
@date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
@date +'#define U_BOOT_TIME "%T"' >> $@

gdbtools:
$(MAKE) -C tools/gdb all || exit 1

Expand All @@ -381,7 +386,7 @@ updater:
env:
$(MAKE) -C tools/env all MTD_VERSION=${MTD_VERSION} || exit 1

depend dep: $(VERSION_FILE)
depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE)
for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir _depend ; done

TAG_SUBDIRS += include
Expand Down Expand Up @@ -462,7 +467,7 @@ sinclude $(obj)include/autoconf.mk.dep
else # !config.mk
all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
$(SUBDIRS) $(VERSION_FILE) gdbtools updater env depend \
$(SUBDIRS) $(TIMESTAMP_FILE) $(VERSION_FILE) gdbtools updater env depend \
dep tags ctags etags cscope $(obj)System.map:
@echo "System not configured - see README" >&2
@ exit 1
Expand Down Expand Up @@ -3274,7 +3279,7 @@ clean:
@rm -f $(obj)include/bmp_logo.h
@rm -f $(obj)nand_spl/{u-boot-spl,u-boot-spl.map,System.map}
@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl-2k.bin,ipl-4k.bin,ipl.map}
@rm -f $(obj)api_examples/demo $(VERSION_FILE)
@rm -f $(obj)api_examples/demo $(TIMESTAMP_FILE) $(VERSION_FILE)
@find $(OBJTREE) -type f \
\( -name 'core' -o -name '*.bak' -o -name '*~' \
-o -name '*.o' -o -name '*.a' \) -print \
Expand Down
4 changes: 2 additions & 2 deletions board/bmw/bmw.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <malloc.h>
#include <devices.h>
#include <net.h>
#include <version.h>
#include <timestamp.h>
#include <dtt.h>
#include <mpc824x.h>
#include <asm/processor.h>
Expand All @@ -45,7 +45,7 @@ int checkboard(void)
char buf[32];

puts ("Board: BMW MPC8245/KAHLUA2 - CHRP (MAP B)\n");
printf("Built: %s at %s\n", __DATE__ , __TIME__ );
printf("Built: %s at %s\n", U_BOOT_DATE, U_BOOT_TIME);
/* printf("MPLD: Revision %d\n", SYS_REVID_GET()); */
printf("Local Bus at %s MHz\n", strmhz(buf, busfreq));
return 0;
Expand Down
3 changes: 2 additions & 1 deletion board/eXalion/eXalion.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <pci.h>
#include <ide.h>
#include <netdev.h>
#include <timestamp.h>
#include "piix_pci.h"
#include "eXalion.h"

Expand All @@ -40,7 +41,7 @@ int checkboard (void)
char buf[32];

printf ("Board: eXalion MPC824x - CHRP (MAP B)\n");
printf ("Built: %s at %s\n", __DATE__, __TIME__);
printf ("Built: %s at %s\n", U_BOOT_DATE, U_BOOT_TIME);
printf ("Local Bus: %s MHz\n", strmhz (buf, busfreq));

return 0;
Expand Down
3 changes: 2 additions & 1 deletion board/lwmon/lwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,12 +762,13 @@ static uchar *key_match (uchar *kbd_data)
#ifdef CONFIG_LCD_INFO
#include <lcd.h>
#include <version.h>
#include <timestamp.h>

void lcd_show_board_info(void)
{
char temp[32];

lcd_printf ("%s (%s - %s)\n", U_BOOT_VERSION, __DATE__, __TIME__);
lcd_printf ("%s (%s - %s)\n", U_BOOT_VERSION, U_BOOT_DATE, U_BOOT_TIME);
lcd_printf ("(C) 2008 DENX Software Engineering GmbH\n");
lcd_printf (" Wolfgang DENK, [email protected]\n");
#ifdef CONFIG_LCD_INFO_BELOW_LOGO
Expand Down
3 changes: 2 additions & 1 deletion board/mousse/mousse.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <mpc824x.h>
#include <netdev.h>
#include <asm/processor.h>
#include <timestamp.h>

#include "mousse.h"
#include "m48t59y.h"
Expand All @@ -42,7 +43,7 @@ int checkboard (void)
char buf[32];

puts ("Board: MOUSSE MPC8240/KAHLUA - CHRP (MAP B)\n");
printf ("Built: %s at %s\n", __DATE__, __TIME__);
printf ("Built: %s at %s\n", U_BOOT_DATE, U_BOOT_TIME);
printf ("MPLD: Revision %d\n", SYS_REVID_GET ());
printf ("Local Bus: %s MHz\n", strmhz (buf, busfreq));

Expand Down
3 changes: 2 additions & 1 deletion board/netstar/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <common.h>
#include <exports.h>
#include <timestamp.h>
#include "../drivers/net/smc91111.h"

#define SMC_BASE_ADDRESS CONFIG_SMC91111_BASE
Expand Down Expand Up @@ -173,7 +174,7 @@ int eeprom(int argc, char *argv[])
/* Print help message */
if (argv[1][1] == 'h') {
printf("VoiceBlue EEPROM writer\n");
printf("Built: %s at %s\n", __DATE__ , __TIME__ );
printf("Built: %s at %s\n", U_BOOT_DATE, U_BOOT_TIME);
printf("Usage:\n\t<mac_address> [<element_1>] [<...>]\n");
return 0;
}
Expand Down
6 changes: 4 additions & 2 deletions board/sandburst/karef/karef.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <command.h>
#include "karef.h"
#include "karef_version.h"
#include <timestamp.h>
#include <asm/processor.h>
#include <asm/io.h>
#include <spd_sdram.h>
Expand Down Expand Up @@ -299,7 +300,7 @@ int checkboard (void)
"Serial Number: %d\n", sernum);
printf ("%s\n", KAREF_U_BOOT_REL_STR);

printf ("Built %s %s by %s\n", __DATE__, __TIME__, BUILDUSER);
printf ("Built %s %s by %s\n", U_BOOT_DATE, U_BOOT_TIME, BUILDUSER);
if (sbcommon_get_master()) {
printf("Slot 0 - Master\nSlave board");
if (sbcommon_secondary_present())
Expand Down Expand Up @@ -366,7 +367,8 @@ int misc_init_r (void)
setenv("ubrelver", KAREF_U_BOOT_REL_STR);

memset(envstr, 0, 255);
sprintf (envstr, "Built %s %s by %s", __DATE__, __TIME__, BUILDUSER);
sprintf (envstr, "Built %s %s by %s",
U_BOOT_DATE, U_BOOT_TIME, BUILDUSER);
setenv("bldstr", envstr);
saveenv();

Expand Down
6 changes: 4 additions & 2 deletions board/sandburst/metrobox/metrobox.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <command.h>
#include "metrobox.h"
#include "metrobox_version.h"
#include <timestamp.h>
#include <asm/processor.h>
#include <asm/io.h>
#include <spd_sdram.h>
Expand Down Expand Up @@ -270,7 +271,7 @@ int checkboard (void)
printf ("Board: Sandburst Corporation MetroBox Serial Number: %d\n", sernum);
printf ("%s\n", METROBOX_U_BOOT_REL_STR);

printf ("Built %s %s by %s\n", __DATE__, __TIME__, BUILDUSER);
printf ("Built %s %s by %s\n", U_BOOT_DATE, U_BOOT_TIME, BUILDUSER);
if (sbcommon_get_master()) {
printf("Slot 0 - Master\nSlave board");
if (sbcommon_secondary_present())
Expand Down Expand Up @@ -335,7 +336,8 @@ int misc_init_r (void)
setenv("ubrelver", METROBOX_U_BOOT_REL_STR);

memset(envstr, 0, 255);
sprintf (envstr, "Built %s %s by %s", __DATE__, __TIME__, BUILDUSER);
sprintf (envstr, "Built %s %s by %s",
U_BOOT_DATE, U_BOOT_TIME, BUILDUSER);
setenv("bldstr", envstr);
saveenv();

Expand Down
3 changes: 2 additions & 1 deletion board/tqc/tqm8xx/tqm8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,12 +571,13 @@ void ide_led (uchar led, uchar status)
#ifdef CONFIG_LCD_INFO
#include <lcd.h>
#include <version.h>
#include <timestamp.h>

void lcd_show_board_info(void)
{
char temp[32];

lcd_printf ("%s (%s - %s)\n", U_BOOT_VERSION, __DATE__, __TIME__);
lcd_printf ("%s (%s - %s)\n", U_BOOT_VERSION, U_BOOT_DATE, U_BOOT_TIME);
lcd_printf ("(C) 2008 DENX Software Engineering GmbH\n");
lcd_printf (" Wolfgang DENK, [email protected]\n");
#ifdef CONFIG_LCD_INFO_BELOW_LOGO
Expand Down
3 changes: 2 additions & 1 deletion board/trab/trab_fkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <common.h>
#include <exports.h>
#include <timestamp.h>
#include <s3c2400.h>
#include "tsc2000.h"
#include "rs485.h"
Expand Down Expand Up @@ -296,7 +297,7 @@ int trab_fkt (int argc, char *argv[])
int do_info (void)
{
printf ("Stand-alone application for TRAB board function test\n");
printf ("Built: %s at %s\n", __DATE__ , __TIME__ );
printf ("Built: %s at %s\n", U_BOOT_DATE, U_BOOT_TIME);

return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion board/voiceblue/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <common.h>
#include <exports.h>
#include <timestamp.h>
#include "../drivers/net/smc91111.h"

#define SMC_BASE_ADDRESS CONFIG_SMC91111_BASE
Expand Down Expand Up @@ -169,7 +170,7 @@ int eeprom(int argc, char *argv[])
/* Print help message */
if (argv[1][1] == 'h') {
printf("VoiceBlue EEPROM writer\n");
printf("Built: %s at %s\n", __DATE__ , __TIME__ );
printf("Built: %s at %s\n", U_BOOT_DATE, U_BOOT_TIME);
printf("Usage:\n\t<mac_address> [<element_1>] [<...>]\n");
return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion cpu/74xx_7xx/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*/
#include <config.h>
#include <74xx_7xx.h>
#include <timestamp.h>
#include <version.h>

#include <ppc_asm.tmpl>
Expand Down Expand Up @@ -87,7 +88,7 @@
.globl version_string
version_string:
.ascii U_BOOT_VERSION
.ascii " (", __DATE__, " - ", __TIME__, ")"
.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
.ascii CONFIG_IDENT_STRING, "\0"

. = EXC_OFF_SYS_RESET
Expand Down
3 changes: 2 additions & 1 deletion cpu/leon2/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <asm/psr.h>
#include <asm/stack.h>
#include <asm/leon.h>
#include <timestamp.h>
#include <version.h>

/* Entry for traps which jump to a programmer-specified trap handler. */
Expand Down Expand Up @@ -199,7 +200,7 @@ _trap_table:
.globl version_string
version_string:
.ascii U_BOOT_VERSION
.ascii " (", __DATE__, " - ", __TIME__, ")"
.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
.ascii CONFIG_IDENT_STRING, "\0"

.section ".text"
Expand Down
3 changes: 2 additions & 1 deletion cpu/leon3/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <asm/psr.h>
#include <asm/stack.h>
#include <asm/leon.h>
#include <timestamp.h>
#include <version.h>

/* Entry for traps which jump to a programmer-specified trap handler. */
Expand Down Expand Up @@ -200,7 +201,7 @@ _trap_table:
.globl version_string
version_string:
.ascii U_BOOT_VERSION
.ascii " (", __DATE__, " - ", __TIME__, ")"
.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
.ascii CONFIG_IDENT_STRING, "\0"

.section ".text"
Expand Down
3 changes: 2 additions & 1 deletion cpu/mcf5227x/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

#include <config.h>
#include <timestamp.h>
#include "version.h"

#ifndef CONFIG_IDENT_STRING
Expand Down Expand Up @@ -591,6 +592,6 @@ dcache_status:
.globl version_string
version_string:
.ascii U_BOOT_VERSION
.ascii " (", __DATE__, " - ", __TIME__, ")"
.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
.ascii CONFIG_IDENT_STRING, "\0"
.align 4
3 changes: 2 additions & 1 deletion cpu/mcf523x/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

#include <config.h>
#include <timestamp.h>
#include "version.h"

#ifndef CONFIG_IDENT_STRING
Expand Down Expand Up @@ -336,6 +337,6 @@ dcache_status:
.globl version_string
version_string:
.ascii U_BOOT_VERSION
.ascii " (", __DATE__, " - ", __TIME__, ")"
.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
.ascii CONFIG_IDENT_STRING, "\0"
.align 4
3 changes: 2 additions & 1 deletion cpu/mcf52x2/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

#include <config.h>
#include <timestamp.h>
#include "version.h"

#ifndef CONFIG_IDENT_STRING
Expand Down Expand Up @@ -474,6 +475,6 @@ dcache_status:
.globl version_string
version_string:
.ascii U_BOOT_VERSION
.ascii " (", __DATE__, " - ", __TIME__, ")"
.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
.ascii CONFIG_IDENT_STRING, "\0"
.align 4
3 changes: 2 additions & 1 deletion cpu/mcf532x/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#include <config.h>
#include <timestamp.h>
#include "version.h"

#ifndef CONFIG_IDENT_STRING
Expand Down Expand Up @@ -342,6 +343,6 @@ dcache_status:
.globl version_string
version_string:
.ascii U_BOOT_VERSION
.ascii " (", __DATE__, " - ", __TIME__, ")"
.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
.ascii CONFIG_IDENT_STRING, "\0"
.align 4
3 changes: 2 additions & 1 deletion cpu/mcf5445x/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

#include <config.h>
#include <timestamp.h>
#include "version.h"

#ifndef CONFIG_IDENT_STRING
Expand Down Expand Up @@ -627,6 +628,6 @@ dcache_status:
.globl version_string
version_string:
.ascii U_BOOT_VERSION
.ascii " (", __DATE__, " - ", __TIME__, ")"
.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
.ascii CONFIG_IDENT_STRING, "\0"
.align 4
Loading

0 comments on commit 561858e

Please sign in to comment.