2018-08-19 15:23:40 +02:00
|
|
|
PRESENTATIONS=$(patsubst %.tex, %.pdf, $(wildcard presentations/*.tex))
|
2018-08-19 16:08:47 +02:00
|
|
|
BUILD_DIR=build
|
|
|
|
BUILD_DECKS=$(subst presentations, presentations/$(BUILD_DIR), $(wildcard presentations/content/*))
|
|
|
|
LATEX=pdflatex -output-directory $(BUILD_DIR)
|
2018-08-19 15:23:40 +02:00
|
|
|
|
|
|
|
all: ${PRESENTATIONS}
|
|
|
|
|
2018-08-19 15:40:27 +02:00
|
|
|
clean:
|
2018-08-19 16:08:47 +02:00
|
|
|
rm -fr presentations/$(BUILD_DIR)
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -f presentations/*.pdf
|
|
|
|
|
|
|
|
.SECONDARY: $(BUILD_DECKS)
|
|
|
|
presentations/$(BUILD_DIR)/%:
|
|
|
|
mkdir -p $@
|
2018-08-19 15:40:27 +02:00
|
|
|
|
2018-08-19 16:46:01 +02:00
|
|
|
define presentation_dependencies
|
|
|
|
$(shell cat $(1) | perl -ne '/includedeck\{(.*)\}/ && print "presentations/content/", $$1, ".tex "')
|
|
|
|
endef
|
|
|
|
|
2018-08-19 16:37:01 +02:00
|
|
|
define PRESENTATION_template
|
|
|
|
.ONESHELL: $(1)
|
2018-08-19 16:46:01 +02:00
|
|
|
$(1): $(subst .pdf,.tex,$(1)) $(call presentation_dependencies,$(subst .pdf,.tex,$(1)))
|
|
|
|
echo $$^
|
2018-08-08 20:25:42 +02:00
|
|
|
cd presentations
|
2018-08-19 16:37:01 +02:00
|
|
|
$(LATEX) $$(notdir $$<)
|
|
|
|
$(LATEX) $$(notdir $$<)
|
|
|
|
mv $(subst presentations/,$(BUILD_DIR)/,$(1)) .
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach presentation, $(PRESENTATIONS), \
|
|
|
|
$(eval $(call PRESENTATION_template, $(presentation))))
|