28 lines
940 B
Makefile
28 lines
940 B
Makefile
PRESENTATIONS := $(patsubst src/%/presentation.tex,build/presentation_%.pdf,$(wildcard src/*/presentation.tex))
|
|
HANDOUTS := $(patsubst build/presentation_%.pdf,build/presentation_%_handout.pdf,$(PRESENTATIONS))
|
|
|
|
RC_PDFLATEX := $(shell grep '$$pdflatex' .latexmkrc \
|
|
| sed -e 's/.*"\(.*\)".*/\1/' -e 's/%S//' -e 's/%O//')
|
|
|
|
.PHONY: all
|
|
all: $(PRESENTATIONS) $(HANDOUTS)
|
|
|
|
build/presentation_%.pdf: src/%/presentation.tex build/prepared
|
|
TEXINPUTS=./lib/cel-slides-template-2025:$(dir $<):$$TEXINPUTS \
|
|
latexmk -outdir=build/$* $<
|
|
cp build/$*/presentation.pdf $@
|
|
|
|
build/presentation_%_handout.pdf: src/%/presentation.tex build/prepared
|
|
TEXINPUTS=./lib/cel-slides-template-2025:$(dir $<):$$TEXINPUTS \
|
|
latexmk -outdir=build/$*_handout \
|
|
-pdflatex='$(RC_PDFLATEX) %O "\def\ishandout{1}\input{%S}"' $<
|
|
cp build/$*_handout/presentation.pdf $@
|
|
|
|
build/prepared:
|
|
mkdir build
|
|
touch build/prepared
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf build
|