Newer
Older
QR_TARGET != grep mailto: README.md | cut -d: -f2,3 | tail -c+2
QR_CODE=\qrcode[height=.2\textwidth]{$(QR_TARGET)}
COMPRESS = gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dNOPAUSE -dQUIET -dBATCH -dPrinted=false -sOutputFile=$@ $<
CP := ln -f
BOOK != basename "$(shell pwd)"
TITLE != head -1 README.md | tail -c+3 | tr ' ' '_'
LOCAL_DROSS := rubbish
DROSS = ../$(LOCAL_DROSS)
DBOOK = $(DROSS)/$(BOOK).pdf
COMPILER = latexmk -file-line-error -output-directory=$(DROSS) -pdflua -interaction=nonstopmode -halt-on-error -shell-escape -r config/.latexmkrc -jobname=$(BOOK)
RELEASE = $(TITLE).pdf
GLOS := makeglossaries -d $(DROSS)
RUN := lualatex -output-directory $(DROSS) -shell-escape
.PHONY: LOCTEX
LOCTEX: $(wildcard *.tex)
.PHONY: HANDOUTS
HANDOUTS: config/CS.tex config/booklet.tex config/fold_front.tex config/fold_back.tex
.PHONY: STYLE_FILES
.PHONY: EXTERNAL
EXTERNAL: $(wildcard $(DROSS)/*.glg) | $(DROSS)
@printf '%s' '\qrcode[height=.2\textwidth]{$(QR_TARGET)}' > qr.tex
output += qr.tex .switch-gls svg-inkscape
images/extracted/:
mkdir -p $@
echo '*' > $@.gitignore
images/extracted/inclusion.tex: images/extracted/
printf '%s\n' '\externaldocument{$(BOOK)}' > $@
printf '%s\n' '\newcommand\bookTitle{$(TITLE)}' | tr '_' ' ' >> $@
dependencies = git git-lfs lualatex latexmk inkscape
.PHONY: check
check: ## Check you have the project dependencies
@$(foreach program, $(dependencies), \
command -v $(program) >/dev/null || { echo install $(program) && exit 1 ;} ;)
help: ## Print the help message
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
sort | \
column -s ':' -t
graph: ## Show a dependency graph (needs graph-easy and make2graph)
make -Bind $(TARG) | make2graph | graph-easy --boxart
pdfjam --landscape --paper a3paper --nup 1x1 --signature 12 $< -o $@
output += $(targets)
.PHONY: all
all: ## All standard targets
make $(targets)
.PHONY: clean
clean: ## Clean repo, including cross-reference files
$(RM) -r $(output)