2019-08-29 04:15:10 -07:00
|
|
|
SHELL=/bin/bash -eo pipefail
|
|
|
|
|
2019-07-11 09:55:18 -07:00
|
|
|
# Experimental; options are pdflatex, lualatex, or xelatex.
|
2019-07-08 14:12:54 -07:00
|
|
|
# On Debian, LuaLaTeX needs the texlive-luatex package, and XeLaTeX needs the texlive-xetex package.
|
|
|
|
# Make sure to read <https://github.com/zcash/zips/issues/249>.
|
2019-11-25 14:00:43 -08:00
|
|
|
ENGINE=pdflatex
|
2019-07-08 14:12:54 -07:00
|
|
|
|
2019-07-11 09:55:18 -07:00
|
|
|
LATEXMKOPT_pdflatex=
|
|
|
|
LATEXMKOPT_xelatex=-pdflatex=xelatex -dvi- -ps-
|
|
|
|
LATEXMKOPT_lualatex=-pdflatex=lualatex -dvi- -ps-
|
|
|
|
|
2019-08-29 04:15:10 -07:00
|
|
|
LATEXMK=max_print_line=10000 latexmk $(LATEXMKOPT_$(ENGINE)) --halt-on-error --file-line-error -bibtex -pdf -logfilewarnings- -e '$$max_repeat=8'
|
|
|
|
LATEX=$(ENGINE) --halt-on-error --file-line-error
|
2020-06-15 05:15:44 -07:00
|
|
|
NOCRUFT?=|perl -pe 's|[{\<\(]\/[^ ]* ?||g;s|^.* has been referenced but does not exist.*||g;s|^\n||g'
|
2018-05-30 09:05:11 -07:00
|
|
|
|
2020-03-20 07:52:48 -07:00
|
|
|
# Use EXTRAOPT=-pvc for "continuous preview" mode. For example, "make auxblossom EXTRAOPT=-pvc".
|
|
|
|
# In this case the updated .pdf will be in the aux/ directory.
|
|
|
|
|
2021-09-01 03:50:45 -07:00
|
|
|
.PHONY: all all-specs release discard
|
2020-07-05 08:04:48 -07:00
|
|
|
all: .Makefile.uptodate
|
2021-03-19 07:00:19 -07:00
|
|
|
$(MAKE) nu5 canopy heartwood blossom sapling
|
2020-07-05 08:04:48 -07:00
|
|
|
|
2020-04-14 05:06:08 -07:00
|
|
|
all-specs: .Makefile.uptodate
|
2021-03-19 07:00:19 -07:00
|
|
|
$(MAKE) nu5.pdf canopy.pdf heartwood.pdf blossom.pdf sapling.pdf
|
2020-03-10 09:38:14 -07:00
|
|
|
|
2020-07-05 08:04:48 -07:00
|
|
|
release:
|
|
|
|
ifeq ($(shell git tag --points-at HEAD |wc -l),0)
|
|
|
|
echo "Set a tag at HEAD first."
|
|
|
|
else
|
|
|
|
$(eval TAG := $(shell git tag --points-at HEAD))
|
2021-09-30 07:47:00 -07:00
|
|
|
if [[ "$(shell git rev-parse --abbrev-ref HEAD)" != "main" ]]; then echo "Not on main."; exit 1; fi
|
2020-07-05 08:04:48 -07:00
|
|
|
$(MAKE) clean all
|
2021-01-10 16:10:37 -08:00
|
|
|
git add *.pdf
|
2020-07-05 08:04:48 -07:00
|
|
|
git commit -m "Regenerate PDFs." *.pdf
|
|
|
|
git tag "v$(TAG)"
|
2021-09-30 07:47:00 -07:00
|
|
|
git push --tags origin HEAD:main
|
2020-07-05 08:04:48 -07:00
|
|
|
endif
|
2020-03-10 09:38:14 -07:00
|
|
|
|
2021-09-01 03:50:45 -07:00
|
|
|
discard:
|
|
|
|
git checkout -- '*.pdf'
|
|
|
|
|
2020-04-14 05:06:08 -07:00
|
|
|
.Makefile.uptodate: Makefile
|
2020-03-10 09:38:14 -07:00
|
|
|
$(MAKE) clean
|
2020-04-14 05:06:08 -07:00
|
|
|
touch .Makefile.uptodate
|
2019-08-29 04:16:25 -07:00
|
|
|
|
2019-04-18 08:27:31 -07:00
|
|
|
sapling.pdf: protocol.tex zcash.bib incremental_merkle.png key_components_sapling.png
|
2017-07-10 23:58:57 -07:00
|
|
|
$(MAKE) sapling
|
|
|
|
|
2019-04-18 08:27:31 -07:00
|
|
|
blossom.pdf: protocol.tex zcash.bib incremental_merkle.png key_components_sapling.png
|
2019-02-22 05:47:00 -08:00
|
|
|
$(MAKE) blossom
|
|
|
|
|
2019-11-25 14:00:43 -08:00
|
|
|
heartwood.pdf: protocol.tex zcash.bib incremental_merkle.png key_components_sapling.png
|
|
|
|
$(MAKE) heartwood
|
|
|
|
|
2020-05-27 09:21:31 -07:00
|
|
|
canopy.pdf: protocol.tex zcash.bib incremental_merkle.png key_components_sapling.png
|
|
|
|
$(MAKE) canopy
|
2020-03-20 08:05:31 -07:00
|
|
|
|
2021-03-15 09:17:01 -07:00
|
|
|
nu5.pdf: protocol.tex zcash.bib incremental_merkle.png key_components_sapling.png
|
|
|
|
$(MAKE) nu5
|
2021-01-10 15:50:36 -08:00
|
|
|
|
2018-03-26 11:25:46 -07:00
|
|
|
.PHONY: auxsapling
|
|
|
|
auxsapling:
|
2017-12-16 16:39:31 -08:00
|
|
|
printf '\\toggletrue{issapling}\n\\renewcommand{\\docversion}{Version %s [\\SaplingSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
2018-03-18 06:27:13 -07:00
|
|
|
mkdir -p aux
|
|
|
|
rm -f aux/sapling.*
|
2020-03-20 07:52:48 -07:00
|
|
|
$(LATEXMK) -jobname=sapling -auxdir=aux -outdir=aux $(EXTRAOPT) protocol $(NOCRUFT)
|
2018-03-26 11:25:46 -07:00
|
|
|
|
|
|
|
.PHONY: sapling
|
|
|
|
sapling:
|
|
|
|
$(MAKE) auxsapling
|
2018-03-18 06:27:13 -07:00
|
|
|
mv -f aux/sapling.pdf .
|
2017-07-26 03:38:26 -07:00
|
|
|
|
2019-02-22 05:47:00 -08:00
|
|
|
.PHONY: auxblossom
|
|
|
|
auxblossom:
|
|
|
|
printf '\\toggletrue{isblossom}\n\\renewcommand{\\docversion}{Version %s [\\BlossomSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
|
|
|
mkdir -p aux
|
|
|
|
rm -f aux/blossom.*
|
2020-03-20 07:52:48 -07:00
|
|
|
$(LATEXMK) -jobname=blossom -auxdir=aux -outdir=aux $(EXTRAOPT) protocol $(NOCRUFT)
|
2019-02-22 05:47:00 -08:00
|
|
|
|
|
|
|
.PHONY: blossom
|
2019-02-23 18:02:16 -08:00
|
|
|
blossom:
|
2019-02-22 05:47:00 -08:00
|
|
|
$(MAKE) auxblossom
|
|
|
|
mv -f aux/blossom.pdf .
|
|
|
|
|
2019-11-25 14:00:43 -08:00
|
|
|
.PHONY: auxheartwood
|
|
|
|
auxheartwood:
|
|
|
|
printf '\\toggletrue{isheartwood}\n\\renewcommand{\\docversion}{Version %s [\\HeartwoodSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
|
|
|
mkdir -p aux
|
|
|
|
rm -f aux/heartwood.*
|
2020-03-20 07:52:48 -07:00
|
|
|
$(LATEXMK) -jobname=heartwood -auxdir=aux -outdir=aux $(EXTRAOPT) protocol $(NOCRUFT)
|
2019-11-25 14:00:43 -08:00
|
|
|
|
|
|
|
.PHONY: heartwood
|
|
|
|
heartwood:
|
|
|
|
$(MAKE) auxheartwood
|
|
|
|
mv -f aux/heartwood.pdf .
|
|
|
|
|
2020-05-27 09:21:31 -07:00
|
|
|
.PHONY: auxcanopy
|
|
|
|
auxcanopy:
|
|
|
|
printf '\\toggletrue{iscanopy}\n\\renewcommand{\\docversion}{Version %s [\\CanopySpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
2020-03-20 08:05:31 -07:00
|
|
|
mkdir -p aux
|
2020-05-27 09:21:31 -07:00
|
|
|
rm -f aux/canopy.*
|
|
|
|
$(LATEXMK) -jobname=canopy -auxdir=aux -outdir=aux $(EXTRAOPT) protocol $(NOCRUFT)
|
2020-03-20 08:05:31 -07:00
|
|
|
|
2020-05-27 09:21:31 -07:00
|
|
|
.PHONY: canopy
|
|
|
|
canopy:
|
|
|
|
$(MAKE) auxcanopy
|
|
|
|
mv -f aux/canopy.pdf .
|
2020-03-20 08:05:31 -07:00
|
|
|
|
2021-03-15 09:17:01 -07:00
|
|
|
.PHONY: auxnu5
|
|
|
|
auxnu5:
|
|
|
|
printf '\\toggletrue{isnufive}\n\\renewcommand{\\docversion}{Version %s [\\NUFiveSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
2021-01-10 15:50:36 -08:00
|
|
|
mkdir -p aux
|
2021-03-15 09:17:01 -07:00
|
|
|
rm -f aux/nu5.*
|
|
|
|
$(LATEXMK) -jobname=nu5 -auxdir=aux -outdir=aux $(EXTRAOPT) protocol $(NOCRUFT)
|
2021-01-10 15:50:36 -08:00
|
|
|
|
2021-03-15 09:17:01 -07:00
|
|
|
.PHONY: nu5
|
|
|
|
nu5:
|
|
|
|
$(MAKE) auxnu5
|
|
|
|
mv -f aux/nu5.pdf .
|
2021-06-04 13:04:57 -07:00
|
|
|
cp -f nu5.pdf protocol.pdf
|
2021-01-10 15:50:36 -08:00
|
|
|
|
2018-01-25 12:14:28 -08:00
|
|
|
.PHONY: nolatexmk-sapling
|
|
|
|
nolatexmk-sapling:
|
|
|
|
printf '\\toggletrue{issapling}\n\\renewcommand{\\docversion}{Version %s [\\SaplingSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
|
|
|
# If $(LATEX) fails, touch an input so that 'make' won't think it is up-to-date next time.
|
|
|
|
rm -f sapling.aux sapling.bbl sapling.blg sapling.brf sapling.bcf
|
2019-04-18 08:27:31 -07:00
|
|
|
$(LATEX) -jobname=sapling protocol.tex || { touch incremental_merkle.png; exit 1; }
|
2018-01-25 12:14:28 -08:00
|
|
|
biber sapling
|
2019-04-18 08:27:31 -07:00
|
|
|
$(LATEX) -jobname=sapling protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
$(LATEX) -jobname=sapling protocol.tex || { touch incremental_merkle.png; exit 1; }
|
2019-07-08 14:42:16 -07:00
|
|
|
sh mymakeindex.sh -o sapling.ind sapling.idx
|
2019-04-18 08:27:31 -07:00
|
|
|
$(LATEX) -jobname=sapling protocol.tex || { touch incremental_merkle.png; exit 1; }
|
2018-01-25 12:14:28 -08:00
|
|
|
|
2019-02-22 05:47:00 -08:00
|
|
|
.PHONY: nolatexmk-blossom
|
|
|
|
nolatexmk-blossom:
|
|
|
|
printf '\\toggletrue{isblossom}\n\\renewcommand{\\docversion}{Version %s [\\BlossomSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
|
|
|
# If $(LATEX) fails, touch an input so that 'make' won't think it is up-to-date next time.
|
|
|
|
rm -f blossom.aux blossom.bbl blossom.blg blossom.brf blossom.bcf
|
2019-04-18 08:27:31 -07:00
|
|
|
$(LATEX) -jobname=blossom protocol.tex || { touch incremental_merkle.png; exit 1; }
|
2019-07-08 14:14:28 -07:00
|
|
|
biber blossom
|
2019-04-18 08:27:31 -07:00
|
|
|
$(LATEX) -jobname=blossom protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
$(LATEX) -jobname=blossom protocol.tex || { touch incremental_merkle.png; exit 1; }
|
2019-07-08 14:42:16 -07:00
|
|
|
sh mymakeindex.sh -o blossom.ind blossom.idx
|
2019-04-18 08:27:31 -07:00
|
|
|
$(LATEX) -jobname=blossom protocol.tex || { touch incremental_merkle.png; exit 1; }
|
2019-08-23 07:25:37 -07:00
|
|
|
cp -f blossom.pdf protocol.pdf
|
2019-02-22 05:47:00 -08:00
|
|
|
|
2019-11-25 14:00:43 -08:00
|
|
|
.PHONY: nolatexmk-heartwood
|
|
|
|
nolatexmk-heartwood:
|
|
|
|
printf '\\toggletrue{isheartwood}\n\\renewcommand{\\docversion}{Version %s [\\HeartwoodSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
|
|
|
# If $(LATEX) fails, touch an input so that 'make' won't think it is up-to-date next time.
|
|
|
|
rm -f heartwood.aux heartwood.bbl heartwood.blg heartwood.brf heartwood.bcf
|
|
|
|
$(LATEX) -jobname=heartwood protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
biber heartwood
|
|
|
|
$(LATEX) -jobname=heartwood protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
$(LATEX) -jobname=heartwood protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
sh mymakeindex.sh -o heartwood.ind heartwood.idx
|
|
|
|
$(LATEX) -jobname=heartwood protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
|
2020-05-27 09:21:31 -07:00
|
|
|
.PHONY: nolatexmk-canopy
|
|
|
|
nolatexmk-canopy:
|
|
|
|
printf '\\toggletrue{iscanopy}\n\\renewcommand{\\docversion}{Version %s [\\CanopySpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
2020-03-20 08:05:31 -07:00
|
|
|
# If $(LATEX) fails, touch an input so that 'make' won't think it is up-to-date next time.
|
2020-05-27 09:21:31 -07:00
|
|
|
rm -f canopy.aux canopy.bbl canopy.blg canopy.brf canopy.bcf
|
|
|
|
$(LATEX) -jobname=canopy protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
biber canopy
|
|
|
|
$(LATEX) -jobname=canopy protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
$(LATEX) -jobname=canopy protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
sh mymakeindex.sh -o canopy.ind canopy.idx
|
|
|
|
$(LATEX) -jobname=canopy protocol.tex || { touch incremental_merkle.png; exit 1; }
|
2020-03-20 08:05:31 -07:00
|
|
|
|
2021-03-15 09:17:01 -07:00
|
|
|
.PHONY: nolatexmk-nu5
|
|
|
|
nolatexmk-nu5:
|
|
|
|
printf '\\toggletrue{isnufive}\n\\renewcommand{\\docversion}{Version %s [\\NUFiveSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
2021-01-10 15:50:36 -08:00
|
|
|
# If $(LATEX) fails, touch an input so that 'make' won't think it is up-to-date next time.
|
2021-03-15 09:17:01 -07:00
|
|
|
rm -f nu5.aux nu5.bbl nu5.blg nu5.brf nu5.bcf
|
|
|
|
$(LATEX) -jobname=nu5 protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
biber nu5
|
|
|
|
$(LATEX) -jobname=nu5 protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
$(LATEX) -jobname=nu5 protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
sh mymakeindex.sh -o nu5.ind nu5.idx
|
|
|
|
$(LATEX) -jobname=nu5 protocol.tex || { touch incremental_merkle.png; exit 1; }
|
2021-01-10 15:50:36 -08:00
|
|
|
|
2015-12-22 18:13:11 -08:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2021-03-19 07:00:19 -07:00
|
|
|
rm -f aux/* html/* protocol.ver protocol.pdf nu5.pdf canopy.pdf heartwood.pdf blossom.pdf sapling.pdf
|