Files
ally/making-of/Makefile
Madison Scott-Clary cdf1a68a14 Making of
2020-05-28 19:04:49 -07:00

58 lines
1.9 KiB
Makefile

.PHONY: help
help: ## This help.
@# This is ugly as hell and I hate awk
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: final
final: reset toc ## full document of the book for final print
# In ally, this warning would inform me to insert a pagebreak as needed.
#@echo
#@echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
#@echo "!Ensure that the index page breaks are okay!"
#@echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
.PHONY: single
single: reset plain ## full document run once, ensuring everything's reset
.PHONY: proof
proof: engage-letter engage-frame engage-draft toc reset ## full proof document of the book with frames and watermark
.PHONY: draft
draft: engage-draft toc reset ## draft document of thebook with watermark
.PHONY: plain
plain: ## full document of the book with no proofing marks
xelatex book.tex
.PHONY: toc
toc: plain ## full book with ToC re-rendering in case of page changes
# This command generates the index for ally, but there isn't one here, so.
#makeindex book
xelatex book.tex
.PHONY: frame
engage-frame: ## turn on frame marking
cp includes/_frame.tex includes/frame.tex
.PHONY: engage-letter
engage-letter: ## force letter paper
echo '\input{includes/_geometry-letter.tex}' > includes/geometry.tex
.PHONY: draft
engage-draft: ## turn on draft watermark
cp includes/_draft.tex includes/draft.tex
.PHONY: reset
reset: ## reset frame marking, draft watermark, and letter paper
echo '%' > includes/draft.tex
echo '%' > includes/frame.tex
echo '\input{includes/_geometry-trade.tex}' > includes/geometry.tex
.PHONY: content
content: ## build the markdown content into LaTeX
for in in src/content/*.md; do \
out=`echo $$in | sed -e 's/\.md/.tex/' | sed -e 's/.*\///'`; \
echo "$$in => $$out"; \
pandoc -f markdown -t latex -o content/$$out $$in --wrap=none --top-level-division=chapter; \
done