PointsOfOrder/Makefile

46 lines
2.3 KiB
Makefile
Raw Permalink Normal View History

2021-02-03 01:20:41 +11:00
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
LATEX_PRE = \\\\newif\\\\ifpolulu\\\\newif\\\\ifpoweb
2021-02-03 01:20:41 +11:00
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@PYTHONPATH=. TEX_MAX_REPEAT=3 $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
latexpdf: latexpdf-lulu latexpdf-web
latexpdf-lulu:
@PYTHONPATH=. TEX_JOBNAME=PointsOfOrder_Lulu $(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@cd _build/latex; TEX_MAX_REPEAT=3 LATEXMKOPTS="-usepretex=$(LATEX_PRE)\\\\polulutrue -r latexmkrc -lualatex" make PointsOfOrder_Lulu.pdf
latexpdf-web:
@PYTHONPATH=. TEX_JOBNAME=PointsOfOrder_Web $(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@cd _build/latex; TEX_MAX_REPEAT=3 LATEXMKOPTS="-usepretex=$(LATEX_PRE)\\\\powebtrue -r latexmkrc -lualatex" make PointsOfOrder_Web.pdf
2021-02-03 01:20:41 +11:00
livehtml:
@PYTHONPATH=. sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) -d _build/doctrees --ignore ".git/*" --ignore "_build/*" $(O)
mobi:
./po_ebook_convert.py _build/epub/PointsofOrder.epub _build/epub/PointsofOrder.mobi --mobi-file-type=both --remove-first-image --cover=_static/cover.jpg --chapter=/ --change-justification=left --mobi-ignore-margins --no-inline-toc
2021-02-03 01:20:41 +11:00
upload:
git update-index --refresh > /dev/null; if git diff-index --quiet HEAD -- ; then true; else echo Cannot deploy with unstaged changes; exit 1; fi
cp -r _build/html/* '/home/runassudo/Documents/Work/School Cloud Data/unenc/public/www/pointsoforder'
sha256sum _build/latex/PointsOfOrder_Lulu.pdf | awk '{print substr($$1,0,6);}' > _build/latex/PointsOfOrder_Lulu.pdf.sha256
2021-02-22 23:56:19 +11:00
rm '/home/runassudo/Documents/Work/School Cloud Data/unenc_transient/Lulu/PointsOfOrder_Lulu'*.pdf || true
cp _build/latex/PointsOfOrder_Lulu.pdf '/home/runassudo/Documents/Work/School Cloud Data/unenc_transient/Lulu/PointsOfOrder_Lulu_'$$(sha256sum _build/latex/PointsOfOrder_Lulu.pdf | awk '{print substr($$1,0,6);}')'.pdf'