aboutsummaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc14
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index c9a4fee236aa..f51fe7d3b119 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -597,8 +597,12 @@ PKG_VERSION:= ${_PKG_REVISION}${EXTRA_REVISION:C/[[:space:]]//g}
.endif # !defined(PKG_VERSION)
.if !defined(PKG_TIMESTAMP)
+.if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git)
+SOURCE_DATE_EPOCH!= ${GIT_CMD} -C ${SRCDIR} show -s --format=%ct HEAD
+.else
TIMEEPOCHNOW= %s
SOURCE_DATE_EPOCH= ${TIMEEPOCHNOW:gmtime}
+.endif
.else
SOURCE_DATE_EPOCH= ${PKG_TIMESTAMP}
.endif