From 0ec7a061fb1c277f6afd73d61dd71bd21e7ef7b2 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Mon, 4 Feb 2008 17:44:23 -0500
Subject: [PATCH] only update version header as needed

Constantly rebuilding the version header will force useless relinking, so we
simply need to compare the new header with the existing one before updating
it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 9225a2d3503..969ce42ec06 100644
--- a/Makefile
+++ b/Makefile
@@ -343,7 +343,8 @@ $(VERSION_FILE):
 		echo -n "$(U_BOOT_VERSION)" ; \
 		echo -n $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion \
 			 $(TOPDIR)) ; \
-		echo "\"" ) > $(VERSION_FILE)
+		echo "\"" ) > $@.tmp
+		@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
 
 gdbtools:
 		$(MAKE) -C tools/gdb all || exit 1
-- 
GitLab