]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Makefile: provide constant with seconds since epoch
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 25 Oct 2020 06:25:05 +0000 (07:25 +0100)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 27 Oct 2020 20:13:15 +0000 (21:13 +0100)
Provide a constant U_BOOT_EPOCH with the number of seconds since
1970-01-01. This constant can be used to initialize a software
real time clock until it is updated via the 'sntp' command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Makefile

index 5a0ef186682f1b1830e1691902857dfb17d878ac..c21729cf522883e65cb4fb465072bc90f8153cdc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1870,6 +1870,7 @@ define filechk_timestamp.h
                        LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
                        LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \
                        LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; \
+                       LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_EPOCH %s'; \
                else \
                        return 42; \
                fi; \
@@ -1879,6 +1880,7 @@ define filechk_timestamp.h
                LC_ALL=C date +'#define U_BOOT_TZ "%z"'; \
                LC_ALL=C date +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \
                LC_ALL=C date +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; \
+               LC_ALL=C date +'#define U_BOOT_EPOCH %s'; \
        fi)
 endef