2019-07-08 14:12:54 -07:00
|
|
|
# Experimental; options are nothing (for traditional LaTeX), -lualatex, or -xelatex.
|
|
|
|
# The nolatexmk-* targets ignore this setting.
|
|
|
|
# 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>.
|
|
|
|
ENGINE=
|
|
|
|
|
|
|
|
LATEXMK=latexmk $(ENGINE) --halt-on-error -bibtex -pdf -logfilewarnings-
|
2018-05-30 09:05:11 -07:00
|
|
|
LATEX=pdflatex --halt-on-error
|
|
|
|
|
2019-06-18 14:32:14 -07:00
|
|
|
# extractpdfmark is needed to produce optimized PDFs that preserve "named destinations"
|
|
|
|
# (needed for external links into the file to work correctly).
|
|
|
|
# <https://github.com/trueroad/extractpdfmark>
|
|
|
|
EXTRACTPDFMARK=extractpdfmark
|
|
|
|
|
|
|
|
# Options are documented at <http://web.mit.edu/ghostscript/www/Ps2pdf.htm>
|
|
|
|
OPTIMIZER=gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH \
|
|
|
|
-r450 -dDownsampleColorImages=false -dDownsampleGrayImages=false -dDownsampleMonoImages=false -dFastWebView=true \
|
|
|
|
-dSubsetFonts=true -dCompressPages=true
|
|
|
|
|
2019-04-18 08:27:31 -07:00
|
|
|
sprout.pdf: protocol.tex zcash.bib incremental_merkle.png key_components.png
|
2018-09-02 00:50:40 -07:00
|
|
|
$(MAKE) sprout
|
2016-02-16 11:45:29 -08: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
|
|
|
|
|
2018-08-05 02:02:24 -07:00
|
|
|
.PHONY: auxsprout
|
|
|
|
auxsprout:
|
2018-07-18 03:17:33 -07:00
|
|
|
printf '\\renewcommand{\\docversion}{Version %s [\\SproutSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
2018-03-18 06:27:13 -07:00
|
|
|
mkdir -p aux
|
2018-08-05 02:02:24 -07:00
|
|
|
rm -f aux/sprout.* aux/protocol.*
|
|
|
|
$(LATEXMK) -jobname=sprout -auxdir=aux -outdir=aux protocol
|
2017-07-26 03:38:26 -07:00
|
|
|
|
2018-08-05 02:02:24 -07:00
|
|
|
.PHONY: sprout
|
|
|
|
sprout:
|
|
|
|
$(MAKE) auxsprout
|
|
|
|
mv -f aux/sprout.pdf .
|
2017-12-01 17:39:17 -08:00
|
|
|
|
2018-08-05 02:02:24 -07:00
|
|
|
.PHONY: pvcsprout
|
|
|
|
pvcsprout:
|
2018-07-18 03:17:33 -07:00
|
|
|
printf '\\renewcommand{\\docversion}{Version %s [\\SproutSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
2018-03-18 06:27:13 -07:00
|
|
|
mkdir -p aux
|
2018-08-05 02:02:24 -07:00
|
|
|
rm -f aux/sprout.* aux/protocol.*
|
|
|
|
$(LATEXMK) -jobname=sprout -auxdir=aux -pvc protocol
|
2015-12-22 18:13:11 -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.*
|
2018-05-30 09:05:11 -07:00
|
|
|
$(LATEXMK) -jobname=sapling -auxdir=aux -outdir=aux protocol
|
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 .
|
2018-08-05 08:05:40 -07:00
|
|
|
cp -f sapling.pdf protocol.pdf
|
2017-07-26 03:38:26 -07:00
|
|
|
|
|
|
|
.PHONY: pvcsapling
|
|
|
|
pvcsapling:
|
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.*
|
2018-05-30 09:05:11 -07:00
|
|
|
$(LATEXMK) -jobname=sapling -auxdir=aux -pvc protocol
|
2018-01-25 12:14:28 -08: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.*
|
|
|
|
$(LATEXMK) -jobname=blossom -auxdir=aux -outdir=aux protocol
|
|
|
|
|
|
|
|
.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 .
|
|
|
|
|
|
|
|
.PHONY: pvcblossom
|
2019-04-18 08:27:31 -07:00
|
|
|
pvcblossom:
|
2019-02-22 05:47:00 -08:00
|
|
|
printf '\\toggletrue{isblossom}\n\\renewcommand{\\docversion}{Version %s [\\BlossomSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
|
|
|
mkdir -p aux
|
|
|
|
rm -f aux/blossom.*
|
|
|
|
$(LATEXMK) -jobname=blossom -auxdir=aux -pvc protocol
|
|
|
|
|
2018-08-05 02:02:24 -07:00
|
|
|
.PHONY: nolatexmk-sprout
|
|
|
|
nolatexmk-sprout:
|
2018-07-18 03:17:33 -07:00
|
|
|
printf '\\renewcommand{\\docversion}{Version %s [\\SproutSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
|
2018-01-25 12:14:28 -08:00
|
|
|
# If $(LATEX) fails, touch an input so that 'make' won't think it is up-to-date next time.
|
2018-08-05 02:02:24 -07:00
|
|
|
rm -f sprout.aux sprout.bbl sprout.blg sprout.brf sprout.bcf
|
2019-04-18 08:27:31 -07:00
|
|
|
$(LATEX) protocol.tex || { touch incremental_merkle.png; exit 1; }
|
2018-01-25 12:14:28 -08:00
|
|
|
biber protocol
|
2019-04-18 08:27:31 -07:00
|
|
|
$(LATEX) protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
$(LATEX) protocol.tex || { touch incremental_merkle.png; exit 1; }
|
|
|
|
$(LATEX) protocol.tex || { touch incremental_merkle.png; exit 1; }
|
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; }
|
|
|
|
$(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-02-22 05:47:00 -08:00
|
|
|
biber sapling
|
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; }
|
|
|
|
$(LATEX) -jobname=blossom protocol.tex || { touch incremental_merkle.png; exit 1; }
|
2019-02-22 05:47:00 -08:00
|
|
|
|
2018-03-26 11:25:46 -07:00
|
|
|
.PHONY: html
|
2019-02-22 05:47:00 -08:00
|
|
|
html: sapling.pdf sprout.pdf blossom.pdf
|
2018-03-26 11:25:46 -07:00
|
|
|
# Can't use --split-pages 1 because XHR doesn't work by default on local files in Chrome.
|
2018-08-05 02:02:24 -07:00
|
|
|
pdf2htmlEX --decompose-ligature 1 --font-size-multiplier 65 --fit-width 1000 --dest-dir html sprout.pdf
|
2018-03-26 11:25:46 -07:00
|
|
|
pdf2htmlEX --decompose-ligature 1 --font-size-multiplier 65 --fit-width 1000 --dest-dir html sapling.pdf
|
2019-02-22 05:47:00 -08:00
|
|
|
pdf2htmlEX --decompose-ligature 1 --font-size-multiplier 65 --fit-width 1000 --dest-dir html blossom.pdf
|
2018-03-26 11:25:46 -07:00
|
|
|
|
2015-12-22 18:13:11 -08:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2018-03-24 02:11:18 -07:00
|
|
|
rm -f aux/* html/* protocol.ver \
|
2018-08-05 02:02:24 -07:00
|
|
|
sprout.dvi sprout.pdf sprout.bbl sprout.blg sprout.brf sprout.toc \
|
|
|
|
sprout.aux sprout.out sprout.log sprout.bcf sprout.run.xml sprout.fls sprout.fdb_latexmk \
|
|
|
|
sapling.dvi sapling.pdf sapling.bbl sapling.blg sapling.brf sapling.toc \
|
2019-02-22 05:47:00 -08:00
|
|
|
sapling.aux sapling.out sapling.log sapling.bcf sapling.run.xml sapling.fls sapling.fdb_latexmk \
|
|
|
|
blossom.dvi blossom.pdf blossom.bbl blossom.blg blossom.brf blossom.toc \
|
|
|
|
blossom.aux blossom.out blossom.log blossom.bcf blossom.run.xml blossom.fls blossom.fdb_latexmk
|
2018-03-24 02:10:32 -07:00
|
|
|
|
2018-08-05 02:02:24 -07:00
|
|
|
.PHONY: optsprout
|
2019-06-18 14:32:14 -07:00
|
|
|
optsprout:
|
2018-08-05 02:02:24 -07:00
|
|
|
$(MAKE) auxsprout
|
2019-06-18 14:32:14 -07:00
|
|
|
$(EXTRACTPDFMARK) aux/sprout.pdf >aux/sprout-pdfmark.ps
|
|
|
|
$(OPTIMIZER) -sOutputFile=sprout.pdf aux/sprout.pdf aux/sprout-pdfmark.ps 2>/dev/null |awk '{printf "."}'
|
|
|
|
ls -l aux/sprout.pdf sprout.pdf
|
2018-03-24 02:10:32 -07:00
|
|
|
|
2018-03-26 11:25:46 -07:00
|
|
|
.PHONY: optsapling
|
2019-06-18 14:32:14 -07:00
|
|
|
optsapling:
|
2018-03-26 11:25:46 -07:00
|
|
|
$(MAKE) auxsapling
|
2019-06-18 14:32:14 -07:00
|
|
|
$(EXTRACTPDFMARK) aux/sapling.pdf >aux/sapling-pdfmark.ps
|
|
|
|
$(OPTIMIZER) -sOutputFile=sapling.pdf aux/sapling.pdf aux/sapling-pdfmark.ps 2>/dev/null |awk '{printf "."}'
|
|
|
|
ls -l aux/sapling.pdf sapling.pdf
|
2018-08-05 08:05:40 -07:00
|
|
|
cp -f sapling.pdf protocol.pdf
|
2018-03-24 02:10:32 -07:00
|
|
|
|
2019-02-22 05:47:00 -08:00
|
|
|
.PHONY: optblossom
|
2019-06-18 14:32:14 -07:00
|
|
|
optblossom:
|
2019-02-22 05:47:00 -08:00
|
|
|
$(MAKE) auxblossom
|
2019-06-18 14:32:14 -07:00
|
|
|
$(EXTRACTPDFMARK) aux/blossom.pdf >aux/blossom-pdfmark.ps
|
|
|
|
$(OPTIMIZER) -sOutputFile=blossom.pdf aux/blossom.pdf aux/blossom-pdfmark.ps 2>/dev/null |awk '{printf "."}'
|
|
|
|
ls -l aux/blossom.pdf blossom.pdf
|
2019-02-22 05:47:00 -08:00
|
|
|
|
2018-03-24 02:10:32 -07:00
|
|
|
.PHONY: optimized
|
2019-02-22 05:47:00 -08:00
|
|
|
optimized: optsapling optsprout optblossom
|