Rewrite pattern rule with templates

This commit is contained in:
Daniel - 2018-08-19 16:37:01 +02:00
parent 51ae3ad864
commit 802e0abbb9
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 10 additions and 5 deletions

View File

@ -15,9 +15,14 @@ distclean: clean
presentations/$(BUILD_DIR)/%:
mkdir -p $@
.ONESHELL:
presentations/%.pdf : presentations/%.tex $(BUILD_DECKS)
define PRESENTATION_template
.ONESHELL: $(1)
$(1): $(subst .pdf,.tex,$(1)) $(BUILD_DECKS)
cd presentations
$(LATEX) $(notdir $<)
$(LATEX) $(notdir $<)
mv $(BUILD_DIR)/$*.pdf .
$(LATEX) $$(notdir $$<)
$(LATEX) $$(notdir $$<)
mv $(subst presentations/,$(BUILD_DIR)/,$(1)) .
endef
$(foreach presentation, $(PRESENTATIONS), \
$(eval $(call PRESENTATION_template, $(presentation))))