diff --git a/make-includes/build_section_rules.make b/make-includes/build_section_rules.make index a2e6767..2144292 100755 --- a/make-includes/build_section_rules.make +++ b/make-includes/build_section_rules.make @@ -24,7 +24,23 @@ # everything will still work as expected. # ifndef NOINIT + include $(GLOBAL_HANDBOOK_INCLUDE)/remove_content_marker_files.make + +# +# Ensure that the patterns files exist. If they don't, copy the originals +# across from the shared directory and abort the run so that the user can +# edit them appropriately. +# +CHECK_ANSWERS_PATTERNS:=$(shell (test -f $(LOCAL_HANDBOOK_INCLUDE)/answers.patterns) || (cp $(TEACHING_SHARED)/Authoring/Handbook/makefile-templates/answers.patterns $(LOCAL_HANDBOOK_INCLUDE); echo "answers")) +CHECK_QUESTIONS_PATTERNS:=$(shell (test -f $(LOCAL_HANDBOOK_INCLUDE)/questions.patterns) || (cp $(TEACHING_SHARED)/Authoring/Handbook/makefile-templates/questions.patterns $(LOCAL_HANDBOOK_INCLUDE); echo "questions")) +CHECK_INSTALL_PATTERNS:=$(shell (test -f $(LOCAL_HANDBOOK_INCLUDE)/install.patterns) || (cp $(TEACHING_SHARED)/Authoring/Handbook/makefile-templates/install.patterns $(LOCAL_HANDBOOK_INCLUDE); echo "install")) +CHECK_ALL_PATTERNS:=$(CHECK_ANSWERS_PATTERNS) $(CHECK_QUESTIONS_PATTERNS) $(CHECK_INSTALL_PATTERNS) + +ifneq "$(strip $(CHECK_ALL_PATTERNS))" "" +$(error Patterns files have been restored from defaults ($(CHECK_ALL_PATTERNS)), please check them before continuing) +endif + endif # Now that the one-time initialsation is out of the way, ensure that