diff --git a/makefile-templates/Makefile.handbook b/makefile-templates/Makefile.handbook index ba44db6..e1505d5 100755 --- a/makefile-templates/Makefile.handbook +++ b/makefile-templates/Makefile.handbook @@ -80,7 +80,7 @@ # be listed in the order that they will appear in the handbook. Remember to # exclude CVS directories (doh!). # -SECTION_DIRS:=$(shell find Sections -type d -not -name CVS -mindepth 1 -maxdepth 1) +SECTION_DIRS:=$(shell find sections -type d -not -name CVS -mindepth 1 -maxdepth 1) ################################################################################ @@ -197,8 +197,7 @@ handbook.tex: handbook_template.tex $(QUESTION_TEX_INPUTS) $(LOCAL_HANDBOOK_INCLUDE)/questions.patterns $(LATEX_INCLUDES) @announce "Generating $@" @perl -p -e "s|\<\@SHOWANSWERS\@\>||;" \ - -e "s|\<\@INCLUDELABS\@\>|\\\\input{$(basename $(filter Sections/Labs/%,$(QUESTION_TEX_INPUTS)))}|;" \ - -e "s|\<\@INCLUDETUTS\@\>|\\\\input{$(basename $(filter Sections/Tutorials/%,$(QUESTION_TEX_INPUTS)))}|;" $< > $@ + $(foreach sect,$(SECTION_DIRS),-e "s|\<\@SECTION\[$(notdir $(sect))\]\@\>|\\\\input{$(basename $(filter $(sect)/%,$(QUESTION_TEX_INPUTS)))}|;") $< > $@ question-pdfs: @$(foreach d,$(SECTION_DIRS),$(MAKE) -C $d question-pdfs NOINIT=x SECTION=$(notdir $(d));) @@ -214,8 +213,7 @@ handbook-answers.tex: handbook_template.tex $(ANSWER_TEX_INPUTS) $(LOCAL_HANDBOOK_INCLUDE)/answers.patterns $(LATEX_INCLUDES) @announce "Generating $@" @perl -p -e "s|\<\@SHOWANSWERS\@\>|\\\\showanswers|;" \ - -e "s|\<\@INCLUDELABS\@\>|\\\\input{$(basename $(filter Sections/Labs/%,$(ANSWER_TEX_INPUTS)))}|;" \ - -e "s|\<\@INCLUDETUTS\@\>|\\\\input{$(basename $(filter Sections/Tutorials/%,$(ANSWER_TEX_INPUTS)))}|;" $< > $@ + $(foreach sect,$(SECTION_DIRS),-e "s|\<\@SECTION\[$(notdir $(sect))\]\@\>|\\\\input{$(basename $(filter $(sect)/%,$(QUESTION_TEX_INPUTS)))}|;") $< > $@ answer-pdfs: @$(foreach d,$(SECTION_DIRS),$(MAKE) -C $d answer-pdfs NOINIT=x SECTION=$(notdir $(d));) @@ -251,10 +249,12 @@ # (assuming that this variable points to a directory on the network) the # appropriate share has been mounted. # -install: +install: $(INSTALL_FILES) @announce "Copying files to web server --- make sure that you have the share mounted!" @test -d $(HANDBOOK_INSTALL_ROOT) +ifneq ($(strip $(SECTION_DIRS)),) @$(foreach d,$(SECTION_DIRS),$(MAKE) -C $d install NOINIT=x SECTION=$(notdir $(d));) +endif ifneq ($(strip $(INSTALL_FILES)),) @announce "Installing miscellaneous handbook files" cp $(INSTALL_FILES) $(INSTALL_DIRECTORY)