diff --git a/Makefile.inc1 b/Makefile.inc1 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -35,7 +35,10 @@ # KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel # SUBDIR_OVERRIDE="list of dirs" to build rather than everything. # All libraries and includes, and some build tools will still build. - +# REPRODUCIBLE_EPOCH="timestamp" to use instead of gmtime(3) for all +# timestamps in the build. This is used to facilitate reproducible +# build artifacts from the same source tree, with build tools like +# thermite. # # The intended user-driven targets are: # buildworld - rebuild *everything*, including glue to help do upgrades @@ -573,7 +576,7 @@ _PKG_REVISION= ${_REVISION} _STRTIMENOW= %Y%m%d%H%M%S -_TIMENOW= ${_STRTIMENOW:gmtime} +_TIMENOW= ${_STRTIMENOW:gmtime=${REPRODUCIBLE_EPOCH:U0}} BRANCH_EXT= .if ${_BRANCH:MCURRENT*} || ${_BRANCH:MSTABLE*} || ${_BRANCH:MPRERELEASE*} _PKG_REVISION:= ${MAJOR_REVISION} @@ -602,7 +605,7 @@ SOURCE_DATE_EPOCH!= ${GIT_CMD} -C ${SRCDIR} show -s --format=%ct HEAD .else TIMEEPOCHNOW= %s -SOURCE_DATE_EPOCH= ${TIMEEPOCHNOW:gmtime} +SOURCE_DATE_EPOCH= ${TIMEEPOCHNOW:gmtime=${REPRODUCIBLE_EPOCH:U0}} .endif .else SOURCE_DATE_EPOCH= ${PKG_TIMESTAMP}