# All heavy tools run inside the container; the host drives via make. # Set NODOCKER=1 to run directly if xelatex/poppler/tesseract are installed locally. # zsh does not export UID/GID; compose.yaml needs them to run as the tree's owner. export UID := $(shell id -u) export GID := $(shell id -g) RUN := $(if $(NODOCKER),,docker compose run --rm -T tex) OUT := ross-1988-retypeset.pdf SOURCES := build.sh tools/polish.py src/preamble.tex src/colophon.tex src/errata.tex \ $(wildcard src/pages/*.tex) .DEFAULT_GOAL := pdf .PHONY: pdf build image prep plate check reprocheck verify clean distclean shell help # The PDF is a build product and is not in git. This remakes it from src/ and # plates/, neither of which needs the ProQuest scan — only prep and plate do. pdf: $(OUT) ## typeset the edition (only if a source changed) $(OUT): $(SOURCES) $(RUN) ./build.sh build: ## typeset unconditionally, even if nothing changed $(RUN) ./build.sh image: ## build the toolchain image (once) docker compose build prep: ## rasterize + OCR-scaffold pages A..B: make prep A=19 B=32 [needs source/] $(RUN) tools/prep.sh $(A) $(B) plate: ## crop plate image for PDF page N: make plate N=40 [ARGS="--top 0.06"] [needs source/] $(RUN) python3 tools/crop_plate.py $(N) $(ARGS) check: ## consistency checks (manifest <-> files <-> macros), no build $(RUN) python3 tools/check.py reprocheck: ## every token of src/pages must reach the built PDF $(RUN) python3 tools/reprocheck.py $(OUT) verify: check pdf reprocheck ## the full gate: check, typeset, then prove nothing was dropped shell: ## interactive shell in the container docker compose run --rm tex bash clean: ## remove LaTeX aux and scratch rasters (keeps plates and the PDF) rm -rf work/* distclean: clean ## also drop the page rasters and the built PDF rm -rf scans/* $(OUT) help: @grep -E '^[a-z-]+:.*##' Makefile | sed 's/:.*##/ —/'