diff --git a/make-includes/build_document_rules.make b/make-includes/build_document_rules.make index d677c7c..e6eb5b6 100755 --- a/make-includes/build_document_rules.make +++ b/make-includes/build_document_rules.make @@ -155,7 +155,7 @@ # # Directory to install files into on web server. # -INSTALL_DIRECTORY:=$(HANDBOOK_INSTALL_ROOT)/$(SUBJECT_CODE)$(PAPER_NUMBER)/Blackboard/$(SECTION)/$(BASE_NAME) +INSTALL_DIRECTORY:=$(HANDBOOK_INSTALL_ROOT)/$(SUBJECT_CODE)$(PAPER_NUMBER)/$(SECTION)/$(BASE_NAME) ################################################################################ @@ -222,13 +222,13 @@ $(WEB_QUESTIONS_HTML): $(DERIVED_XML) @$(ANNOUNCE) "Building $@ from $<" - $(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,paper-period,'$(PAPER_PERIOD)'),$(call xslt_parameter,standalone,'no'),$(call xslt_parameter,showanswers,'no'),$(call xslt_parameter,base-path,'.'),$(call xslt_parameter,image-format,'png')) > $@ + $(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,'no'),$(call xslt_parameter,showanswers,'no'),$(call xslt_parameter,base-path,'.'),$(call xslt_parameter,image-format,'png')) > $@ web-answers: content $(WEB_ANSWERS_HTML) $(WEB_ANSWERS_HTML): $(DERIVED_XML) @$(ANNOUNCE) "Building $@ from $<" - $(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,paper-period,'$(PAPER_PERIOD)'),$(call xslt_parameter,standalone,'no'),$(call xslt_parameter,showanswers,'yes'),$(call xslt_parameter,base-path,'.'),$(call xslt_parameter,image-format,'png')) > $@ + $(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,'no'),$(call xslt_parameter,showanswers,'yes'),$(call xslt_parameter,base-path,'.'),$(call xslt_parameter,image-format,'png')) > $@ ################################################################################ @@ -246,7 +246,7 @@ $(PRINT_QUESTIONS_TEX): $(DERIVED_XML) @$(ANNOUNCE) "Building $@ from $<" @$(ECHO) "\\markfirstpage{$(SECTION)/$(BASE_NAME)/$(@:.tex=.pdf)}" > $@ - $(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,paper-period,'$(PAPER_PERIOD)'),$(call xslt_parameter,standalone,'no'),$(call xslt_parameter,showanswers,'no'),$(call xslt_parameter,base-path,'sections/$(SECTION)/$(BASE_NAME)'),$(call xslt_parameter,image-format,'pdf')) >> $@ + $(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,'no'),$(call xslt_parameter,showanswers,'no'),$(call xslt_parameter,base-path,'sections/$(SECTION)/$(BASE_NAME)'),$(call xslt_parameter,image-format,'pdf')) >> $@ @$(ECHO) "\\marklastpage{$(SECTION)/$(BASE_NAME)/$(@:.tex=.pdf)}" >> $@ %-questions.pdf: %-questions.tex @@ -268,7 +268,7 @@ $(PRINT_ANSWERS_TEX): $(DERIVED_XML) @$(ANNOUNCE) "Building $@ from $<" @$(ECHO) "\\markfirstpage{$(SECTION)/$(BASE_NAME)/$(@:.tex=.pdf)}" > $@ - $(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,paper-period,'$(PAPER_PERIOD)'),$(call xslt_parameter,standalone,'no'),$(call xslt_parameter,showanswers,'yes'),$(call xslt_parameter,base-path,'sections/$(SECTION)/$(BASE_NAME)'),$(call xslt_parameter,image-format,'pdf')) >> $@ + $(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,'no'),$(call xslt_parameter,showanswers,'yes'),$(call xslt_parameter,base-path,'sections/$(SECTION)/$(BASE_NAME)'),$(call xslt_parameter,image-format,'pdf')) >> $@ @$(ECHO) "\\marklastpage{$(SECTION)/$(BASE_NAME)/$(@:.tex=.pdf)}" >> $@ %-answers.pdf: %-answers.tex @@ -390,13 +390,14 @@ ################################################################################ # -# Link the appropriate files to the deployment directory. This relies on the -# environment variable HANDBOOK_INSTALL_DIRECTORY being defined, and -# and that it points to a valid directory. +# 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. # -# This links each file in the build directory into the install directory. -# There's no need to check modification dates, etc., because all of the links -# in the install directory are deleted first anyway. +# This checks each file in the build directory against the corresponding +# file in the install directory. The local file is only copied to the +# install directory if it is newer, or the remote file doesn't exist. # # I was going to do the testing using a target rule that dealt with # each file individually, but for some weird reason it would ignore any @@ -410,12 +411,12 @@ install-questions: questions @$(TEST) -d $(HANDBOOK_INSTALL_ROOT) @$(MKDIR_P) $(INSTALL_DIRECTORY) - @$(foreach f,$(QUESTION_INSTALL_FILES),if $(TEST) -f $(CURDIR)/$(f); then $(ECHO) "Linking $(f)"; $(LN_S) -f $(CURDIR)/$(f) $(INSTALL_DIRECTORY); fi;) + @$(foreach f,$(QUESTION_INSTALL_FILES),if $(TEST) ! -f $(INSTALL_DIRECTORY)/$(f) -o $(f) -nt $(INSTALL_DIRECTORY)/$(f); then $(ECHO) "Deploying $(f)"; $(CP) $(f) $(INSTALL_DIRECTORY); fi;) install-answers: answers @$(TEST) -d $(HANDBOOK_INSTALL_ROOT) @$(MKDIR_P) $(INSTALL_DIRECTORY) - @$(foreach f,$(ANSWER_INSTALL_FILES),if $(TEST) -f $(CURDIR)/$(f); then $(ECHO) "Linking $(f)"; $(LN_S) -f $(CURDIR)/$(f) $(INSTALL_DIRECTORY); fi;) + @$(foreach f,$(ANSWER_INSTALL_FILES),if $(TEST) ! -f $(INSTALL_DIRECTORY)/$(f) -o $(f) -nt $(INSTALL_DIRECTORY)/$(f); then $(ECHO) "Deploying $(f)"; $(CP) $(f) $(INSTALL_DIRECTORY); fi;) ################################################################################