GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
1
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
Handbook
Browse code
• Moved commonly-used LaTeX flags into central infrastructure.
master
1 parent
c361643
commit
4606213a525210b172a68f7a0643723e2cc3fed0
Nigel Stanger
authored
on 8 Dec 2017
Patch
Showing
2 changed files
make-includes/build_lecture_rules.make
makefile-templates/Makefile.lecture
Ignore Space
Show notes
View
make-includes/build_lecture_rules.make
################################################################################ # # Standard variables and rules for building a set of lecture files. # Altering these definitions will affect ALL LECTURE MAKEFILES FOR ALL # PAPERS!! If you need to do something specific for a particular paper, # include a custom rule in its makefile. DON'T add it here! # ################################################################################ ################################################################################ # # Add standard file suffixes. # include $(GLOBAL_HANDBOOK_INCLUDE)/standard_suffixes.make ################################################################################ # # Standard directories. # IMGDIR?=images ################################################################################ # # Standard paths. # include $(GLOBAL_HANDBOOK_INCLUDE)/standard_paths.make ################################################################################ # # Files to be cleaned by the various "clean" targets. Note that we don't # "tidy" .aux files because they may be needed by the xr package for inter- # document cross references, but won't get regenerated if the final target # PDF files exist. They will be caught by by the "clean" target though. # TIDY_FILES+=*.tmp *.out *.log *.nav *.toc *.snm *.head *.dvi *.vrb _minted* \ slides-combined.pdf slides-notes.pdf CLEAN_FILES+=*.aux *.pdf ################################################################################ # # Various environment variables. # # Important: default font size for Beamer is 11pt. We need to define this before # loading the standard environment. However, allow the user to override it! ifndef FONT_SIZE FONT_SIZE=11pt endif include $(GLOBAL_HANDBOOK_INCLUDE)/standard_environment.make # # Base file names for the various input and output documents. # SLIDES_IN?=$(DOC_TYPE)_slides FIGURES_IN?=$(DOC_TYPE)_figures COMBINED_IN?=$(DOC_TYPE)_combined NOTES_IN?=$(DOC_TYPE)_notes SLIDES?=$(DOC_TYPE)_$(DOC_NUM)_slides FIGURES?=$(DOC_TYPE)_$(DOC_NUM)_figures COMBINED?=$(DOC_TYPE)_$(DOC_NUM)_combined NOTES?=$(DOC_TYPE)_$(DOC_NUM)_notes # # Standard files to be installed on the web server. # ifneq ($(strip $(SLIDES)),) INSTALL_FILES+=$(SLIDES).pdf endif ifneq ($(strip $(FIGURES)),) INSTALL_FILES+=$(FIGURES).pdf $(FIGURES)-reduced.pdf endif ifneq ($(strip $(COMBINED)),) INSTALL_FILES+=$(COMBINED).pdf endif INSTALL_FILES+=$(wildcard *.mp3) # # List of standard "phony" build targets. # TARGETS+=slides notes slides-combined slides-notes figures figures2up combined # .PHONY: $(TARGETS) ################################################################################ # # Display a message if someone tries to build a target that has been # disabled (by setting the appropriate variable to empty in the makefile). # disabled_message=@$(ECHO) The \"$(1)\" target has been disabled for this $(DOC_TYPE). ################################################################################ # # Default LaTeX command-line options. # * -shell-escape for use with minted (and other things) # * others to aid debugging # # LATEX_FLAGS+=-shell-escape -interaction=nonstopmode -halt-on-error -file-line-error ################################################################################ # # Alternate LaTeXs for Unicode vs. non-Unicode processing. # ifdef UNICODE LATEXCMD:=$(XELATEX) $(LATEX_FLAGS) else LATEXCMD:=$(PDFLATEX) $(LATEX_FLAGS) endif ################################################################################ # # Build everything. # all: slides notes figures figures2up combined ################################################################################ # # 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. 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 else SLIDES_PREREQS:=figures $(SLIDES).pdf endif # # Build the slides for the presentation. # slides: $(SLIDES_PREREQS) $(SLIDES).pdf: $(SLIDES_IN).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) $(SLIDE_FILES) $(LATEXCMD) -jobname=$(SLIDES) '\documentclass[$(LATEX_OPTS)]{lectureslides}\input{$(SLIDES_IN)}' $(LATEXCMD) -jobname=$(SLIDES) '\documentclass[$(LATEX_OPTS)]{lectureslides}\input{$(SLIDES_IN)}' else slides: $(call disabled_message,$@) endif ################################################################################ # # Build the presentation notes. If $(NOTES) is empty, these rules are # ignored. # ifneq ($(strip $(NOTES)),) # # Set the prerequisites for the "slides-notes" build target, depending on # 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)),) NOTES_PREREQS:=$(NOTES).pdf SLIDES_NOTES_PREREQS:=slides-notes.pdf else NOTES_PREREQS:=figures $(NOTES).pdf SLIDES_NOTES_PREREQS:=figures slides-notes.pdf endif # # Build the slides with notes. # slides-notes: $(SLIDES_NOTES_PREREQS) slides-notes.pdf: $(SLIDES_IN).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) $(SLIDE_FILES) $(LATEXCMD) -jobname=slides-notes '\documentclass[$(LATEX_OPTS),notes=onlyslideswithnotes]{lectureslides}\input{$(SLIDES_IN)}' $(LATEXCMD) -jobname=slides-notes '\documentclass[$(LATEX_OPTS),notes=onlyslideswithnotes]{lectureslides}\input{$(SLIDES_IN)}' # # Build the slides with notes, 6-up. # notes: $(NOTES_PREREQS) $(NOTES).pdf: $(NOTES_IN).tex slides-notes.pdf $(LATEXCMD) -jobname=$(NOTES) $< $(LATEXCMD) -jobname=$(NOTES) $< else notes slides-notes: $(call disabled_message,$@) endif ################################################################################ # # 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. If $(FIGURES) is empty, they are # omitted from the combined document. # ifeq ($(strip $(FIGURES)),) COMBINED_PREREQS:=$(COMBINED_IN).tex slides-combined.pdf else COMBINED_PREREQS:=$(COMBINED_IN).tex slides-combined.pdf $(FIGURES).pdf endif # # Build the slides for the combined document. # slides-combined: slides-combined.pdf slides-combined.pdf: $(SLIDES_IN).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) $(LATEXCMD) -jobname=slides-combined '\documentclass[$(LATEX_OPTS),handout]{lectureslides}\input{$(SLIDES_IN)}' $(LATEXCMD) -jobname=slides-combined '\documentclass[$(LATEX_OPTS),handout]{lectureslides}\input{$(SLIDES_IN)}' # # Build the complete combined document. # combined: $(COMBINED).pdf $(COMBINED).pdf: $(COMBINED_PREREQS) $(COMBI_IMAGES) $(COMBI_FILES) $(LATEXCMD) -jobname=$(COMBINED) $< $(LATEXCMD) -jobname=$(COMBINED) $< else combined slides-combined: $(call disabled_message,$@) endif ################################################################################ # # Build the figures and examples document. If $(FIGURES) is empty, these # rules are ignored. # ifneq ($(strip $(FIGURES)),) figures: $(FIGURES).pdf $(FIGURES).pdf: $(FIGURES_IN).tex $(FIG_IMAGES) $(FIG_FILES) $(LATEXCMD) -jobname=$(FIGURES) $< $(LATEXCMD) -jobname=$(FIGURES) $< figures2up: $(FIGURES)-reduced.pdf $(FIGURES)-reduced.pdf: $(FIGURES).pdf $(PDFNUP) $< --nup 2x1 --outfile $@ else figures figures2up: $(call disabled_message,$@) endif ################################################################################ # # Build the test document. # test: test.pdf test.pdf: test.tex ################################################################################ # # Deploy the appropriate files into a shared folder, which is then synchronised # with Blackbaord. This relies on the environment variable HANDBOOK_INSTALL_ROOT # being defined, and (assuming that this variable points to a directory on the # network) the appropriate share has been mounted. # # See build_document_rules.make for an explanation of why the install # uses a foreach. # # Note that this won't do anything clever if you give it files that are # in subdirectories of the current directory. Everything will be flattened # at the other end. That is, something like "images/foo.pdf" will go into # the installation directory as "foo.pdf", not "images/foo.pdf". # # If the variable NOSYNC is set (to anything), then files won't be synchronised # with Blackboard. # install: ifndef NOSYNC @$(LOCKFILE) -r0 $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock && $(SITECOPY) --update --keep-going Blackboard$(PAPER_NUMBER) && $(RM) -f $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock @$(LOCKFILE) -r0 $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock && $(SITECOPY) --catchup Blackboard$(PAPER_NUMBER) && $(RM) -f $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock endif @$(ANNOUNCE) "Deploying files into $(INSTALL_DIRECTORY)" @$(TEST) -d $(HANDBOOK_INSTALL_ROOT) @$(MKDIR_P) $(INSTALL_DIRECTORY) @$(RSYNC) -rltgoDv $(INSTALL_FILES) $(INSTALL_DIRECTORY) ifndef NOSYNC @$(ANNOUNCE) "Synchronising with Blackboard" @$(LOCKFILE) -r0 $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock && $(SITECOPY) --update Blackboard$(PAPER_NUMBER) && $(RM) -f $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock endif ################################################################################ # # Debugging: print the values of the standard variables. # debug: @$(ANNOUNCE) Externally defined variables @$(ECHO) "ALL_PAPERS_ROOT = [$(ALL_PAPERS_ROOT)]" @$(ECHO) "TEACHING_SHARED = [$(TEACHING_SHARED)]" @$(ECHO) "HANDBOOK_INSTALL_ROOT = [$(HANDBOOK_INSTALL_ROOT)]" @$(ANNOUNCE) Internally defined variables @$(ECHO) "GLOBAL_HANDBOOK_INCLUDE = [$(GLOBAL_HANDBOOK_INCLUDE)]" @$(ECHO) "INSTALL_DIRECTORY = [$(INSTALL_DIRECTORY)]" @$(ECHO) "BUILD_DIR = [$(BUILD_DIR)]" @$(ECHO) "IMGDIR = [$(IMGDIR)]" @$(ECHO) "PAPER_INCLUDE_PATH = [$(PAPER_INCLUDE_PATH)]" @$(ECHO) "LATEX_INIT_FILE = [$(LATEX_INIT_FILE)]" @$(ECHO) "SUBJECT_CODE = [$(SUBJECT_CODE)]" @$(ECHO) "PAPER_NUMBER = [$(PAPER_NUMBER)]" @$(ECHO) "DOC_TYPE = [$(DOC_TYPE)]" @$(ECHO) "DOC_NUM = [$(DOC_NUM)]" @$(ECHO) "INSTALL_FILES = [$(INSTALL_FILES)]" @$(ECHO) "SLIDE_IMAGES = [$(SLIDE_IMAGES)]" @$(ECHO) "SLIDE_BACKGROUNDS = [$(SLIDE_BACKGROUNDS)]" @$(ECHO) "SLIDE_FILES = [$(SLIDE_FILES)]" @$(ECHO) "FIG_IMAGES = [$(FIG_IMAGES)]" @$(ECHO) "FIG_FILES = [$(FIG_FILES)]" @$(ECHO) "FIG_IMAGES = [$(FIG_IMAGES)]" @$(ECHO) "COMBI_IMAGES = [$(COMBI_IMAGES)]" @$(ECHO) "COMBI_FILES = [$(COMBI_FILES)]" @$(ECHO) "TIDY_FILES = [$(TIDY_FILES)]" @$(ECHO) "CLEAN_FILES = [$(CLEAN_FILES)]" @$(ECHO) "LATEXCMD = [$(LATEXCMD)]" @$(ECHO) "DRAFT = [$(DRAFT)]" @$(ECHO) "LATEX_OPTS = [$(LATEX_OPTS)]" @$(ECHO) "SLIDES_IN = [$(SLIDES_IN)]" @$(ECHO) "SLIDES = [$(SLIDES)]" @$(ECHO) "SLIDES_PREREQS = [$(SLIDES_PREREQS)]" @$(ECHO) "SLIDES_NOTES_PREREQS = [$(NOTES_PREREQS)]" @$(ECHO) "FIGURES_IN = [$(FIGURES_IN)]" @$(ECHO) "FIGURES = [$(FIGURES)]" @$(ECHO) "COMBINED_IN = [$(COMBINED_IN)]" @$(ECHO) "COMBINED = [$(COMBINED)]" @$(ECHO) "NOTES_IN = [$(NOTES_IN)]" @$(ECHO) "NOTES = [$(NOTES)]" @$(ECHO) "NOTES_PREREQS = [$(NOTES_PREREQS)]" @$(ECHO) "COMBINED_PREREQS = [$(COMBINED_PREREQS)]" @$(ECHO) "TARGETS = [$(TARGETS)]" ifdef TEMPDIR @$(ECHO) "TEMPDIR = [$(TEMPDIR)]" endif ################################################################################ # # Clean up: get rid of all the temporary files. # tidy: $(RM) -rf $(TIDY_FILES) # # Clean up: get rid of everything except the original source. # clean: tidy $(RM) -rf $(CLEAN_FILES) ################################################################################ # # List all "phony" build targets. # targets: @$(ECHO) "targets: $(TARGETS)" ################################################################################ # # Standard default rules. # include $(GLOBAL_HANDBOOK_INCLUDE)/standard_rules.make
################################################################################ # # Standard variables and rules for building a set of lecture files. # Altering these definitions will affect ALL LECTURE MAKEFILES FOR ALL # PAPERS!! If you need to do something specific for a particular paper, # include a custom rule in its makefile. DON'T add it here! # ################################################################################ ################################################################################ # # Add standard file suffixes. # include $(GLOBAL_HANDBOOK_INCLUDE)/standard_suffixes.make ################################################################################ # # Standard directories. # IMGDIR?=images ################################################################################ # # Standard paths. # include $(GLOBAL_HANDBOOK_INCLUDE)/standard_paths.make ################################################################################ # # Files to be cleaned by the various "clean" targets. Note that we don't # "tidy" .aux files because they may be needed by the xr package for inter- # document cross references, but won't get regenerated if the final target # PDF files exist. They will be caught by by the "clean" target though. # TIDY_FILES+=*.tmp *.out *.log *.nav *.toc *.snm *.head *.dvi *.vrb _minted* \ slides-combined.pdf slides-notes.pdf CLEAN_FILES+=*.aux *.pdf ################################################################################ # # Various environment variables. # # Important: default font size for Beamer is 11pt. We need to define this before # loading the standard environment. However, allow the user to override it! ifndef FONT_SIZE FONT_SIZE=11pt endif include $(GLOBAL_HANDBOOK_INCLUDE)/standard_environment.make # # Base file names for the various input and output documents. # SLIDES_IN?=$(DOC_TYPE)_slides FIGURES_IN?=$(DOC_TYPE)_figures COMBINED_IN?=$(DOC_TYPE)_combined NOTES_IN?=$(DOC_TYPE)_notes SLIDES?=$(DOC_TYPE)_$(DOC_NUM)_slides FIGURES?=$(DOC_TYPE)_$(DOC_NUM)_figures COMBINED?=$(DOC_TYPE)_$(DOC_NUM)_combined NOTES?=$(DOC_TYPE)_$(DOC_NUM)_notes # # Standard files to be installed on the web server. # ifneq ($(strip $(SLIDES)),) INSTALL_FILES+=$(SLIDES).pdf endif ifneq ($(strip $(FIGURES)),) INSTALL_FILES+=$(FIGURES).pdf $(FIGURES)-reduced.pdf endif ifneq ($(strip $(COMBINED)),) INSTALL_FILES+=$(COMBINED).pdf endif INSTALL_FILES+=$(wildcard *.mp3) # # List of standard "phony" build targets. # TARGETS+=slides notes slides-combined slides-notes figures figures2up combined # .PHONY: $(TARGETS) ################################################################################ # # Display a message if someone tries to build a target that has been # disabled (by setting the appropriate variable to empty in the makefile). # disabled_message=@$(ECHO) The \"$(1)\" target has been disabled for this $(DOC_TYPE). ################################################################################ # # Alternate LaTeXs for Unicode vs. non-Unicode processing. # ifdef UNICODE LATEXCMD:=$(XELATEX) $(LATEX_FLAGS) else LATEXCMD:=$(PDFLATEX) $(LATEX_FLAGS) endif ################################################################################ # # Build everything. # all: slides notes figures figures2up combined ################################################################################ # # 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. 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 else SLIDES_PREREQS:=figures $(SLIDES).pdf endif # # Build the slides for the presentation. # slides: $(SLIDES_PREREQS) $(SLIDES).pdf: $(SLIDES_IN).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) $(SLIDE_FILES) $(LATEXCMD) -jobname=$(SLIDES) '\documentclass[$(LATEX_OPTS)]{lectureslides}\input{$(SLIDES_IN)}' $(LATEXCMD) -jobname=$(SLIDES) '\documentclass[$(LATEX_OPTS)]{lectureslides}\input{$(SLIDES_IN)}' else slides: $(call disabled_message,$@) endif ################################################################################ # # Build the presentation notes. If $(NOTES) is empty, these rules are # ignored. # ifneq ($(strip $(NOTES)),) # # Set the prerequisites for the "slides-notes" build target, depending on # 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)),) NOTES_PREREQS:=$(NOTES).pdf SLIDES_NOTES_PREREQS:=slides-notes.pdf else NOTES_PREREQS:=figures $(NOTES).pdf SLIDES_NOTES_PREREQS:=figures slides-notes.pdf endif # # Build the slides with notes. # slides-notes: $(SLIDES_NOTES_PREREQS) slides-notes.pdf: $(SLIDES_IN).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) $(SLIDE_FILES) $(LATEXCMD) -jobname=slides-notes '\documentclass[$(LATEX_OPTS),notes=onlyslideswithnotes]{lectureslides}\input{$(SLIDES_IN)}' $(LATEXCMD) -jobname=slides-notes '\documentclass[$(LATEX_OPTS),notes=onlyslideswithnotes]{lectureslides}\input{$(SLIDES_IN)}' # # Build the slides with notes, 6-up. # notes: $(NOTES_PREREQS) $(NOTES).pdf: $(NOTES_IN).tex slides-notes.pdf $(LATEXCMD) -jobname=$(NOTES) $< $(LATEXCMD) -jobname=$(NOTES) $< else notes slides-notes: $(call disabled_message,$@) endif ################################################################################ # # 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. If $(FIGURES) is empty, they are # omitted from the combined document. # ifeq ($(strip $(FIGURES)),) COMBINED_PREREQS:=$(COMBINED_IN).tex slides-combined.pdf else COMBINED_PREREQS:=$(COMBINED_IN).tex slides-combined.pdf $(FIGURES).pdf endif # # Build the slides for the combined document. # slides-combined: slides-combined.pdf slides-combined.pdf: $(SLIDES_IN).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) $(LATEXCMD) -jobname=slides-combined '\documentclass[$(LATEX_OPTS),handout]{lectureslides}\input{$(SLIDES_IN)}' $(LATEXCMD) -jobname=slides-combined '\documentclass[$(LATEX_OPTS),handout]{lectureslides}\input{$(SLIDES_IN)}' # # Build the complete combined document. # combined: $(COMBINED).pdf $(COMBINED).pdf: $(COMBINED_PREREQS) $(COMBI_IMAGES) $(COMBI_FILES) $(LATEXCMD) -jobname=$(COMBINED) $< $(LATEXCMD) -jobname=$(COMBINED) $< else combined slides-combined: $(call disabled_message,$@) endif ################################################################################ # # Build the figures and examples document. If $(FIGURES) is empty, these # rules are ignored. # ifneq ($(strip $(FIGURES)),) figures: $(FIGURES).pdf $(FIGURES).pdf: $(FIGURES_IN).tex $(FIG_IMAGES) $(FIG_FILES) $(LATEXCMD) -jobname=$(FIGURES) $< $(LATEXCMD) -jobname=$(FIGURES) $< figures2up: $(FIGURES)-reduced.pdf $(FIGURES)-reduced.pdf: $(FIGURES).pdf $(PDFNUP) $< --nup 2x1 --outfile $@ else figures figures2up: $(call disabled_message,$@) endif ################################################################################ # # Build the test document. # test: test.pdf test.pdf: test.tex ################################################################################ # # Deploy the appropriate files into a shared folder, which is then synchronised # with Blackbaord. This relies on the environment variable HANDBOOK_INSTALL_ROOT # being defined, and (assuming that this variable points to a directory on the # network) the appropriate share has been mounted. # # See build_document_rules.make for an explanation of why the install # uses a foreach. # # Note that this won't do anything clever if you give it files that are # in subdirectories of the current directory. Everything will be flattened # at the other end. That is, something like "images/foo.pdf" will go into # the installation directory as "foo.pdf", not "images/foo.pdf". # # If the variable NOSYNC is set (to anything), then files won't be synchronised # with Blackboard. # install: ifndef NOSYNC @$(LOCKFILE) -r0 $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock && $(SITECOPY) --update --keep-going Blackboard$(PAPER_NUMBER) && $(RM) -f $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock @$(LOCKFILE) -r0 $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock && $(SITECOPY) --catchup Blackboard$(PAPER_NUMBER) && $(RM) -f $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock endif @$(ANNOUNCE) "Deploying files into $(INSTALL_DIRECTORY)" @$(TEST) -d $(HANDBOOK_INSTALL_ROOT) @$(MKDIR_P) $(INSTALL_DIRECTORY) @$(RSYNC) -rltgoDv $(INSTALL_FILES) $(INSTALL_DIRECTORY) ifndef NOSYNC @$(ANNOUNCE) "Synchronising with Blackboard" @$(LOCKFILE) -r0 $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock && $(SITECOPY) --update Blackboard$(PAPER_NUMBER) && $(RM) -f $(HOME)/.sitecopy/Blackboard$(PAPER_NUMBER).lock endif ################################################################################ # # Debugging: print the values of the standard variables. # debug: @$(ANNOUNCE) Externally defined variables @$(ECHO) "ALL_PAPERS_ROOT = [$(ALL_PAPERS_ROOT)]" @$(ECHO) "TEACHING_SHARED = [$(TEACHING_SHARED)]" @$(ECHO) "HANDBOOK_INSTALL_ROOT = [$(HANDBOOK_INSTALL_ROOT)]" @$(ANNOUNCE) Internally defined variables @$(ECHO) "GLOBAL_HANDBOOK_INCLUDE = [$(GLOBAL_HANDBOOK_INCLUDE)]" @$(ECHO) "INSTALL_DIRECTORY = [$(INSTALL_DIRECTORY)]" @$(ECHO) "BUILD_DIR = [$(BUILD_DIR)]" @$(ECHO) "IMGDIR = [$(IMGDIR)]" @$(ECHO) "PAPER_INCLUDE_PATH = [$(PAPER_INCLUDE_PATH)]" @$(ECHO) "LATEX_INIT_FILE = [$(LATEX_INIT_FILE)]" @$(ECHO) "SUBJECT_CODE = [$(SUBJECT_CODE)]" @$(ECHO) "PAPER_NUMBER = [$(PAPER_NUMBER)]" @$(ECHO) "DOC_TYPE = [$(DOC_TYPE)]" @$(ECHO) "DOC_NUM = [$(DOC_NUM)]" @$(ECHO) "INSTALL_FILES = [$(INSTALL_FILES)]" @$(ECHO) "SLIDE_IMAGES = [$(SLIDE_IMAGES)]" @$(ECHO) "SLIDE_BACKGROUNDS = [$(SLIDE_BACKGROUNDS)]" @$(ECHO) "SLIDE_FILES = [$(SLIDE_FILES)]" @$(ECHO) "FIG_IMAGES = [$(FIG_IMAGES)]" @$(ECHO) "FIG_FILES = [$(FIG_FILES)]" @$(ECHO) "FIG_IMAGES = [$(FIG_IMAGES)]" @$(ECHO) "COMBI_IMAGES = [$(COMBI_IMAGES)]" @$(ECHO) "COMBI_FILES = [$(COMBI_FILES)]" @$(ECHO) "TIDY_FILES = [$(TIDY_FILES)]" @$(ECHO) "CLEAN_FILES = [$(CLEAN_FILES)]" @$(ECHO) "LATEXCMD = [$(LATEXCMD)]" @$(ECHO) "DRAFT = [$(DRAFT)]" @$(ECHO) "LATEX_OPTS = [$(LATEX_OPTS)]" @$(ECHO) "SLIDES_IN = [$(SLIDES_IN)]" @$(ECHO) "SLIDES = [$(SLIDES)]" @$(ECHO) "SLIDES_PREREQS = [$(SLIDES_PREREQS)]" @$(ECHO) "SLIDES_NOTES_PREREQS = [$(NOTES_PREREQS)]" @$(ECHO) "FIGURES_IN = [$(FIGURES_IN)]" @$(ECHO) "FIGURES = [$(FIGURES)]" @$(ECHO) "COMBINED_IN = [$(COMBINED_IN)]" @$(ECHO) "COMBINED = [$(COMBINED)]" @$(ECHO) "NOTES_IN = [$(NOTES_IN)]" @$(ECHO) "NOTES = [$(NOTES)]" @$(ECHO) "NOTES_PREREQS = [$(NOTES_PREREQS)]" @$(ECHO) "COMBINED_PREREQS = [$(COMBINED_PREREQS)]" @$(ECHO) "TARGETS = [$(TARGETS)]" ifdef TEMPDIR @$(ECHO) "TEMPDIR = [$(TEMPDIR)]" endif ################################################################################ # # Clean up: get rid of all the temporary files. # tidy: $(RM) -rf $(TIDY_FILES) # # Clean up: get rid of everything except the original source. # clean: tidy $(RM) -rf $(CLEAN_FILES) ################################################################################ # # List all "phony" build targets. # targets: @$(ECHO) "targets: $(TARGETS)" ################################################################################ # # Standard default rules. # include $(GLOBAL_HANDBOOK_INCLUDE)/standard_rules.make
Ignore Space
Show notes
View
makefile-templates/Makefile.lecture
################################################################################ # # Template makefile for building a set of lecture files. # ################################################################################ SHELL=/bin/sh ################################################################################ # # Get path to current Makefile so we can set up self-deleting temporary # directory. Note that this MUST happen before the first include! # MAKEFILE:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) ################################################################################ # # Required Environment Variables # # TEACHING_SHARED # This variable specifies the path to the top level of the teaching # shared directory hierarchy (e.g., /path/to/Teaching/Shared). # TEACHING_SHARED?=$(error The required environment variable TEACHING_SHARED has not been defined. It should point to the root level of the shared teaching directory (e.g., /path/to/Teaching/Shared)) # # HANDBOOK_INSTALL_ROOT # This variable specifies the path to the top level directory on the web # server, under which the files for this paper will be installed (that is, # the directory that contains the individual paper directory hierarchies). # For example, \\INFO-NTS-12\DBCourses$ (this may require munging). # HANDBOOK_INSTALL_ROOT?=$(error The required environment variable HANDBOOK_INSTALL_ROOT has not been defined. It should point to the root level of the directory hierarchy on the web server (e.g., \\INFO-NTS-12\DBCourses$)) ################################################################################ # # Set up paths to makefile include directories. # # GLOBAL_HANDBOOK_INCLUDE is the global include directory in the "Shared" # hierarchy, and is defined relative to the root of that hierarchy. # GLOBAL_HANDBOOK_INCLUDE?=$(TEACHING_SHARED)/Authoring/Handbook/make-includes ################################################################################ # # Include local system-specific configuration. # include $(GLOBAL_HANDBOOK_INCLUDE)/local_configuration.make ################################################################################ # # Set up global, self-deleting temporary directory. The first time through, # TEMPDIR will be undefined, so the first part of the if will create the # variable, then recursively call the makefile again with the appropriate # targets, passing the temporary directory as an argument. # ifndef TEMPDIR .PHONY: all all: @TEMPDIR=$(shell $(MKTEMP) -d); \ trap 'rm -rf "$$TEMPDIR"' EXIT; \ $(MAKE) -f $(MAKEFILE) --no-print-directory TEMPDIR=$$TEMPDIR all %: @TEMPDIR=$(shell $(MKTEMP) -d); \ trap 'rm -rf "$$TEMPDIR"' EXIT; \ $(MAKE) -f $(MAKEFILE) --no-print-directory TEMPDIR=$$TEMPDIR $@ ################################################################################ # # Normal makefile follows. # else ################################################################################ # # Clear out the suffixes list. DO NOT ALTER THIS LINE! # .SUFFIXES: # # Add any custom suffixes here (uncomment the line below). # The "standard" suffixes list currently includes: # .svg .pdf .tex .dvi .png .tif .plo .jpg .pict .eps .ps .R .xml .pu .ipu # # .SUFFIXES: ################################################################################ # # Define paths for various items here. The "standard" paths currently include: # # vpath %.pdf $(IMGDIR) # vpath %.png $(IMGDIR) # vpath %.tif $(IMGDIR) # vpath %.jpg $(IMGDIR) # vpath %.plo $(IMGDIR) # vpath %.ps $(IMGDIR) # vpath %.eps $(IMGDIR) # vpath %.svg $(IMGDIR) # vpath %.pict $(IMGDIR) # # There's nothing to stop you adding new paths for these file types. # # vpath foo bar ################################################################################ # # Specify the current lecture or chapter number. THIS MUST BE DEFINED! # Set it to whatever you like if you don't use it (see below). # DOC_NUM?=$(error The required variable DOC_NUM has not been defined. Please set it to the correct chapter or lecture number as appropriate) # # The document type is prepended onto the output filenames (e.g., "lecture_12_slides.pdf"). # DOC_TYPE=lecture ################################################################################ # # Specify the subject code and paper number. THESE MUST BE DEFINED! # SUBJECT_CODE?=$(error The required variable SUBJECT_CODE has not been defined. Please set it to the correct subject code for this set of lectures) PAPER_NUMBER?=$(error The required variable PAPER_NUMBER has not been defined. Please set it to the correct paper number for this set of lectures) ################################################################################ # # Directory to install files into on web server. This is .../Lectures/name of # build directory, to avoid similarly-named files overwriting each other. # BUILD_DIR:=$(lastword $(subst /, ,$(CURDIR))) INSTALL_DIRECTORY:=$(HANDBOOK_INSTALL_ROOT)/$(SUBJECT_CODE)$(PAPER_NUMBER)/Lectures/$(BUILD_DIR) ################################################################################ # # Uncomment any of the following to prevent a particular document from # being built. This is necessary if, for example, the current set of # lectures has no figures and examples. # # Alternatively, you can use this to set the base name of the output # files if this is a one-off lecture that doesn't fall into the standard # lecture or chapter conventions, or you don't want to include the document # number in the filenames. (Set DOC_NUM above to whatever you like if you don't # use it.) # # You can also alter the base name of the input file for each document by # setting SLIDES_IN, etc. (These default to $(DOC_TYPE)_slides, etc.) # # SLIDES= # FIGURES= # COMBINED= # NOTES= ################################################################################ # # Standard file list variables. # # List of images used in the presentation as actual content. # SLIDE_IMAGES= # # List of other files used in the presentation as actual content. # We assume that shared infrastructure files are in the parent directory; # modify as necessary. # SLIDE_FILES=../../paper_init.tex ../lecturedates.tex doc_init.tex # # 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= # # List of other files used in the figures and examples document. # FIG_FILES=../../paper_init.tex ../lecturedates.tex doc_init.tex # # List of images used in the combined lecture material document. # COMBI_IMAGES= # # List of other files used in the combined lecture material document. # COMBI_FILES=../../paper_init.tex ../lecturedates.tex doc_init.tex # # List of files other than the standard ones (slides, figures, combined) # to be installed on the web server. By default, install the following # files: $(SLIDES).pdf, $(COMBINED).pdf, $(FIGURES).pdf, # $(FIGURES)-reduced.pdf. This can include files in subdirectories # (e.g., foo/bar.pdf), but the subdirectories themselves will not be # created at the other end (i.e., the directory structure will be # flattened). # INSTALL_FILES= # # Files to be cleaned by the various "clean" targets. The "standard" values # are currently: # TIDY_FILES+=*.tmp *.out *.log *.nav *.toc *.snm *.head *.dvi *.vrb _minted* \ # slides-combined.pdf slides-notes.pdf # CLEAN_FILES=*.aux *.pdf # # $(TIDY_FILES) is a list of generated intermediate files to clean up. # TIDY_FILES= # # $(CLEAN_FILES) is everything else that might need to be cleaned up. # CLEAN_FILES= ################################################################################ # # Specify LaTeX document options. Uncomment DRAFT to set draft mode in LaTeX. # Set the values of FONT_SIZE and PAPER_SIZE to appropriate LaTeX values if # you want something other than the defaults (12pt, a4paper). Use LATEX_OPTS # (comma-separated list) for any document class options that you want to set # /other than/ draft, font size and paper size. # # DRAFT=draft # FONT_SIZE= # PAPER_SIZE= LATEX_OPTS= # # Additional command line flags for the LaTeX command. # The "standard" list is currently: # -shell-escape -interaction=nonstopmode -halt-on-error -file-line-error # LATEX_FLAGS= # # List of "phony" build targets (remember to define rules for # them!). The "standard" list is currently: # all slides notes slides-combined slides-notes figures combined # debug test clean tidy targets # TARGETS= # # Uncomment the following to enable Unicode mode. This forces use of XHTML, # Xe(La)TeX, etc. The value of the variable is irrelevant, it just need to be # defined. # # UNICODE=on ################################################################################ # # Add custom variables below here as necessary. # ################################################################################ # # Include standard variables and rules for building lectures. # include $(GLOBAL_HANDBOOK_INCLUDE)/build_lecture_rules.make ################################################################################ # # Add custom rules below here as necessary, BEFORE the endif. # endif
################################################################################ # # Template makefile for building a set of lecture files. # ################################################################################ SHELL=/bin/sh ################################################################################ # # Get path to current Makefile so we can set up self-deleting temporary # directory. Note that this MUST happen before the first include! # MAKEFILE:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) ################################################################################ # # Required Environment Variables # # TEACHING_SHARED # This variable specifies the path to the top level of the teaching # shared directory hierarchy (e.g., /path/to/Teaching/Shared). # TEACHING_SHARED?=$(error The required environment variable TEACHING_SHARED has not been defined. It should point to the root level of the shared teaching directory (e.g., /path/to/Teaching/Shared)) # # HANDBOOK_INSTALL_ROOT # This variable specifies the path to the top level directory on the web # server, under which the files for this paper will be installed (that is, # the directory that contains the individual paper directory hierarchies). # For example, \\INFO-NTS-12\DBCourses$ (this may require munging). # HANDBOOK_INSTALL_ROOT?=$(error The required environment variable HANDBOOK_INSTALL_ROOT has not been defined. It should point to the root level of the directory hierarchy on the web server (e.g., \\INFO-NTS-12\DBCourses$)) ################################################################################ # # Set up paths to makefile include directories. # # GLOBAL_HANDBOOK_INCLUDE is the global include directory in the "Shared" # hierarchy, and is defined relative to the root of that hierarchy. # GLOBAL_HANDBOOK_INCLUDE?=$(TEACHING_SHARED)/Authoring/Handbook/make-includes ################################################################################ # # Include local system-specific configuration. # include $(GLOBAL_HANDBOOK_INCLUDE)/local_configuration.make ################################################################################ # # Set up global, self-deleting temporary directory. The first time through, # TEMPDIR will be undefined, so the first part of the if will create the # variable, then recursively call the makefile again with the appropriate # targets, passing the temporary directory as an argument. # ifndef TEMPDIR .PHONY: all all: @TEMPDIR=$(shell $(MKTEMP) -d); \ trap 'rm -rf "$$TEMPDIR"' EXIT; \ $(MAKE) -f $(MAKEFILE) --no-print-directory TEMPDIR=$$TEMPDIR all %: @TEMPDIR=$(shell $(MKTEMP) -d); \ trap 'rm -rf "$$TEMPDIR"' EXIT; \ $(MAKE) -f $(MAKEFILE) --no-print-directory TEMPDIR=$$TEMPDIR $@ ################################################################################ # # Normal makefile follows. # else ################################################################################ # # Clear out the suffixes list. DO NOT ALTER THIS LINE! # .SUFFIXES: # # Add any custom suffixes here (uncomment the line below). # The "standard" suffixes list currently includes: # .svg .pdf .tex .dvi .png .tif .plo .jpg .pict .eps .ps .R .xml .pu .ipu # # .SUFFIXES: ################################################################################ # # Define paths for various items here. The "standard" paths currently include: # # vpath %.pdf $(IMGDIR) # vpath %.png $(IMGDIR) # vpath %.tif $(IMGDIR) # vpath %.jpg $(IMGDIR) # vpath %.plo $(IMGDIR) # vpath %.ps $(IMGDIR) # vpath %.eps $(IMGDIR) # vpath %.svg $(IMGDIR) # vpath %.pict $(IMGDIR) # # There's nothing to stop you adding new paths for these file types. # # vpath foo bar ################################################################################ # # Specify the current lecture or chapter number. THIS MUST BE DEFINED! # Set it to whatever you like if you don't use it (see below). # DOC_NUM?=$(error The required variable DOC_NUM has not been defined. Please set it to the correct chapter or lecture number as appropriate) # # The document type is prepended onto the output filenames (e.g., "lecture_12_slides.pdf"). # DOC_TYPE=lecture ################################################################################ # # Specify the subject code and paper number. THESE MUST BE DEFINED! # SUBJECT_CODE?=$(error The required variable SUBJECT_CODE has not been defined. Please set it to the correct subject code for this set of lectures) PAPER_NUMBER?=$(error The required variable PAPER_NUMBER has not been defined. Please set it to the correct paper number for this set of lectures) ################################################################################ # # Directory to install files into on web server. This is .../Lectures/name of # build directory, to avoid similarly-named files overwriting each other. # BUILD_DIR:=$(lastword $(subst /, ,$(CURDIR))) INSTALL_DIRECTORY:=$(HANDBOOK_INSTALL_ROOT)/$(SUBJECT_CODE)$(PAPER_NUMBER)/Lectures/$(BUILD_DIR) ################################################################################ # # Uncomment any of the following to prevent a particular document from # being built. This is necessary if, for example, the current set of # lectures has no figures and examples. # # Alternatively, you can use this to set the base name of the output # files if this is a one-off lecture that doesn't fall into the standard # lecture or chapter conventions, or you don't want to include the document # number in the filenames. (Set DOC_NUM above to whatever you like if you don't # use it.) # # You can also alter the base name of the input file for each document by # setting SLIDES_IN, etc. (These default to $(DOC_TYPE)_slides, etc.) # # SLIDES= # FIGURES= # COMBINED= # NOTES= ################################################################################ # # Standard file list variables. # # List of images used in the presentation as actual content. # SLIDE_IMAGES= # # List of other files used in the presentation as actual content. # We assume that shared infrastructure files are in the parent directory; # modify as necessary. # SLIDE_FILES=../../paper_init.tex ../lecturedates.tex doc_init.tex # # 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= # # List of other files used in the figures and examples document. # FIG_FILES=../../paper_init.tex ../lecturedates.tex doc_init.tex # # List of images used in the combined lecture material document. # COMBI_IMAGES= # # List of other files used in the combined lecture material document. # COMBI_FILES=../../paper_init.tex ../lecturedates.tex doc_init.tex # # List of files other than the standard ones (slides, figures, combined) # to be installed on the web server. By default, install the following # files: $(SLIDES).pdf, $(COMBINED).pdf, $(FIGURES).pdf, # $(FIGURES)-reduced.pdf. This can include files in subdirectories # (e.g., foo/bar.pdf), but the subdirectories themselves will not be # created at the other end (i.e., the directory structure will be # flattened). # INSTALL_FILES= # # Files to be cleaned by the various "clean" targets. The "standard" values # are currently: # TIDY_FILES+=*.tmp *.out *.log *.nav *.toc *.snm *.head *.dvi *.vrb _minted* \ # slides-combined.pdf slides-notes.pdf # CLEAN_FILES=*.aux *.pdf # # $(TIDY_FILES) is a list of generated intermediate files to clean up. # TIDY_FILES= # # $(CLEAN_FILES) is everything else that might need to be cleaned up. # CLEAN_FILES= ################################################################################ # # Specify LaTeX document options. Uncomment DRAFT to set draft mode in LaTeX. # Set the values of FONT_SIZE and PAPER_SIZE to appropriate LaTeX values if # you want something other than the defaults (12pt, a4paper). Use LATEX_OPTS # (comma-separated list) for any document class options that you want to set # /other than/ draft, font size and paper size. # # DRAFT=draft # FONT_SIZE= # PAPER_SIZE= LATEX_OPTS= # # Additional command line flags for the LaTeX command, e.g., add -shell-escape # if you're using something like minted that needs it. # LATEX_FLAGS= # # List of "phony" build targets (remember to define rules for # them!). The "standard" list is currently: # all slides notes slides-combined slides-notes figures combined # debug test clean tidy targets # TARGETS= # # Uncomment the following to enable Unicode mode. This forces use of XHTML, # Xe(La)TeX, etc. The value of the variable is irrelevant, it just need to be # defined. # # UNICODE=on ################################################################################ # # Add custom variables below here as necessary. # ################################################################################ # # Include standard variables and rules for building lectures. # include $(GLOBAL_HANDBOOK_INCLUDE)/build_lecture_rules.make ################################################################################ # # Add custom rules below here as necessary, BEFORE the endif. # endif
Show line notes below