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
Added synctex output to TIDY_FILES
master
1 parent
847c070
commit
45e80c491fc9f2172a797f53b004041247ac6287
Nigel Stanger
authored
on 20 Mar 2020
Patch
Showing
2 changed files
make-includes/build_lecture_rules.make
make-includes/build_misc_rules.make
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 *.synctex.gz 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+=-synctex=1 -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)}' $(LN_S) -f $@ $(SLIDES_IN).pdf 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) $< $(LN_S) -f $@ $(NOTES_IN).pdf 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) $< $(LN_S) -f $@ $(COMBINED_IN).pdf 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) $< $(LN_S) -f $@ $(FIGURES_IN).pdf 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). ################################################################################ # # Default LaTeX command-line options. # * -shell-escape for use with minted (and other things) # * others to aid debugging # # LATEX_FLAGS+=-synctex=1 -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)}' $(LN_S) -f $@ $(SLIDES_IN).pdf 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) $< $(LN_S) -f $@ $(NOTES_IN).pdf 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) $< $(LN_S) -f $@ $(COMBINED_IN).pdf 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) $< $(LN_S) -f $@ $(FIGURES_IN).pdf 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
make-includes/build_misc_rules.make
################################################################################ # # Standard variables and rules for building a general standalone document # that doesn't fall into any partcular category (such as lecture, tutorial). # The makefile assumes a single document source file. Anything more # complex than this will need to be handled by a custom makefile. # # Altering these definitions will affect ALL 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! # ################################################################################ ################################################################################ # # Include XSLT functions. # include $(TEACHING_SHARED)/Authoring/Handbook/make-includes/xslt_functions.make ################################################################################ # # Required make variables. These should be defined by the calling makefile. # # BASE_NAMES # The base name(s) of the document source file(s). It may be a list, which # enables multiple different documents to be built by the one Makefile. # BASE_NAMES?=$(error The required make variable BASE_NAMES has not been defined. Please set it to the base name(s) of the document source file(s)) ################################################################################ # # Set up the context for the current document. # # SOURCE_XML is the original source XML, from which DERIVED_XML is # generated (the derived source has the includes for questions, etc., # inserted). # SOURCE_XML:=$(foreach n,$(BASE_NAMES),$(n).xml) DERIVED_XML:=$(SOURCE_XML:.xml=-derived.xml) # # Define the names of the output files. # ifdef HAS_ANSWERS WEB_QUESTIONS_HTML:=$(SOURCE_XML:.xml=-questions.html) WEB_ANSWERS_HTML:=$(SOURCE_XML:.xml=-answers.html) PRINT_QUESTIONS_TEX:=$(WEB_QUESTIONS_HTML:.html=.tex) PRINT_ANSWERS_TEX:=$(WEB_ANSWERS_HTML:.html=.tex) PRINT_QUESTIONS_PDF_1UP:=$(PRINT_QUESTIONS_TEX:.tex=.pdf) PRINT_ANSWERS_PDF_1UP:=$(PRINT_ANSWERS_TEX:.tex=.pdf) PRINT_QUESTIONS_PDF_2UP:=$(PRINT_QUESTIONS_TEX:.tex=-2up.pdf) PRINT_ANSWERS_PDF_2UP:=$(PRINT_ANSWERS_TEX:.tex=-2up.pdf) else WEB_HTML:=$(SOURCE_XML:.xml=.html) PRINT_TEX:=$(SOURCE_XML:.xml=.tex) PRINT_PDF_1UP:=$(SOURCE_XML:.xml=.pdf) PRINT_PDF_2UP:=$(SOURCE_XML:.xml=-2up.pdf) endif # # List of XSL stylesheets. If any of these change, we need to rebuild # everything. # # We can't use the resolver approach under Windows because of the DOS # pathnames. The style sheets come out of the resolver with paths like # C:\bar\foo\..., and make interprets the colon as an extra dependency # delimiter (tested and behaviour verified). Of course, this works fine on # any platform with sensible path standards. Quoting the value doesn't # help, unfortunately. Bugger :( # #XSLT_STYLESHEETS:=$(shell $(JAVA) org.apache.xml.resolver.apps.resolver -u file:///xml2html.xsl uri | ( $(GREP) 'Result: file:' || $(ECHO) '::xml2html.xsl' ) | $(CUT) -d':' -f3-) $(shell $(JAVA) org.apache.xml.resolver.apps.resolver -u file:///xml2latex.xsl uri | ( $(GREP) 'Result: file:' || $(ECHO) '::xml2latex.xsl' ) | $(CUT) -d':' -f3-) XSLT_STYLESHEETS:=$(TEACHING_SHARED)/Authoring/XML/xml2html.xsl $(TEACHING_SHARED)/Authoring/XML/xml2xhtml.xsl $(TEACHING_SHARED)/Authoring/XML/xml2latex.xsl $(TEACHING_SHARED)/Authoring/XML/xml2xelatex.xsl ################################################################################ # # 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 installed on web server. # ifdef HAS_ANSWERS QUESTION_INSTALL_FILES:=$(WEB_QUESTIONS_HTML) $(PRINT_QUESTIONS_PDF_1UP) \ $(PRINT_QUESTIONS_PDF_2UP) ANSWER_INSTALL_FILES:=$(WEB_ANSWERS_HTML) $(PRINT_ANSWERS_PDF_1UP) \ $(PRINT_ANSWERS_PDF_2UP) else INSTALL_FILES:=$(WEB_HTML) $(PRINT_PDF_1UP) $(PRINT_PDF_2UP) endif ################################################################################ # # 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* \ *-derived.xml *.synctex.gz CLEAN_FILES+=*.aux $(IMGDIR)/*-print.pdf $(IMGDIR)/*-print.png \ $(IMGDIR)/*-web.png $(IMGDIR)/*-web-zoom.png ifdef HAS_ANSWERS TIDY_FILES+=$(PRINT_QUESTIONS_TEX) $(PRINT_ANSWERS_TEX) CLEAN_FILES+=$(WEB_QUESTIONS_HTML) $(WEB_ANSWERS_HTML) \ $(PRINT_QUESTIONS_PDF_1UP) $(PRINT_ANSWERS_PDF_1UP) \ $(PRINT_QUESTIONS_PDF_2UP) $(PRINT_ANSWERS_PDF_2UP) else TIDY_FILES+=$(PRINT_TEX) CLEAN_FILES+=$(WEB_HTML) $(PRINT_PDF_1UP) $(PRINT_PDF_2UP) endif ################################################################################ # # Various environment variables. # include $(GLOBAL_HANDBOOK_INCLUDE)/standard_environment.make # # List of standard "phony" build targets. Varies depending on whether # answers are enabled. # TARGETS+=web print $(BASE_NAMES) ifdef HAS_ANSWERS TARGETS+=web-questions web-answers \ print-questions print-answers \ questions answers endif # .PHONY: $(TARGETS) ################################################################################ # # Build everything. # all: web print ################################################################################ # # Build questions or answers only. # ifdef HAS_ANSWERS questions: web-questions print-questions answers: web-answers print-answers endif ################################################################################ # # Build web version only. # ifdef HAS_ANSWERS web: web-questions web-answers web-questions: $(WEB_QUESTIONS_HTML) $(WEB_IMAGES) $(WEB_FILES) $(WEB_QUESTIONS_HTML): %-questions.html: %-derived.xml ifdef UNICODE $(call xslt,$<,xml2xhtml.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'no') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'png')) > $@ else $(call xslt,$<,xml2html.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'no') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'png')) > $@ endif web-answers: $(WEB_ANSWERS_HTML) $(WEB_IMAGES) $(WEB_FILES) $(WEB_ANSWERS_HTML): %-answers.html: %-derived.xml ifdef UNICODE $(call xslt,$<,xml2xhtml.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'yes') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'png')) > $@ else $(call xslt,$<,xml2html.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'yes') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'png')) > $@ endif else web: $(WEB_HTML) $(WEB_IMAGES) $(WEB_FILES) endif ################################################################################ # # Build print version only. # ifdef HAS_ANSWERS print: print-questions print-answers print-questions: $(PRINT_QUESTIONS_PDF_1UP) $(PRINT_QUESTIONS_PDF_2UP) $(PRINT_QUESTIONS_PDF_1UP): $(PRINT_IMAGES) $(PRINT_FILES) $(PRINT_QUESTIONS_TEX): %-questions.tex: %-derived.xml ifdef UNICODE $(call xslt,$<,xml2xelatex.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'no') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'pdf') $(call xslt_parameter,paper-include-path,'$(PAPER_INCLUDE_PATH)') $(call xslt_parameter,latex-initialisation-file,'$(LATEX_INIT_FILE)')) > $@ else $(call xslt,$<,xml2latex.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'no') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'pdf') $(call xslt_parameter,paper-include-path,'$(PAPER_INCLUDE_PATH)') $(call xslt_parameter,latex-initialisation-file,'$(LATEX_INIT_FILE)')) > $@ endif print-answers: $(PRINT_ANSWERS_PDF_1UP) $(PRINT_ANSWERS_PDF_2UP) $(PRINT_ANSWERS_PDF_1UP): $(PRINT_IMAGES) $(PRINT_FILES) $(PRINT_ANSWERS_TEX): %-answers.tex: %-derived.xml ifdef UNICODE $(call xslt,$<,xml2xelatex.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'yes') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'pdf') $(call xslt_parameter,paper-include-path,'$(PAPER_INCLUDE_PATH)') $(call xslt_parameter,latex-initialisation-file,'$(LATEX_INIT_FILE)')) > $@ else $(call xslt,$<,xml2latex.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'yes') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'pdf') $(call xslt_parameter,paper-include-path,'$(PAPER_INCLUDE_PATH)') $(call xslt_parameter,latex-initialisation-file,'$(LATEX_INIT_FILE)')) > $@ endif else print: $(PRINT_PDF_1UP) $(PRINT_PDF_2UP) $(PRINT_PDF_1UP): $(PRINT_IMAGES) $(PRINT_FILES) endif ################################################################################ # # Generate the derived XML source from the original XML template. # This is done by simply running the original source through xmllint # with the --xinclude option to process all the xi:include elements. # The result of this could have just been piped into the XSLT processor, # except that (a) not all of the processors support input from stdin, # and (b) combining both xmllint and XSLT processing into one command # means that make won't stop if there's any errors from xmllint. # # Sed is used to add a comment to the derived XML file, warning that this # is generated and shouldn't be edited. Sed was used because the <?xml?> # processing instruction MUST be on the first line. The implication here # is that all input source files have an <?xml?> processing instruction # (which they should anyway). # $(DERIVED_XML): %-derived.xml: %.xml $(XSLT_STYLESHEETS) $(XMLLINT) --xinclude $< >$@ @$(SED) -i -e '1a <!-- THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT! -->' $@ ################################################################################ # # Build the test document. # test: test.pdf test.pdf: test.tex ################################################################################ # # Deploy the appropriate files into a shared folder, which is then synchronised # with Blackboard. 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. # ifndef HAS_ANSWERS install: all 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) @if $(TEST) -n "$(WEB_IMAGES)"; then $(MKDIR_P) $(INSTALL_DIRECTORY)/$(IMGDIR); fi # Note: no -p because we're writing to an SMB volume that doesn't accept Unix-style permissions (implies no -a). @$(RSYNC) -rltgoDv $(INSTALL_FILES) $(INSTALL_DIRECTORY) @$(RSYNC) -rltgoDv --ignore-missing-args $(foreach i,$(WEB_IMAGES),$(IMGDIR)/$(i)) $(INSTALL_DIRECTORY)/$(IMGDIR) 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 install-questions: install install-answers: else install: install-questions install-answers install-questions: 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 questions into $(INSTALL_DIRECTORY)" @$(TEST) -d $(HANDBOOK_INSTALL_ROOT) @$(MKDIR_P) $(INSTALL_DIRECTORY) @if $(TEST) -n "$(WEB_IMAGES)"; then $(MKDIR_P) $(INSTALL_DIRECTORY)/$(IMGDIR); fi # Note: no -p because we're writing to an SMB volume that doesn't accept Unix-style permissions (implies no -a). @$(RSYNC) -rltgoDv $(QUESTION_INSTALL_FILES) $(INSTALL_DIRECTORY) @$(RSYNC) -rltgoDv --ignore-missing-args $(foreach i,$(WEB_IMAGES),$(IMGDIR)/$(i)) $(INSTALL_DIRECTORY)/$(IMGDIR) 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 install-answers: 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 answers into $(INSTALL_DIRECTORY)" @$(TEST) -d $(HANDBOOK_INSTALL_ROOT) @$(MKDIR_P) $(INSTALL_DIRECTORY) @if $(TEST) -n "$(WEB_IMAGES)"; then $(MKDIR_P) $(INSTALL_DIRECTORY)/$(IMGDIR); fi # Note: no -p because we're writing to an SMB volume that doesn't accept Unix-style permissions (implies no -a). @$(RSYNC) -rltgoDv $(ANSWER_INSTALL_FILES) $(INSTALL_DIRECTORY) @$(RSYNC) -rltgoDv --ignore-missing-args $(foreach i,$(WEB_IMAGES),$(IMGDIR)/$(i)) $(INSTALL_DIRECTORY)/$(IMGDIR) 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 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) "PAPER_INCLUDE_PATH = [$(PAPER_INCLUDE_PATH)]" @$(ECHO) "INSTALL_DIRECTORY = [$(INSTALL_DIRECTORY)]" @$(ECHO) "BUILD_DIR = [$(BUILD_DIR)]" @$(ECHO) "IMGDIR = [$(IMGDIR)]" @$(ECHO) "LATEX_INIT_FILE = [$(LATEX_INIT_FILE)]" @$(ECHO) "BASE_NAMES = [$(BASE_NAMES)]" @$(ECHO) "SOURCE_XML = [$(SOURCE_XML)]" @$(ECHO) "DERIVED_XML = [$(DERIVED_XML)]" @$(ECHO) "SUBJECT_CODE = [$(SUBJECT_CODE)]" @$(ECHO) "PAPER_NUMBER = [$(PAPER_NUMBER)]" @$(ECHO) "PAPER_YEAR = [$(PAPER_YEAR)]" @$(ECHO) "PAPER_PERIOD = [$(PAPER_PERIOD)]" @$(ECHO) "HAS_ANSWERS = [$(HAS_ANSWERS)]" ifdef HAS_ANSWERS @$(ECHO) "WEB_QUESTIONS_HTML = [$(WEB_QUESTIONS_HTML)]" @$(ECHO) "WEB_ANSWERS_HTML = [$(WEB_ANSWERS_HTML)]" @$(ECHO) "PRINT_QUESTIONS_TEX = [$(PRINT_QUESTIONS_TEX)]" @$(ECHO) "PRINT_ANSWERS_TEX = [$(PRINT_ANSWERS_TEX)]" @$(ECHO) "PRINT_QUESTIONS_PDF_1UP = [$(PRINT_QUESTIONS_PDF_1UP)]" @$(ECHO) "PRINT_ANSWERS_PDF_1UP = [$(PRINT_ANSWERS_PDF_1UP)]" @$(ECHO) "PRINT_QUESTIONS_PDF_2UP = [$(PRINT_QUESTIONS_PDF_2UP)]" @$(ECHO) "PRINT_ANSWERS_PDF_2UP = [$(PRINT_ANSWERS_PDF_2UP)]" @$(ECHO) "QUESTION_INSTALL_FILES = [$(QUESTION_INSTALL_FILES)]" @$(ECHO) "ANSWER_INSTALL_FILES = [$(ANSWER_INSTALL_FILES)]" else @$(ECHO) "WEB_HTML = [$(WEB_HTML)]" @$(ECHO) "PRINT_TEX = [$(PRINT_TEX)]" @$(ECHO) "PRINT_PDF_1UP = [$(PRINT_PDF_1UP)]" @$(ECHO) "PRINT_PDF_2UP = [$(PRINT_PDF_2UP)]" @$(ECHO) "INSTALL_FILES = [$(INSTALL_FILES)]" endif @$(ECHO) "XSLT_STYLESHEETS = [$(XSLT_STYLESHEETS)]" @$(ECHO) "PRINT_IMAGES = [$(PRINT_IMAGES)]" @$(ECHO) "PRINT_FILES = [$(PRINT_FILES)]" @$(ECHO) "WEB_IMAGES = [$(WEB_IMAGES)]" @$(ECHO) "WEB_FILES = [$(WEB_FILES)]" @$(ECHO) "TIDY_FILES = [$(TIDY_FILES)]" @$(ECHO) "CLEAN_FILES = [$(CLEAN_FILES)]" @$(ECHO) "DRAFT = [$(DRAFT)]" @$(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 general standalone document # that doesn't fall into any partcular category (such as lecture, tutorial). # The makefile assumes a single document source file. Anything more # complex than this will need to be handled by a custom makefile. # # Altering these definitions will affect ALL 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! # ################################################################################ ################################################################################ # # Include XSLT functions. # include $(TEACHING_SHARED)/Authoring/Handbook/make-includes/xslt_functions.make ################################################################################ # # Required make variables. These should be defined by the calling makefile. # # BASE_NAMES # The base name(s) of the document source file(s). It may be a list, which # enables multiple different documents to be built by the one Makefile. # BASE_NAMES?=$(error The required make variable BASE_NAMES has not been defined. Please set it to the base name(s) of the document source file(s)) ################################################################################ # # Set up the context for the current document. # # SOURCE_XML is the original source XML, from which DERIVED_XML is # generated (the derived source has the includes for questions, etc., # inserted). # SOURCE_XML:=$(foreach n,$(BASE_NAMES),$(n).xml) DERIVED_XML:=$(SOURCE_XML:.xml=-derived.xml) # # Define the names of the output files. # ifdef HAS_ANSWERS WEB_QUESTIONS_HTML:=$(SOURCE_XML:.xml=-questions.html) WEB_ANSWERS_HTML:=$(SOURCE_XML:.xml=-answers.html) PRINT_QUESTIONS_TEX:=$(WEB_QUESTIONS_HTML:.html=.tex) PRINT_ANSWERS_TEX:=$(WEB_ANSWERS_HTML:.html=.tex) PRINT_QUESTIONS_PDF_1UP:=$(PRINT_QUESTIONS_TEX:.tex=.pdf) PRINT_ANSWERS_PDF_1UP:=$(PRINT_ANSWERS_TEX:.tex=.pdf) PRINT_QUESTIONS_PDF_2UP:=$(PRINT_QUESTIONS_TEX:.tex=-2up.pdf) PRINT_ANSWERS_PDF_2UP:=$(PRINT_ANSWERS_TEX:.tex=-2up.pdf) else WEB_HTML:=$(SOURCE_XML:.xml=.html) PRINT_TEX:=$(SOURCE_XML:.xml=.tex) PRINT_PDF_1UP:=$(SOURCE_XML:.xml=.pdf) PRINT_PDF_2UP:=$(SOURCE_XML:.xml=-2up.pdf) endif # # List of XSL stylesheets. If any of these change, we need to rebuild # everything. # # We can't use the resolver approach under Windows because of the DOS # pathnames. The style sheets come out of the resolver with paths like # C:\bar\foo\..., and make interprets the colon as an extra dependency # delimiter (tested and behaviour verified). Of course, this works fine on # any platform with sensible path standards. Quoting the value doesn't # help, unfortunately. Bugger :( # #XSLT_STYLESHEETS:=$(shell $(JAVA) org.apache.xml.resolver.apps.resolver -u file:///xml2html.xsl uri | ( $(GREP) 'Result: file:' || $(ECHO) '::xml2html.xsl' ) | $(CUT) -d':' -f3-) $(shell $(JAVA) org.apache.xml.resolver.apps.resolver -u file:///xml2latex.xsl uri | ( $(GREP) 'Result: file:' || $(ECHO) '::xml2latex.xsl' ) | $(CUT) -d':' -f3-) XSLT_STYLESHEETS:=$(TEACHING_SHARED)/Authoring/XML/xml2html.xsl $(TEACHING_SHARED)/Authoring/XML/xml2xhtml.xsl $(TEACHING_SHARED)/Authoring/XML/xml2latex.xsl $(TEACHING_SHARED)/Authoring/XML/xml2xelatex.xsl ################################################################################ # # 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 installed on web server. # ifdef HAS_ANSWERS QUESTION_INSTALL_FILES:=$(WEB_QUESTIONS_HTML) $(PRINT_QUESTIONS_PDF_1UP) \ $(PRINT_QUESTIONS_PDF_2UP) ANSWER_INSTALL_FILES:=$(WEB_ANSWERS_HTML) $(PRINT_ANSWERS_PDF_1UP) \ $(PRINT_ANSWERS_PDF_2UP) else INSTALL_FILES:=$(WEB_HTML) $(PRINT_PDF_1UP) $(PRINT_PDF_2UP) endif ################################################################################ # # 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* \ *-derived.xml CLEAN_FILES+=*.aux $(IMGDIR)/*-print.pdf $(IMGDIR)/*-print.png \ $(IMGDIR)/*-web.png $(IMGDIR)/*-web-zoom.png ifdef HAS_ANSWERS TIDY_FILES+=$(PRINT_QUESTIONS_TEX) $(PRINT_ANSWERS_TEX) CLEAN_FILES+=$(WEB_QUESTIONS_HTML) $(WEB_ANSWERS_HTML) \ $(PRINT_QUESTIONS_PDF_1UP) $(PRINT_ANSWERS_PDF_1UP) \ $(PRINT_QUESTIONS_PDF_2UP) $(PRINT_ANSWERS_PDF_2UP) else TIDY_FILES+=$(PRINT_TEX) CLEAN_FILES+=$(WEB_HTML) $(PRINT_PDF_1UP) $(PRINT_PDF_2UP) endif ################################################################################ # # Various environment variables. # include $(GLOBAL_HANDBOOK_INCLUDE)/standard_environment.make # # List of standard "phony" build targets. Varies depending on whether # answers are enabled. # TARGETS+=web print $(BASE_NAMES) ifdef HAS_ANSWERS TARGETS+=web-questions web-answers \ print-questions print-answers \ questions answers endif # .PHONY: $(TARGETS) ################################################################################ # # Build everything. # all: web print ################################################################################ # # Build questions or answers only. # ifdef HAS_ANSWERS questions: web-questions print-questions answers: web-answers print-answers endif ################################################################################ # # Build web version only. # ifdef HAS_ANSWERS web: web-questions web-answers web-questions: $(WEB_QUESTIONS_HTML) $(WEB_IMAGES) $(WEB_FILES) $(WEB_QUESTIONS_HTML): %-questions.html: %-derived.xml ifdef UNICODE $(call xslt,$<,xml2xhtml.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'no') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'png')) > $@ else $(call xslt,$<,xml2html.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'no') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'png')) > $@ endif web-answers: $(WEB_ANSWERS_HTML) $(WEB_IMAGES) $(WEB_FILES) $(WEB_ANSWERS_HTML): %-answers.html: %-derived.xml ifdef UNICODE $(call xslt,$<,xml2xhtml.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'yes') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'png')) > $@ else $(call xslt,$<,xml2html.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'yes') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'png')) > $@ endif else web: $(WEB_HTML) $(WEB_IMAGES) $(WEB_FILES) endif ################################################################################ # # Build print version only. # ifdef HAS_ANSWERS print: print-questions print-answers print-questions: $(PRINT_QUESTIONS_PDF_1UP) $(PRINT_QUESTIONS_PDF_2UP) $(PRINT_QUESTIONS_PDF_1UP): $(PRINT_IMAGES) $(PRINT_FILES) $(PRINT_QUESTIONS_TEX): %-questions.tex: %-derived.xml ifdef UNICODE $(call xslt,$<,xml2xelatex.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'no') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'pdf') $(call xslt_parameter,paper-include-path,'$(PAPER_INCLUDE_PATH)') $(call xslt_parameter,latex-initialisation-file,'$(LATEX_INIT_FILE)')) > $@ else $(call xslt,$<,xml2latex.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'no') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'pdf') $(call xslt_parameter,paper-include-path,'$(PAPER_INCLUDE_PATH)') $(call xslt_parameter,latex-initialisation-file,'$(LATEX_INIT_FILE)')) > $@ endif print-answers: $(PRINT_ANSWERS_PDF_1UP) $(PRINT_ANSWERS_PDF_2UP) $(PRINT_ANSWERS_PDF_1UP): $(PRINT_IMAGES) $(PRINT_FILES) $(PRINT_ANSWERS_TEX): %-answers.tex: %-derived.xml ifdef UNICODE $(call xslt,$<,xml2xelatex.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'yes') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'pdf') $(call xslt_parameter,paper-include-path,'$(PAPER_INCLUDE_PATH)') $(call xslt_parameter,latex-initialisation-file,'$(LATEX_INIT_FILE)')) > $@ else $(call xslt,$<,xml2latex.xsl,$(call xslt_parameter,subject-code,'$(SUBJECT_CODE)') $(call xslt_parameter,paper-number,'$(PAPER_NUMBER)') $(call xslt_parameter,paper-year,'$(PAPER_YEAR)') $(call xslt_parameter,period-code,'$(PAPER_PERIOD)') $(call xslt_parameter,standalone,'yes') $(call xslt_parameter,showanswers,'yes') $(call xslt_parameter,base-path,'.') $(call xslt_parameter,image-format,'pdf') $(call xslt_parameter,paper-include-path,'$(PAPER_INCLUDE_PATH)') $(call xslt_parameter,latex-initialisation-file,'$(LATEX_INIT_FILE)')) > $@ endif else print: $(PRINT_PDF_1UP) $(PRINT_PDF_2UP) $(PRINT_PDF_1UP): $(PRINT_IMAGES) $(PRINT_FILES) endif ################################################################################ # # Generate the derived XML source from the original XML template. # This is done by simply running the original source through xmllint # with the --xinclude option to process all the xi:include elements. # The result of this could have just been piped into the XSLT processor, # except that (a) not all of the processors support input from stdin, # and (b) combining both xmllint and XSLT processing into one command # means that make won't stop if there's any errors from xmllint. # # Sed is used to add a comment to the derived XML file, warning that this # is generated and shouldn't be edited. Sed was used because the <?xml?> # processing instruction MUST be on the first line. The implication here # is that all input source files have an <?xml?> processing instruction # (which they should anyway). # $(DERIVED_XML): %-derived.xml: %.xml $(XSLT_STYLESHEETS) $(XMLLINT) --xinclude $< >$@ @$(SED) -i -e '1a <!-- THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT! -->' $@ ################################################################################ # # Build the test document. # test: test.pdf test.pdf: test.tex ################################################################################ # # Deploy the appropriate files into a shared folder, which is then synchronised # with Blackboard. 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. # ifndef HAS_ANSWERS install: all 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) @if $(TEST) -n "$(WEB_IMAGES)"; then $(MKDIR_P) $(INSTALL_DIRECTORY)/$(IMGDIR); fi # Note: no -p because we're writing to an SMB volume that doesn't accept Unix-style permissions (implies no -a). @$(RSYNC) -rltgoDv $(INSTALL_FILES) $(INSTALL_DIRECTORY) @$(RSYNC) -rltgoDv --ignore-missing-args $(foreach i,$(WEB_IMAGES),$(IMGDIR)/$(i)) $(INSTALL_DIRECTORY)/$(IMGDIR) 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 install-questions: install install-answers: else install: install-questions install-answers install-questions: 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 questions into $(INSTALL_DIRECTORY)" @$(TEST) -d $(HANDBOOK_INSTALL_ROOT) @$(MKDIR_P) $(INSTALL_DIRECTORY) @if $(TEST) -n "$(WEB_IMAGES)"; then $(MKDIR_P) $(INSTALL_DIRECTORY)/$(IMGDIR); fi # Note: no -p because we're writing to an SMB volume that doesn't accept Unix-style permissions (implies no -a). @$(RSYNC) -rltgoDv $(QUESTION_INSTALL_FILES) $(INSTALL_DIRECTORY) @$(RSYNC) -rltgoDv --ignore-missing-args $(foreach i,$(WEB_IMAGES),$(IMGDIR)/$(i)) $(INSTALL_DIRECTORY)/$(IMGDIR) 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 install-answers: 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 answers into $(INSTALL_DIRECTORY)" @$(TEST) -d $(HANDBOOK_INSTALL_ROOT) @$(MKDIR_P) $(INSTALL_DIRECTORY) @if $(TEST) -n "$(WEB_IMAGES)"; then $(MKDIR_P) $(INSTALL_DIRECTORY)/$(IMGDIR); fi # Note: no -p because we're writing to an SMB volume that doesn't accept Unix-style permissions (implies no -a). @$(RSYNC) -rltgoDv $(ANSWER_INSTALL_FILES) $(INSTALL_DIRECTORY) @$(RSYNC) -rltgoDv --ignore-missing-args $(foreach i,$(WEB_IMAGES),$(IMGDIR)/$(i)) $(INSTALL_DIRECTORY)/$(IMGDIR) 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 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) "PAPER_INCLUDE_PATH = [$(PAPER_INCLUDE_PATH)]" @$(ECHO) "INSTALL_DIRECTORY = [$(INSTALL_DIRECTORY)]" @$(ECHO) "BUILD_DIR = [$(BUILD_DIR)]" @$(ECHO) "IMGDIR = [$(IMGDIR)]" @$(ECHO) "LATEX_INIT_FILE = [$(LATEX_INIT_FILE)]" @$(ECHO) "BASE_NAMES = [$(BASE_NAMES)]" @$(ECHO) "SOURCE_XML = [$(SOURCE_XML)]" @$(ECHO) "DERIVED_XML = [$(DERIVED_XML)]" @$(ECHO) "SUBJECT_CODE = [$(SUBJECT_CODE)]" @$(ECHO) "PAPER_NUMBER = [$(PAPER_NUMBER)]" @$(ECHO) "PAPER_YEAR = [$(PAPER_YEAR)]" @$(ECHO) "PAPER_PERIOD = [$(PAPER_PERIOD)]" @$(ECHO) "HAS_ANSWERS = [$(HAS_ANSWERS)]" ifdef HAS_ANSWERS @$(ECHO) "WEB_QUESTIONS_HTML = [$(WEB_QUESTIONS_HTML)]" @$(ECHO) "WEB_ANSWERS_HTML = [$(WEB_ANSWERS_HTML)]" @$(ECHO) "PRINT_QUESTIONS_TEX = [$(PRINT_QUESTIONS_TEX)]" @$(ECHO) "PRINT_ANSWERS_TEX = [$(PRINT_ANSWERS_TEX)]" @$(ECHO) "PRINT_QUESTIONS_PDF_1UP = [$(PRINT_QUESTIONS_PDF_1UP)]" @$(ECHO) "PRINT_ANSWERS_PDF_1UP = [$(PRINT_ANSWERS_PDF_1UP)]" @$(ECHO) "PRINT_QUESTIONS_PDF_2UP = [$(PRINT_QUESTIONS_PDF_2UP)]" @$(ECHO) "PRINT_ANSWERS_PDF_2UP = [$(PRINT_ANSWERS_PDF_2UP)]" @$(ECHO) "QUESTION_INSTALL_FILES = [$(QUESTION_INSTALL_FILES)]" @$(ECHO) "ANSWER_INSTALL_FILES = [$(ANSWER_INSTALL_FILES)]" else @$(ECHO) "WEB_HTML = [$(WEB_HTML)]" @$(ECHO) "PRINT_TEX = [$(PRINT_TEX)]" @$(ECHO) "PRINT_PDF_1UP = [$(PRINT_PDF_1UP)]" @$(ECHO) "PRINT_PDF_2UP = [$(PRINT_PDF_2UP)]" @$(ECHO) "INSTALL_FILES = [$(INSTALL_FILES)]" endif @$(ECHO) "XSLT_STYLESHEETS = [$(XSLT_STYLESHEETS)]" @$(ECHO) "PRINT_IMAGES = [$(PRINT_IMAGES)]" @$(ECHO) "PRINT_FILES = [$(PRINT_FILES)]" @$(ECHO) "WEB_IMAGES = [$(WEB_IMAGES)]" @$(ECHO) "WEB_FILES = [$(WEB_FILES)]" @$(ECHO) "TIDY_FILES = [$(TIDY_FILES)]" @$(ECHO) "CLEAN_FILES = [$(CLEAN_FILES)]" @$(ECHO) "DRAFT = [$(DRAFT)]" @$(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
Show line notes below