3 ########################
4 # Documentation build #
5 ########################
11 LANGS = $(shell $(PYTHON) $(top-src-dir)/python/langdefs.py)
12 SUBDIRS = logo pictures misc po css topdocs \
14 STEPMAKE_TEMPLATES = documentation texinfo tex omf
15 LOCALSTEPMAKE_TEMPLATES = lilypond ly
19 LILYPOND_BOOK_FLAGS = --extra-options '-e "(ly:set-option (quote internal-type-checking) \#t)"'
22 -I $(top-build-dir)/Documentation/$(outconfbase)
23 $(outdir)/snippets-big-page.html: TEXI2HTML_FLAGS += -D short_toc
24 $(outdir)/snippets/index.html: TEXI2HTML_FLAGS += -D short_toc
26 ### Extra source files
28 README_TOP_FILES= DEDICATION
30 IN_ITELY_FILES = $(call src-wildcard,snippets/*-intro.itely)
31 SNIPPET_LY_FILES = $(call src-wildcard,snippets/*.ly)
32 OUT_SNIPPET_LY_FILES = $(SNIPPET_LY_FILES:%.ly=out/%.ly)
37 GENERATED_ITELY_FILES = $(IN_ITELY_FILES:snippets/%-intro.itely=$(outdir)/%.itely)
39 XREF_MAPS_FILES += $(XREF_MAPS_DIR)/internals.xref-map
40 OMF_FILES += $(outdir)/internals.html.omf $(outdir)/internals.pdf.omf
43 TEXINFO_MANUALS = internals\
44 $(TELY_FILES:%.tely=%)\
45 $(TEXI_FILES:%.texi=%)
46 OUT_TEXINFO_MANUALS = $(TEXINFO_MANUALS:%=$(outdir)/%.texi)
48 ## CHAIN_RULE hack: keep the following line *before* including
49 # stepmake.make, so the Internals Reference is built before the
50 # Notation Reference, thus providing automatically generated sections
52 TEXI_FILES_FROM_TELY = $(outdir)/internals.texi
54 PDF_FILES = $(TEXINFO_MANUALS:%=$(outdir)/%.pdf)
57 UNSPLIT_HTML_MANUALS =
58 SPLIT_HTML_MANUALS = $(foreach manual, $(TEXINFO_MANUALS),\
59 $(if $(findstring $(manual), $(UNSPLIT_HTML_MANUALS)),,$(manual)))
60 NOT_TOPDIR_HTML_MANUALS = $(foreach manual, $(SPLIT_HTML_MANUALS),\
61 $(if $(findstring $(manual), $(TOPDIR_HTML_MANUALS)),,$(manual)))
63 OUT_HTML_FILES = $(UNSPLIT_HTML_MANUALS:%=$(outdir)/%.html)\
64 $(SPLIT_HTML_MANUALS:%=$(outdir)/%-big-page.html)
65 DEEP_HTML_FILES = $(NOT_TOPDIR_HTML_MANUALS:%=$(outdir)/%/index.html)
67 # Symlinks to refer to external source documents from split and non-split HTML
68 source-links = $(outdir)/source\
69 $(foreach manual, $(SPLIT_HTML_MANUALS), $(outdir)/$(manual)/source)
73 MAIN_INFO_DOC = lilypond-web
74 INFO_DOCS = lilypond-usage lilypond-changes lilypond-contributor lilypond-internals \
75 lilypond-essay lilypond-learning lilypond-notation music-glossary \
76 lilypond-web lilypond-extending
78 INFO_DOCS += lilypond-snippets
80 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
83 INFO_IMAGES_DIR = lilypond
84 DEST_INFO_IMAGES_SUBDIR = Documentation
87 include $(depth)/make/stepmake.make
89 OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
92 ### Web site idiosyncrasies
93 $(XREF_MAPS_DIR)/web.xref-map: XREF_MAP_FLAGS += --split=node
96 JS_FILES = $(call src-wildcard,*.js)
97 PHP_FILES = $(call src-wildcard,*.php)
99 OUT_JS_FILES = $(JS_FILES:%.js=$(outdir)/%.js)
100 OUT_PHP_FILES = $(PHP_FILES:%.php=$(outdir)/%.php)
104 ### bad hack for badly-integrated roadmap.
106 cp $(top-src-dir)/ROADMAP $(outdir)
107 $(outdir)/contributor.texi: $(outdir)/ROADMAP
109 ### bad hack for badly-integrated bibliography
110 $(outdir)/colorado.itexi:
111 BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \
112 -s $(top-src-dir)/Documentation/lily-bib \
113 -o $(outdir)/colorado.itexi \
115 $(src-dir)/essay/colorado.bib
117 $(outdir)/computer-notation.itexi:
118 BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \
119 -s $(top-src-dir)/Documentation/lily-bib \
120 -o $(outdir)/computer-notation.itexi \
122 $(src-dir)/essay/computer-notation.bib
124 $(outdir)/engravingbib.itexi:
125 BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \
126 -s $(top-src-dir)/Documentation/lily-bib \
127 -o $(outdir)/engravingbib.itexi \
129 $(src-dir)/essay/engravingbib.bib
131 $(outdir)/essay.texi: \
132 $(outdir)/colorado.itexi \
133 $(outdir)/computer-notation.itexi \
134 $(outdir)/engravingbib.itexi
140 default: local-txt-doc
142 local-help: extra-local-help
145 @echo " check-xrefs [ISOLANG=LL] validate Texinfo cross-references"
146 @echo " fix-xrefs [ISOLANG=LL] interactively fix Texinfo cross-references"
147 @echo " (use with caution)"
148 @echo " info update info pages"
149 @echo " xml update Docbook xml documentation"
151 @echo "Translations specific targets (see TRANSLATION for details):"
152 @echo " new-lang ISOLANG=LL create and initialize"
153 @echo " subdirectory \'LL' for language \'LL"
154 @echo " (if \'LL exists, update missing file)"
155 @echo " po-update update and replace PO files for"
156 @echo " documentation with msgmerged versions"
157 @echo " check-translation ISOLANG=LL show changes in English docs since"
158 @echo " last translation update"
159 @echo " update-translation ISOLANG=LL call $$$$EDITOR to help updating"
160 @echo " the translation"
161 @echo " snippet-update ISOLANG=LL update ly snippets in Texinfo translation"
162 @echo " according to docs in English"
163 @echo " (use with caution)"
165 @echo " LL refers to the desired locale"
166 @echo " (most often only the ISO 639 language code)."
171 xml: $(outdir)/notation/notation.xml $(outdir)/internals/internals.xml
175 rm -f $(INFO_IMAGES_DIR)
180 local-WWW-1: $(OUT_TEXINFO_MANUALS) $(PDF_FILES) info
182 ifeq ($(AJAX_SEARCH),1)
183 local-WWW-2: txt-to-html $(OUT_HTML_FILES) $(DEEP_HTML_FILES) $(OUT_JS_FILES) $(OUT_PHP_FILES) $(source-links) $(OMF_FILES)
185 local-WWW-2: txt-to-html $(OUT_HTML_FILES) $(DEEP_HTML_FILES) $(source-links) $(OMF_FILES)
194 $(outdir)/lilypond-%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi $(outdir)/weblinks.itexi | $(OUT_TEXINFO_MANUALS)
195 $(buildscript-dir)/run-and-check "$(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $<" "$*.makeinfo.log"
197 txt-to-html: $(OUT_TXT_FILES) $(OUT_TXT_FILES:%.txt=%.html)
199 $(OUT_TXT_FILES): $(outdir)/%.txt: $(top-src-dir)/%
202 $(OUT_TXT_FILES:%.txt=%.html): $(outdir)/%.html: $(outdir)/%.txt
203 $(buildscript-dir)/text2html $<
205 # Explicitly list the dependencies on generated content
206 $(outdir)/web.texi: $(outdir)/we-wrote.itexi $(outdir)/others-did.itexi $(outdir)/weblinks.itexi
209 ## Extra images dependencies
210 $(OUT_TEXINFO_MANUALS): $(outdir)/pictures
213 $(MAKE) -C pictures WWW-1
214 ln -sf ../pictures/$(outdir) $@
216 $(outdir)/web.texi: $(outdir)/css $(outdir)/ly-examples
220 ln -sf ../css/$(outdir) $@
222 $(outdir)/ly-examples:
223 $(MAKE) -C ly-examples
224 ln -sf ../ly-examples/$(outdir) $@
228 # Ugh, using '%' twice not possible
229 $(outdir)/notation/notation.xml: $(outdir)/notation.texi
231 $(buildscript-dir)/run-and-check "$(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<" "$*.makeinfoxml.log"
233 $(outdir)/internals/internals.xml: $(outdir)/internals.texi
235 $(buildscript-dir)/run-and-check "$(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<" "$*.makeinfoxml.log"
237 $(outdir)/learning.texi $(outdir)/notation.texi: $(OUT_PDF_IMAGES)
246 ln -sf $(depth)/.. $(@)
249 ## Snippets rules idiosyncrasies
250 $(outdir)/%.itely: snippets/%-intro.itely snippets/%.snippet-list
251 xargs $(LYS_TO_TELY) -f doctitle,texidoc,verbatim --name=$@ --template=$< < $(filter %.snippet-list, $^)
253 $(TEXI_FILES_FROM_TELY): $(GENERATED_ITELY_FILES) $(OUT_SNIPPET_LY_FILES)
255 $(OUT_SNIPPET_LY_FILES): out/ly-snippets.dep
257 out/ly-snippets.dep: $(SNIPPET_LY_FILES)
258 mkdir -p snippets/out
259 $(buildscript-dir)/makesnippets $(src-dir)/snippets snippets/out $(src-dir)
263 $(outdir)/%.bib: %.bib
269 $(outdir)/%.php: %.php
272 ## notation.texi deps
273 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
274 $(MAKE) -C $(top-src-dir)/mf
276 $(outdir)/notation.texi: $(outdir)/ly-grammar.txt
278 ## Rules for the automatically generated documentation
279 $(outdir)/ly-grammar.txt: $(top-src-dir)/lily/parser.yy
280 cd $(outdir) && $(BISON) -v $<
281 $(buildscript-dir)/yyout2grammar $(outdir)/parser.output $@
283 # There used to be a dependency on a dummy target, to force a rebuild
284 # of internals every time. however, this triggers
285 # compilation during install, which is a bad thing (tm).
287 $(outdir)/internals.texi: $(LILYPOND_BINARY) $(INIT_LY_SOURCES) $(SCHEME_SOURCES)
288 cd $(outdir) && $(buildscript-dir)/run-and-check "$(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation" "generate-documentation.log"
290 ###############################################
291 # Documentation and translations maintenance #
292 ###############################################
296 all-translations-update: po-update translation-status
297 $(foreach lang, $(LANGS), make ISOLANG=$(lang) skeleton-update snippet-update &&) true
300 CHECK_TRANSLATION_FLAGS = --no-color
305 mkdir -p $(ISOLANG)/$(DIR)
306 rm -f $(outdir)/*.*tely $(outdir)/*.*texi
307 $(PYTHON) $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext $$(cd $(ISOLANG) && ls -1 ../$(DIR).tely ../$(DIR).texi)
308 for i in $$(cd $(outdir) && ls -1 $(DIR).tely $(DIR).texi); do\
309 test -e $(ISOLANG)/$$i || mv $(outdir)/$$i $(ISOLANG)/$$i;\
311 rm -f $(outdir)/$(DIR).tely $(outdir)/$(DIR).texi
312 for i in $$(cd $(outdir) && ls -1 *.*tely *.*texi); do\
313 test -e $(ISOLANG)/$(DIR)/$$i\
314 || test -e $(ISOLANG)/$$i\
315 || mv $(outdir)/$$i $(ISOLANG)/$(DIR)/$$i;\
319 # Also for updating/adding missing files
320 mkdir -p $(ISOLANG)/included
321 if test -z "`ls $(ISOLANG)/included`"; then touch $(ISOLANG)/included/.gitignore; fi
322 cp fr/GNUmakefile $(ISOLANG)
323 sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile
324 $(foreach i,$(TRANSLATION_DIRS),$(MAKE) new-lang-dir DIR=$(i) &&) :
325 msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
326 test -e po/$(ISOLANG).po || cp po/lilypond-doc.pot po/$(ISOLANG).po
327 @echo "*** Please add a language definition for $(ISOLANG) in python/langdefs.py ***"
329 TRANSLATION_DIRS = web texidocs
330 TRANSLATION_FILES = $(shell git ls-files $(ISOLANG) | grep -v GNUmakefile)
331 TEXI_LANGUTIL_FLAGS += --skeleton
333 TELY_FILES = $(call src-wildcard,$(ISOLANG)/*.tely)
335 @echo "$@ has been discontinued"
336 @echo "simply copy .texi, .itexi files you want to translate"
339 $(PYTHON) $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) $(TEXI_LANGUTIL_FLAGS) $(TELY_FILES:$(ISOLANG)/%.tely=../%.tely)
340 $(PYTHON) $(auxscript-dir)/texi-skeleton-update.py $(ISOLANG) $(outdir)
343 $(PYTHON) $(auxscript-dir)/update-snippets.py user $(ISOLANG) '*.itely'
345 DOCUMENTS_INCLUDES:=-I $(ISOLANG) \
346 -I $(top-build-dir)/Documentation/$(ISOLANG)/out-www \
347 -I $(top-src-dir)/Documentation/snippets \
348 -I $(top-build-dir)/Documentation/out-www \
349 -I $(top-build-dir)/Documentation/out
351 else # ISOLANG is empty
353 DOCUMENTS_INCLUDES:=-I . \
354 -I $(top-build-dir)/Documentation/out-www \
355 -I $(top-src-dir)/Documentation/snippets \
356 -I $(top-build-dir)/Documentation/snippets/out-www \
357 -I $(top-build-dir)/Documentation/out
362 $(PYTHON) $(auxscript-dir)/check_texi_refs.py --batch \
363 $(DOCUMENTS_INCLUDES) $(auxpython-dir)/manuals_definitions.py
366 $(PYTHON) $(auxscript-dir)/check_texi_refs.py --auto-fix \
367 $(DOCUMENTS_INCLUDES) $(auxpython-dir)/manuals_definitions.py
370 ISOLANG=$(ISOLANG) $(PYTHON) $(auxscript-dir)/check_translation.py $(CHECK_TRANSLATION_FLAGS) $(TRANSLATION_FILES)
373 ISOLANG=$(ISOLANG) $(PYTHON) $(auxscript-dir)/check_translation.py --update $(CHECK_TRANSLATION_FLAGS) $(TRANSLATION_FILES)
375 # what's it gonna be, boy...tranlationS-/translation-
377 PYTHONPATH=$(top-src-dir)/python:$(top-src-dir)/python/auxiliar $(PYTHON) $(top-src-dir)/scripts/auxiliar/translations-status.py