diff --git a/.gitattributes b/.gitattributes index 5e568606e6e..8ef852ed1ff 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ *.v linguist-language=Verilog /.gitcommit export-subst +/.gitepoch export-subst diff --git a/.gitepoch b/.gitepoch new file mode 100644 index 00000000000..2707647aacc --- /dev/null +++ b/.gitepoch @@ -0,0 +1 @@ +$Format:%ct$ diff --git a/Makefile b/Makefile index fa95b7b7035..08cf1d98dc6 100644 --- a/Makefile +++ b/Makefile @@ -143,16 +143,7 @@ endif YOSYS_VER := 0.33+0 -# Note: We arrange for .gitcommit to contain the (short) commit hash in -# tarballs generated with git-archive(1) using .gitattributes. The git repo -# will have this file in its unexpanded form tough, in which case we fall -# back to calling git directly. -TARBALL_GIT_REV := $(shell cat $(YOSYS_SRC)/.gitcommit) -ifeq ($(TARBALL_GIT_REV),$$Format:%h$$) -GIT_REV := $(shell GIT_DIR=$(YOSYS_SRC)/.git git rev-parse --short=9 HEAD || echo UNKNOWN) -else -GIT_REV := $(TARBALL_GIT_REV) -endif +include git.mk #< sets $(GIT_REV) OBJS = kernel/version_$(GIT_REV).o diff --git a/docs/Makefile b/docs/Makefile index 2319e1665c3..f18b45dc1f5 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -14,6 +14,11 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sou # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +# Reproducibility +include ../git.mk #< sets $(GIT_EPOCH) +export FORCE_SOURCE_DATE ?= 1 +export SOURCE_DATE_EPOCH ?= $(GIT_EPOCH) + .PHONY: help help: @echo "Please use \`make ' where is one of" diff --git a/docs/images/Makefile b/docs/images/Makefile index a7216ec9010..497472cf792 100644 --- a/docs/images/Makefile +++ b/docs/images/Makefile @@ -21,11 +21,15 @@ dots: $(DOT_PDF) tex: $(TEX_PDF) svg: $(SVG_OUTPUT) +include ../../git.mk #< sets $(GIT_EPOCH) +export FORCE_SOURCE_DATE ?= 1 +export SOURCE_DATE_EPOCH ?= $(GIT_EPOCH) + 011/%.pdf: $(DOT_LOC)/%.dot - faketime -f '2022-01-01 00:00:00 x0,001' dot -Tpdf -o $@ $< + dot -Tpdf -o $@ $< 011/%.pdf: 011/%.tex - cd 011 && faketime -f '2022-01-01 00:00:00 x0,001' pdflatex $(