From 126c3f1befd3f7fd5ff595ed7697e0efc933d8ee Mon Sep 17 00:00:00 2001 From: John Mandereau Date: Sun, 9 Nov 2008 14:10:51 +0100 Subject: [PATCH] Allow and make effective -j option in "make web" - forbid simultaneous lilypond-book running instances in make/ly-rules.make by adding a dependency chain of .texi output files; - add $(src-dir) to Texi2HTML include path, so it finds macros.itexi; - replace documentation PO phony target with a dummy target (to prevent it from being excessively rebuilt), and make it a prerequisite for tely->texi rules instead of tely source files (to make sure it is actually built); - remove superfluous $(outdir)/version.itexi prerequisites in WWW-2; - update documentation on documentation building. --- Documentation/user/GNUmakefile | 8 +++----- Documentation/user/install.itely | 22 +++++++++++++++------- make/doc-i18n-user-rules.make | 20 ++++++++------------ make/doc-i18n-user-targets.make | 7 +++---- make/doc-i18n-user-vars.make | 2 ++ make/ly-rules.make | 13 +++++++++++-- make/ly-vars.make | 2 ++ scm/documentation-generate.scm | 2 +- stepmake/stepmake/texinfo-rules.make | 6 +++--- 9 files changed, 48 insertions(+), 34 deletions(-) diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index eacbf70f24..656526318a 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -14,12 +14,10 @@ OUT_PDF_IMAGES=$(IMAGES:%.png=$(outdir)/%.pdf) $(addprefix $(outdir)/,$(PDF_ILLU OUT_PNG_IMAGES=$(OUT_PDF_IMAGES:%.pdf=%.png) +OUT_MASTER_TEXI_FILES = $(outdir)/lilypond-internals.texi OUT_TEXI_FILES=$(ITEXI_FILES:%.itexi=$(outdir)/%.texi)\ $(ITELY_FILES:%.itely=$(outdir)/%.texi) -MASTER_TEXI_FILES = $(TELY_FILES:%.tely=$(outdir)/%.texi)\ - $(outdir)/lilypond-internals.texi - HTML_FILES = $(TELY_FILES:%.tely=$(outdir)/%-big-page.html)\ $(outdir)/lilypond-internals-big-page.html @@ -31,6 +29,8 @@ MAIN_INFO_DOC = lilypond INFO_DOCS = lilypond lilypond-internals music-glossary lilypond-program lilypond-learning INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info) +TEXI2PDF_FLAGS = -I $(top-src-dir)/Documentation/user + ifeq ($(out),www) INFO_IMAGES_DIR = lilypond DEST_INFO_IMAGES_SUBDIR = Documentation/user @@ -63,8 +63,6 @@ extra-local-help: xml update Docbook xml documentation\n\ " -$(outdir)/lilypond.texi: $(outdir)/lilypond-internals.texi - # # Split manuals in HTML # diff --git a/Documentation/user/install.itely b/Documentation/user/install.itely index e203291674..cb16e07e05 100644 --- a/Documentation/user/install.itely +++ b/Documentation/user/install.itely @@ -359,17 +359,25 @@ less verbose build output, just like for building the programs. @knownissues -@code{-j} command-line option of @command{make} is unsupported for -building the documentation. As the most time consuming task is -running LilyPond to build images of music, the makefile variable -@code{CPU_COUNT} may be set in @file{local.make} or on the command line -to the number of @code{.ly} files that LilyPond should process -simultaneously, e.g. on a bi-processor or dual core machine +The most time consuming task for building the documentation is running +LilyPond to build images of music, and there cannot be several +simultaneously running @command{lilypond-book} instances, so @code{-j} +@command{make} option does not significantly speed up the build process. +To help speed it up, the makefile variable @var{CPU_COUNT} may be set +in @file{local.make} or on the command line to the number of +@code{.ly} files that LilyPond should process simultaneously, e.g. on +a bi-processor or dual core machine @example -make CPU_COUNT=2 web +make -j3 CPU_COUNT=3 web @end example +@noindent +The recommended value of @var{CPU_COUNT} is one plus the number of +cores or processors, but it is advisable to set it to a smaller value +if your system has not enough RAM to run that many simultaneous +LilyPond instances. + If source files have changed since last documentation build, output files that need to be rebuilt are normally rebuilt, even if you do not run @code{make web-clean} first. However, building dependencies in the diff --git a/make/doc-i18n-user-rules.make b/make/doc-i18n-user-rules.make index 41a05390bc..9734641f23 100644 --- a/make/doc-i18n-user-rules.make +++ b/make/doc-i18n-user-rules.make @@ -1,25 +1,25 @@ ifeq (,$(findstring texi2html,$(MISSING_OPTIONAL))) -$(outdir)/%/index.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map $(OUT_PNG_IMAGES) $(outdir)/version.itexi +$(outdir)/%/index.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map $(OUT_PNG_IMAGES) mkdir -p $(dir $@) - $(TEXI2HTML) --I=$(outdir) $(TEXI2HTML_FLAGS) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $< + $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) $(TEXI2HTML_FLAGS) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $< cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@) -$(outdir)/%-big-page.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map $(OUT_PNG_IMAGES) $(outdir)/version.itexi - $(TEXI2HTML) --I=$(outdir) -D bigpage $(TEXI2HTML_FLAGS) --output=$@ $(TEXI2HTML_INIT) $< +$(outdir)/%-big-page.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map $(OUT_PNG_IMAGES) + $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) -D bigpage $(TEXI2HTML_FLAGS) --output=$@ $(TEXI2HTML_INIT) $< cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@) else # Rules using makeinfo follow -$(outdir)/%/index.html: $(outdir)/%.texi $(outdir)/version.itexi +$(outdir)/%/index.html: $(outdir)/%.texi mkdir -p $(dir $@) $(MAKEINFO) -P $(outdir) --output=$(outdir)/$* --css-include=$(top-src-dir)/Documentation/texinfo.css --html $< -$(outdir)/%-big-page.html: $(outdir)/%.texi $(outdir)/version.itexi +$(outdir)/%-big-page.html: $(outdir)/%.texi $(MAKEINFO) -P $(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $< endif -$(outdir)/%.pdftexi: $(outdir)/%.texi $(outdir)/version.itexi +$(outdir)/%.pdftexi: $(outdir)/%.texi $(PYTHON) $(buildscript-dir)/texi-gettext.py $(ISOLANG) $< -$(outdir)/%.pdf: $(outdir)/%.pdftexi $(outdir)/version.itexi +$(outdir)/%.pdf: $(outdir)/%.pdftexi cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) $(TEXINFO_PAPERSIZE_OPTION) $(notdir $*).pdftexi $(outdir)/version.%: $(top-src-dir)/VERSION @@ -33,10 +33,6 @@ $(outdir)/%.png: $(top-build-dir)/Documentation/user/$(outdir)/%.png $(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map: $(outdir)/%.texi $(PYTHON) $(buildscript-dir)/extract_texi_filenames.py -o $(XREF_MAPS_DIR) $< -# This makes sure lilypond-doc gettext domain has been compiled -# before lilypond-book runs -$(TELY_FILES): doc-po - $(MASTER_TEXI_FILES): $(ITELY_FILES) $(ITEXI_FILES) .SECONDARY: diff --git a/make/doc-i18n-user-targets.make b/make/doc-i18n-user-targets.make index 7f8f6799b0..3dd7ea8fa8 100644 --- a/make/doc-i18n-user-targets.make +++ b/make/doc-i18n-user-targets.make @@ -3,12 +3,11 @@ default: local-WWW-1: $(MASTER_TEXI_FILES) $(PDF_FILES) $(XREF_MAPS_FILES) # BIG_PAGE_HTML_FILES is defined differently in each language makefile -local-WWW-2: $(DEEP_HTML_FILES) $(BIG_PAGE_HTML_FILES) +local-WWW-2: $(DEEP_HTML_FILES) $(BIG_PAGE_HTML_FILES) $(DOCUMENTATION_LOCALE_TARGET) find $(outdir) -name '*.html' | xargs grep -L 'UNTRANSLATED NODE: IGNORE ME' | xargs $(PYTHON) $(buildscript-dir)/html-gettext.py $(ISOLANG) find $(outdir) -name '*.html' | xargs grep -L --label="" 'UNTRANSLATED NODE: IGNORE ME' | sed 's!$(outdir)/!!g' | xargs $(PYTHON) $(buildscript-dir)/mass-link.py --prepend-suffix .$(ISOLANG) hard $(outdir) $(top-build-dir)/Documentation/user/$(outdir) $(TELY_FILES:%.tely=%.pdf) find $(outdir) \( -name 'lily-*.png' -o -name 'lily-*.ly' \) | sed 's!$(outdir)/!!g' | xargs $(PYTHON) $(buildscript-dir)/mass-link.py hard $(outdir) $(top-build-dir)/Documentation/user/$(outdir) -doc-po: +$(DOCUMENTATION_LOCALE_TARGET): $(MAKE) -C $(depth)/Documentation/po out=www messages - -.PHONY: doc-po + touch $@ diff --git a/make/doc-i18n-user-vars.make b/make/doc-i18n-user-vars.make index 193c54245c..87ca4cd4fa 100644 --- a/make/doc-i18n-user-vars.make +++ b/make/doc-i18n-user-vars.make @@ -38,3 +38,5 @@ TEXI2PDF_FLAGS += --batch $(DOCUMENTATION_INCLUDES) ifdef QUIET_BUILD TEXI2PDF_FLAGS += -q endif + +DOCUMENTATION_LOCALE_TARGET = $(outdir)/doc-po diff --git a/make/ly-rules.make b/make/ly-rules.make index fe849db405..4908997f9d 100644 --- a/make/ly-rules.make +++ b/make/ly-rules.make @@ -8,16 +8,25 @@ $(outdir)/%.latex: %.doc $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS) $(LILYPOND_BOOK_LILYPOND_FLAGS)' --output=$(outdir) $(LILYPOND_BOOK_FLAGS) $< +# This allows -j make option while making sure only one lilypond-book instance +# is running at the same time +define CHAIN_RULE +$(i) +$(i): +endef + +$(eval $(firstword $(MASTER_TEXI_FILES)): $(foreach i, $(wordlist 2, $(words $(MASTER_TEXI_FILES)), $(MASTER_TEXI_FILES)),$(CHAIN_RULE))) # don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir. # it is not, for --srcdir builds -$(outdir)/%.texi: %.tely $(outdir)/version.itexi +$(outdir)/%.texi: %.tely $(outdir)/version.itexi $(DOCUMENTATION_LOCALE_TARGET) $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS) $(LILYPOND_BOOK_LILYPOND_FLAGS)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $< -$(outdir)/%.texi: $(outdir)/%.tely $(outdir)/version.itexi +$(outdir)/%.texi: $(outdir)/%.tely $(outdir)/version.itexi $(DOCUMENTATION_LOCALE_TARGET) $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS) $(LILYPOND_BOOK_INCLUDES) $(LILYPOND_BOOK_LILYPOND_FLAGS)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $< + $(outdir)/%.html.omf: %.tely $(call GENERATE_OMF,html) diff --git a/make/ly-vars.make b/make/ly-vars.make index 61b61ef13b..498ad1ffa5 100644 --- a/make/ly-vars.make +++ b/make/ly-vars.make @@ -4,6 +4,8 @@ # huh ? these are for documentation?! TELY_FILES := $(call src-wildcard,*.tely) +MASTER_TEXI_FILES := $(sort $(TELY_FILES:%.tely=$(outdir)/%.texi))\ + $(OUT_MASTER_TEXI_FILES) OMF_FILES += $(foreach format, html pdf, $(foreach f, $(TELY_FILES), $(outdir)/$(f:.tely=.$(format)).omf)) diff --git a/scm/documentation-generate.scm b/scm/documentation-generate.scm index 6158fbb21c..23f60cc246 100644 --- a/scm/documentation-generate.scm +++ b/scm/documentation-generate.scm @@ -70,7 +70,7 @@ "(lilypond/lilypond-internals.info)") " -@include macros.texi +@include macros.itexi @ignore @omftitle LilyPond internals diff --git a/stepmake/stepmake/texinfo-rules.make b/stepmake/stepmake/texinfo-rules.make index 4d1f06283f..41f06925fb 100644 --- a/stepmake/stepmake/texinfo-rules.make +++ b/stepmake/stepmake/texinfo-rules.make @@ -28,16 +28,16 @@ $(outdir)/%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir- ifeq (,$(findstring texi2html,$(MISSING_OPTIONAL))) $(outdir)/%-big-page.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi - $(TEXI2HTML) --I=$(outdir) -D bigpage --output=$@ $(TEXI2HTML_INIT) $< + $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) -D bigpage --output=$@ $(TEXI2HTML_INIT) $< cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@) $(outdir)/%.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi - $(TEXI2HTML) --I=$(outdir) --output=$@ $(TEXI2HTML_INIT) $< + $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) --output=$@ $(TEXI2HTML_INIT) $< cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@) $(outdir)/%/index.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi mkdir -p $(dir $@) - $(TEXI2HTML) --I=$(outdir) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $< + $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $< cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@) else # Rules using makeinfo follow -- 2.39.2