deterministic build of tfm.pdf

This commit is contained in:
Steffen Jaeckel 2014-10-13 12:32:25 +02:00
parent 4e0e2c0f90
commit 3a80f80039

View File

@ -125,6 +125,15 @@ rsatest: $(LIBNAME) demo/rsa.o
$(CC) $(CFLAGS) demo/rsa.o $(LIBNAME) -o rsatest
docdvi: tfm.tex
cp tfm.tex tfm.bak
touch --reference=tfm.tex tfm.bak
(printf "%s" "\def\fixedpdfdate{"; date +'D:%Y%m%d%H%M%S%:z' -d @$$(stat --format=%Y tfm.tex) | sed "s/:\([0-9][0-9]\)$$/'\1'}/g") > tfm-deterministic.tex
printf "%s\n" "\pdfinfo{" >> tfm-deterministic.tex
printf "%s\n" " /CreationDate (\fixedpdfdate)" >> tfm-deterministic.tex
printf "%s\n}\n" " /ModDate (\fixedpdfdate)" >> tfm-deterministic.tex
cat tfm.tex >> tfm-deterministic.tex
mv tfm-deterministic.tex tfm.tex
touch --reference=tfm.bak tfm.tex
touch tfm.ind
latex tfm >/dev/null
latex tfm >/dev/null
@ -133,7 +142,9 @@ docdvi: tfm.tex
docs: docdvi
latex tfm >/dev/null
dvipdf tfm
pdflatex tfm >/dev/null
sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' tfm.pdf
mv tfm.bak tfm.tex
mv -f tfm.pdf doc
#This rule cleans the source tree of all compiled code, not including the pdf