diff --git a/Makefile b/Makefile
index ccf7f9f..c3637ad 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ # project.
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundatio; either version 2 of
+# published by the Free Software Foundation; either version 2 of
 # the License, or (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
@@ -26,7 +26,7 @@ PATCHLEVEL = 1
 SUBLEVEL = 4
 EXTRAVERSION =
 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-VERSION_FILE = $(obj)include/version_autogenerated.h
+VERSION_FILE = version_autogenerated.c
 
 HOSTARCH := $(shell uname -m | \
 	sed -e s/i.86/i386/ \
@@ -253,9 +253,31 @@ all:		$(ALL)
 $(obj)u-boot.dis:	$(obj)u-boot
 		$(OBJDUMP) -d $< > $@
 
-$(obj)u-boot:		depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
+BUILDDATE := $(shell date +"%b %d %Y")
+BUILDTIME := $(shell date +"%H:%M:%S")
+
+# Don't assign with := since ./tools/identstr may need to be
+# rebuild and it hasn't yet, but will before IDENT_STR is
+# used.
+IDENT_STR = $(shell ./tools/identstr)
+
+$(obj)u-boot:		depend $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
+		@echo "#include <version.h>" > $(VERSION_FILE); \
+		echo >>$(VERSION_FILE); \
+		echo -n "const char version_string[] = \"U-Boot " > $(VERSION_FILE); \
+		echo -n "$(U_BOOT_VERSION)" >> $(VERSION_FILE); \
+		echo -n $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion \
+			 $(TOPDIR)) >> $(VERSION_FILE); \
+		echo -n " ($(BUILDDATE) - $(BUILDTIME))$(IDENT_STR)" >> $(VERSION_FILE); \
+		echo "\";" >> $(VERSION_FILE)
+# Compile the VERSION_FILE and we're all set.  If u-boot
+# depends on $(VERSION_FILE).o, we'd never generate
+# $(VERSION_FILE).  And, if it depends on VERSION_FILE, we'd
+# generate it every time, even if nothing else changed.
+		$(CC) $(CFLAGS) -c -o $(obj)$(VERSION_FILE:.c=.o) $(VERSION_FILE)
+# Now, link
 		UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
-		cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
+		cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) $(obj)$(VERSION_FILE:.c=.o) \
 			--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
 			-Map u-boot.map -o u-boot
 
@@ -2223,6 +2245,7 @@ clean:
 	rm -f $(obj)board/trab/trab_fkt $(obj)board/voiceblue/eeprom
 	rm -f $(obj)board/integratorap/u-boot.lds $(obj)board/integratorcp/u-boot.lds
 	rm -f $(obj)include/bmp_logo.h
+	rm -f $(VERSION_FILE) $(obj)$(VERSION_FILE:.c=.o)
 	find nand_spl -lname "*" -print | xargs rm -f
 	rm -f nand_spl/u-boot-spl nand_spl/u-boot-spl.map
 
diff --git a/common/command.c b/common/command.c
index e917975..60f26c4 100644
--- a/common/command.c
+++ b/common/command.c
@@ -27,11 +27,11 @@
 
 #include <common.h>
 #include <command.h>
+#include <version.h>
 
 int
 do_version (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-	extern char version_string[];
 	printf ("\n%s\n", version_string);
 	return 0;
 }
diff --git a/include/version.h b/include/version.h
index b56d2e9..e83219a 100644
--- a/include/version.h
+++ b/include/version.h
@@ -24,6 +24,8 @@
 #ifndef	__VERSION_H__
 #define	__VERSION_H__
 
-#include "version_autogenerated.h"
+#define U_BOOT_VERSION version_string
+
+extern const char version_string[];
 
 #endif	/* __VERSION_H__ */
diff --git a/lib_arm/board.c b/lib_arm/board.c
index babc254..07dfbd5 100644
--- a/lib_arm/board.c
+++ b/lib_arm/board.c
@@ -69,9 +69,6 @@ #ifndef CONFIG_IDENT_STRING
 #define CONFIG_IDENT_STRING ""
 #endif
 
-const char version_string[] =
-	U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")"CONFIG_IDENT_STRING;
-
 #ifdef CONFIG_DRIVER_CS8900
 extern void cs8900_get_enetaddr (uchar * addr);
 #endif
diff --git a/lib_i386/board.c b/lib_i386/board.c
index 4175fdb..7eabaf8 100644
--- a/lib_i386/board.c
+++ b/lib_i386/board.c
@@ -68,11 +68,6 @@ ulong i386boot_realmode_size = (ulong)&_
 ulong i386boot_bios          = (ulong)&_i386boot_bios;          /* start of BIOS emulation code */
 ulong i386boot_bios_size     = (ulong)&_i386boot_bios_size;     /* size of BIOS emulation code */
 
-
-const char version_string[] =
-	U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
-
-
 /*
  * Begin and End of memory area for malloc(), and current "brk"
  */
diff --git a/lib_microblaze/board.c b/lib_microblaze/board.c
index 026d247..223ac6c 100644
--- a/lib_microblaze/board.c
+++ b/lib_microblaze/board.c
@@ -25,14 +25,10 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <version.h>
 #include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
-
 /*
  * Begin and End of memory area for malloc(), and current "brk"
  */
diff --git a/lib_mips/board.c b/lib_mips/board.c
index b7d3356..aefcaca 100644
--- a/lib_mips/board.c
+++ b/lib_mips/board.c
@@ -28,6 +28,7 @@ #include <devices.h>
 #include <version.h>
 #include <net.h>
 #include <environment.h>
+#include <version.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -50,9 +51,6 @@ extern ulong uboot_end;
 
 ulong monitor_flash_len;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
-
 static char *failed = "*** failed ***\n";
 
 /*
diff --git a/tools/Makefile b/tools/Makefile
index 606f024..0f09f1f 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -21,10 +21,10 @@ # Foundation, Inc., 59 Temple Place, Sui
 # MA 02111-1307 USA
 #
 
-BIN_FILES	= img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
+BIN_FILES	= img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX) identstr$(SFX)
 
 OBJ_LINKS	= environment.o crc32.o
-OBJ_FILES	= img2srec.o mkimage.o envcrc.o gen_eth_addr.o bmp_logo.o
+OBJ_FILES	= img2srec.o mkimage.o envcrc.o gen_eth_addr.o bmp_logo.o identstr.o
 
 ifeq ($(ARCH),mips)
 BIN_FILES	+= inca-swap-bytes$(SFX)
@@ -157,6 +157,10 @@ all:	$(obj).depend $(BINS) $(LOGO_H) sub
 		$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
 		$(STRIP) $@
 
+$(obj)identstr$(SFX): $(obj)identstr.o
+		$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
+		$(STRIP) $@
+
 $(obj)envcrc.o:	$(src)envcrc.c
 		$(CC) -g $(CFLAGS) -c -o $@ $<
 
@@ -178,6 +182,9 @@ all:	$(obj).depend $(BINS) $(LOGO_H) sub
 $(obj)mpc86x_clk.o:	$(src)mpc86x_clk.c
 		$(CC) -g $(CFLAGS) -c -o $@ $<
 
+$(obj)identstr.o:	$(src)identstr.c
+		$(CC) -g $(CFLAGS) -c -o $@ $<
+
 subdirs:
 ifeq ($(TOOLSUBDIRS),)
 		@:
