diff mbox

[2/3] Safer timestamp_autogenerated.h generation

Message ID 1317635832-10764-3-git-send-email-loic.minier@linaro.org
State Accepted
Commit a76406fb05f68bcf0156f456f8ba17ef076cebab
Headers show

Commit Message

loic.minier@linaro.org Oct. 3, 2011, 9:57 a.m. UTC
Generate timestamp_autogenerated.h as safely as version_autogenerated.h.

Cc: patches@linaro.org
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
---
 Makefile |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Comments

Mike Frysinger Oct. 3, 2011, 2:39 p.m. UTC | #1
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
Wolfgang Denk Oct. 6, 2011, 6:20 p.m. UTC | #2
Dear =?UTF-8?q?Lo=C3=AFc=20Minier?=,

In message <1317635832-10764-3-git-send-email-loic.minier@linaro.org> you wrote:
> Generate timestamp_autogenerated.h as safely as version_autogenerated.h.
> 
> Cc: patches@linaro.org
> Signed-off-by: Loïc Minier <loic.minier@linaro.org>
> ---
>  Makefile |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 0892908..2991357 100644
--- a/Makefile
+++ b/Makefile
@@ -568,8 +568,9 @@  $(VERSION_FILE):
 
 $(TIMESTAMP_FILE):
 		@mkdir -p $(dir $(TIMESTAMP_FILE))
-		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
-		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
+		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@.tmp
+		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@.tmp
+		@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
 
 easylogo env gdb:
 	$(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION}