diff --git a/make-includes/build_lecture_rules.make b/make-includes/build_lecture_rules.make index f01fe8f..ae0aec5 100755 --- a/make-includes/build_lecture_rules.make +++ b/make-includes/build_lecture_rules.make @@ -12,10 +12,9 @@ ################################################################################ # -# Standard file suffixes. +# Add standard file suffixes. # -.SUFFIXES: -.SUFFIXES: .pdf .tex .graffle .png .tif .plo +.SUFFIXES: .pdf .tex .dvi .graffle .png .tif .plo .jpg .pict ################################################################################ @@ -33,30 +32,17 @@ vpath %.pdf $(IMGDIR) vpath %.png $(IMGDIR) vpath %.tif $(IMGDIR) +vpath %.jpg $(IMGDIR) vpath %.plo $(IMGDIR) ################################################################################ # -# Standard file list variables. -# -# List of images used in the presentation as actual content. -# -SLIDE_IMAGES= -# -# List of images used in the presentation as backgrounds or watermarks. -# -SLIDE_BACKGROUNDS= -# -# List of images used in the figures and examples document. -# -FIG_IMAGES= -# # Files to be cleaned by the various "clean" targets. # -TIDY_FILES=*.tmp *.aux *.out *.log *.nav *.toc *.snm *.head *.dvi \ +TIDY_FILES+=*.tmp *.aux *.out *.log *.nav *.toc *.snm *.head *.dvi \ slides-combined.pdf slides-notes.pdf -CLEAN_FILES=*.pdf +CLEAN_FILES+=*.pdf ################################################################################ @@ -67,9 +53,9 @@ # DRAFT= # -# Specify LaTeX document options (comma-separated list) +# Specify LaTeX document options (comma-separated list). # -LATEX_OPTS=pdftex,usepdftitle=false,$(DRAFT) +LATEX_OPTS+=pdftex,usepdftitle=false,$(DRAFT) # # Base file names for the various documents. # @@ -80,7 +66,7 @@ # # List of standard "phony" build targets. # -TARGETS=all slides notes slides-combined slides-notes figures combined \ +TARGETS+=all slides notes slides-combined slides-notes figures combined \ debug test clean tidy targets # .PHONY: $(TARGETS) @@ -101,11 +87,16 @@ all: slides notes figures combined -ifneq ($(strip $(SLIDES)),) ################################################################################ # +# Build presentation slides. If $(SLIDES) is empty, these rules are ignored. +# +ifneq ($(strip $(SLIDES)),) + +# # Set the prerequisites for the "slides" build target, depending on -# whether the figures document exists. +# whether the figures document exists. If $(FIGURES) is non-empty, we need +# to include the figures .aux file for inter-document cross-references. # ifeq ($(strip $(FIGURES)),) SLIDES_PREREQS:=$(SLIDES).pdf @@ -113,15 +104,12 @@ SLIDES_PREREQS:=figures $(SLIDES).pdf endif -################################################################################ # -# Build the slides for the presentation. Include the figures .aux file for -# inter-document cross-references, but only if $(FIGURES) is non-empty. If -# $(SLIDES) is empty, these rules are ignored. +# Build the slides for the presentation. # slides: $(SLIDES_PREREQS) -$(SLIDES).pdf: $(SLIDES).tex $(SLIDE_IMAGES) +$(SLIDES).pdf: $(SLIDES).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) pdflatex --jobname=$(SLIDES) '\documentclass[$(LATEX_OPTS)]{beamer}\input{$(SLIDES)}' pdflatex --jobname=$(SLIDES) '\documentclass[$(LATEX_OPTS)]{beamer}\input{$(SLIDES)}' @@ -133,22 +121,24 @@ endif -ifneq ($(strip $(NOTES)),) ################################################################################ # -# Build the slides with notes. If $(NOTES) is empty, these rules are +# Build the presentation notes. If $(NOTES) is empty, these rules are # ignored. # +ifneq ($(strip $(NOTES)),) + +# +# Build the slides with notes. +# slides-notes: slides-notes.pdf -slides-notes.pdf: $(SLIDES).tex $(SLIDE_IMAGES) +slides-notes.pdf: $(SLIDES).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) pdflatex --jobname=slides-notes '\documentclass[$(LATEX_OPTS),notes=onlyslideswithnotes]{beamer}\input{$(SLIDES)}' pdflatex --jobname=slides-notes '\documentclass[$(LATEX_OPTS),notes=onlyslideswithnotes]{beamer}\input{$(SLIDES)}' -################################################################################ # -# Build the slides with notes, 6-up. If $(NOTES) is empty, these rules are -# ignored. +# Build the slides with notes, 6-up. # notes: $(NOTES).pdf @@ -163,11 +153,17 @@ endif -ifneq ($(strip $(COMBINED)),) ################################################################################ # +# Build the complete combined lecture document. If $(COMBINED) is empty, +# these rules are ignored. +# +ifneq ($(strip $(COMBINED)),) + +# # Set the prerequisites for the "combined" build target, depending on -# whether the figures document exists. +# whether the figures document exists. If $(FIGURES) is empty, they are +# omitted from the combined document. # ifeq ($(strip $(FIGURES)),) COMBINED_PREREQS:=$(COMBINED).tex slides-combined.pdf @@ -175,22 +171,17 @@ COMBINED_PREREQS:=$(COMBINED).tex slides-combined.pdf $(FIGURES).pdf endif -################################################################################ # -# Build the slides for the combined document. If $(COMBINED) is empty, -# these rules are ignored. +# Build the slides for the combined document. # slides-combined: slides-combined.pdf -slides-combined.pdf: $(SLIDES).tex $(SLIDE_IMAGES) +slides-combined.pdf: $(SLIDES).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) pdflatex --jobname=slides-combined '\documentclass[$(LATEX_OPTS),handout]{beamer}\input{$(SLIDES)}' pdflatex --jobname=slides-combined '\documentclass[$(LATEX_OPTS),handout]{beamer}\input{$(SLIDES)}' -################################################################################ # -# Build the complete combined document. If $(COMBINED) is empty, these -# rules are ignored. If $(FIGURES) is empty, they are omitted from the -# combined document. +# Build the complete combined document. # combined: $(COMBINED).pdf @@ -206,15 +197,17 @@ endif -ifneq ($(strip $(FIGURES)),) ################################################################################ # -# Build the figures and examples document. If $(FIGURES) is empty, -# these rules are ignored. +# Build the figures and examples document. If $(FIGURES) is empty, these +# rules are ignored. # +ifneq ($(strip $(FIGURES)),) + figures: $(FIGURES).pdf -$(FIGURES).pdf: $(FIGURES).tex $(FIG_IMAGES) +$(FIGURES).pdf: $(FIGURES).tex $(FIG_IMAGES) + @echo $(FIG_IMAGES) pdflatex $< pdflatex $<