]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Safer timestamp_autogenerated.h generation
authorLoïc Minier <loic.minier@linaro.org>
Mon, 3 Oct 2011 09:57:11 +0000 (11:57 +0200)
committerWolfgang Denk <wd@denx.de>
Thu, 6 Oct 2011 18:20:15 +0000 (20:20 +0200)
Generate timestamp_autogenerated.h as safely as version_autogenerated.h.

Cc: patches@linaro.org
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Makefile

index 1a9a4dbbf05eb011a2ca2295abcefd894300696e..5db2e0e33561907cdc08b841bc5e701304f16b4f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -570,8 +570,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}