See https://reproducible-builds.org/docs/source-date-epoch/ for
rationale.
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
# Build timestamp
#
+# Used as a means to automatically select the newest version of iPXE
+# if multiple iPXE drivers are loaded concurrently in a UEFI system.
+#
+# It gets rounded down to the nearest minute when used for this
+# purpose.
+#
+ifdef SOURCE_DATE_EPOCH
+BUILD_TIMESTAMP := $(SOURCE_DATE_EPOCH)
+else ifdef GITVERSION
+BUILD_TIMESTAMP := $(shell git log -1 --pretty=%ct)
+else
BUILD_TIMESTAMP := $(shell date +%s)
+endif
# Build version
#