diff --git a/make-includes/build_lecture_rules.make b/make-includes/build_lecture_rules.make index 7981c96..b2fd757 100755 --- a/make-includes/build_lecture_rules.make +++ b/make-includes/build_lecture_rules.make @@ -73,10 +73,22 @@ COMBINED?=Chapter$(CHAPTER)combined NOTES?=Chapter$(CHAPTER)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 +# # List of standard "phony" build targets. # TARGETS+=all slides notes slides-combined slides-notes figures figures2up \ - combined debug test clean tidy targets + combined debug test clean tidy install targets # .PHONY: $(TARGETS) @@ -243,14 +255,41 @@ ################################################################################ # +# Install the appropriate files on the web server. This relies on the +# environment variable HANDBOOK_INSTALL_DIRECTORY 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". +# +install: + @announce "Copying files to web server --- make sure that you have the share mounted!" + @test -d $(HANDBOOK_INSTALL_ROOT) + @mkdir -p $(INSTALL_DIRECTORY) + @$(foreach f,$(INSTALL_FILES),if test ! -f $(INSTALL_DIRECTORY)/$(f) -o $(f) -nt $(INSTALL_DIRECTORY)/$(f); then echo "Installing $(f)"; cp $(f) $(INSTALL_DIRECTORY); fi;) + + +################################################################################ +# # Debugging: print the values of the standard variables. # debug: @announce Externally defined variables @echo "TEACHING_SHARED = [$(TEACHING_SHARED)]" + @echo "HANDBOOK_INSTALL_ROOT = [$(HANDBOOK_INSTALL_ROOT)]" @echo "CHAPTER = [$(CHAPTER)]" @announce Internally defined variables + @echo "SUBJECT_CODE = [$(SUBJECT_CODE)]" + @echo "PAPER_NUMBER = [$(PAPER_NUMBER)]" @echo "GLOBAL_HANDBOOK_INCLUDE = [$(GLOBAL_HANDBOOK_INCLUDE)]" + @echo "INSTALL_DIRECTORY = [$(INSTALL_DIRECTORY)]" + @echo "INSTALL_FILES = [$(INSTALL_FILES)]" @echo "SLIDE_IMAGES = [$(SLIDE_IMAGES)]" @echo "SLIDE_BACKGROUNDS = [$(SLIDE_BACKGROUNDS)]" @echo "SLIDE_FILES = [$(SLIDE_FILES)]"