]> git.donarmstrong.com Git - lilypond.git/commitdiff
Allow and make effective -j option in "make web"
authorJohn Mandereau <john.mandereau@gmail.com>
Sun, 9 Nov 2008 13:10:51 +0000 (14:10 +0100)
committerJohn Mandereau <john.mandereau@gmail.com>
Sun, 9 Nov 2008 13:10:51 +0000 (14:10 +0100)
- 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
Documentation/user/install.itely
make/doc-i18n-user-rules.make
make/doc-i18n-user-targets.make
make/doc-i18n-user-vars.make
make/ly-rules.make
make/ly-vars.make
scm/documentation-generate.scm
stepmake/stepmake/texinfo-rules.make

index eacbf70f241df48627a285b1a31a702d309b514c..656526318a8f6e26c7ab2f0003b982a07283a4cc 100644 (file)
@@ -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
 #
index e203291674081bfc183cb2239b5b3810c238eab4..cb16e07e057a5d364cfc952ea06aa87036c5be6a 100644 (file)
@@ -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
index 41a05390bc85fa01e6322d877ec7132da27be68e..9734641f23e8de6f9626267222a33dcaca963daf 100644 (file)
@@ -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:
index 7f8f6799b00b506e2563c0349dfe1d1cccc5fd20..3dd7ea8fa85597829efa34d4831cef727579023c 100644 (file)
@@ -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 $@
index 193c54245ceea8650704476d19d1e61030219f61..87ca4cd4fad451a464484d353bf3031bdceb4b7d 100644 (file)
@@ -38,3 +38,5 @@ TEXI2PDF_FLAGS += --batch $(DOCUMENTATION_INCLUDES)
 ifdef QUIET_BUILD
 TEXI2PDF_FLAGS += -q
 endif
+
+DOCUMENTATION_LOCALE_TARGET = $(outdir)/doc-po
index fe849db405729d138aae85bc6de929d523145dfc..4908997f9d83074b1fbc120fc909a8cc0ad4bfe4 100644 (file)
@@ -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)
 
index 61b61ef13bf5ad3518fe9309a4b0b579f6a33403..498ad1ffa587281b2c072e2905b716a3c10abfc0 100644 (file)
@@ -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))
 
index 6158fbb21c1b2771262520584cfa5adcc282ff69..23f60cc246817ba230264cd2d41c70f8c15b710a 100644 (file)
@@ -70,7 +70,7 @@
                  "(lilypond/lilypond-internals.info)")
   "
 
-@include macros.texi
+@include macros.itexi
 
 @ignore
 @omftitle LilyPond internals
index 4d1f06283f7f5b799aa4d2d4bdc3a582d1321bb5..41f06925fb777a1352c914cf1f8ee7d23bb2f373 100644 (file)
@@ -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