aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 14 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 2f8da55..5761bbb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
P=what-is-iot
# Madrid Pittsburgh boxes
-SLIDE_THEME=boxes
+SLIDE_THEME?=boxes
PDFS=$(P)-text.pdf $(P)-slides.pdf
HTMLS=$(P)-reveal.html
@@ -49,10 +49,10 @@ $(P).md: Makefile
%-text.pdf: %.beamer.md
$(RUN_PANDOC_TEXT) -o $@ $<
-%-slides.pdf: %.beamer.md
+%-slides.pdf: %.beamer.md .var/SLIDE_THEME
$(RUN_PANDOC_BEAMER) -o $@ $<
-%-slides.tex: %.beamer.md
+%-slides.tex: %.beamer.md .var/SLIDE_THEME
$(RUN_PANDOC_BEAMER) -o $@ $<
%.revealjs.md: %.md
@@ -66,6 +66,17 @@ images/%.pdf: images/%.tex | images/pp-template Makefile
xelatex -output-directory=images $(patsubst %.tex,%-full.tex,$<)
mv $(patsubst %.pdf,%-full.pdf,$@) $@
+
+VARS=SLIDE_THEME
+
+define refresh =
+.var/$(1)::
+ @mkdir -p .var
+ @./refresh $$@ $(1) $($(1))
+endef
+
+$(foreach var,$(VARS),$(eval $(call refresh,$(var))))
+
# Dependencies
$(P).md: images/IP-Header_eng.tex
$(P).md: images/ip-header.pdf