Makefile how has dynamic dependencies for each presentation

The dependencies are read from each LaTeX file by searching for calls to
\includedeck.
This commit is contained in:
Daniel - 2018-08-19 16:46:01 +02:00
parent 802e0abbb9
commit f685674548
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 6 additions and 1 deletions

View File

@ -15,9 +15,14 @@ distclean: clean
presentations/$(BUILD_DIR)/%:
mkdir -p $@
define presentation_dependencies
$(shell cat $(1) | perl -ne '/includedeck\{(.*)\}/ && print "presentations/content/", $$1, ".tex "')
endef
define PRESENTATION_template
.ONESHELL: $(1)
$(1): $(subst .pdf,.tex,$(1)) $(BUILD_DECKS)
$(1): $(subst .pdf,.tex,$(1)) $(call presentation_dependencies,$(subst .pdf,.tex,$(1)))
echo $$^
cd presentations
$(LATEX) $$(notdir $$<)
$(LATEX) $$(notdir $$<)