3 ########################
4 # Documentation build #
5 ########################
10 OUT_DIST_FILES = $(outdir)/ly-grammar.txt
13 LANGS = $(shell $(PYTHON) $(top-src-dir)/python/langdefs.py)
14 SUBDIRS = logo pictures misc po css topdocs \
16 STEPMAKE_TEMPLATES = documentation texinfo tex omf
17 LOCALSTEPMAKE_TEMPLATES = lilypond ly
21 LILYPOND_BOOK_FLAGS = --extra-options '-e "(ly:set-option (quote internal-type-checking) \#t)"'
24 -I $(top-build-dir)/Documentation/$(outconfbase)
25 $(outdir)/snippets-big-page.html: TEXI2HTML_FLAGS += -D short_toc
26 $(outdir)/snippets/index.html: TEXI2HTML_FLAGS += -D short_toc
28 ### Extra source files
30 README_TOP_FILES= DEDICATION
32 IN_ITELY_FILES = $(call src-wildcard,snippets/*-intro.itely)
33 SNIPPET_LY_FILES = $(call src-wildcard,snippets/*.ly)
34 OUT_SNIPPET_LY_FILES = $(SNIPPET_LY_FILES:%.ly=out/%.ly)
39 GENERATED_ITELY_FILES = $(IN_ITELY_FILES:snippets/%-intro.itely=$(outdir)/%.itely)
41 XREF_MAPS_FILES += $(XREF_MAPS_DIR)/internals.xref-map
42 OMF_FILES += $(outdir)/internals.html.omf $(outdir)/internals.pdf.omf
45 TEXINFO_MANUALS = internals\
46 $(TELY_FILES:%.tely=%)\
47 $(TEXI_FILES:%.texi=%)
48 OUT_TEXINFO_MANUALS = $(TEXINFO_MANUALS:%=$(outdir)/%.texi)
50 ## CHAIN_RULE hack: keep the following line *before* including
51 # stepmake.make, so the Internals Reference is built before the
52 # Notation Reference, thus providing automatically generated sections
54 TEXI_FILES_FROM_TELY = $(outdir)/internals.texi
56 PDF_FILES = $(TEXINFO_MANUALS:%=$(outdir)/%.pdf)
59 UNSPLIT_HTML_MANUALS =
60 SPLIT_HTML_MANUALS = $(foreach manual, $(TEXINFO_MANUALS),\
61 $(if $(findstring $(manual), $(UNSPLIT_HTML_MANUALS)),,$(manual)))
62 NOT_TOPDIR_HTML_MANUALS = $(foreach manual, $(SPLIT_HTML_MANUALS),\
63 $(if $(findstring $(manual), $(TOPDIR_HTML_MANUALS)),,$(manual)))
65 OUT_HTML_FILES = $(UNSPLIT_HTML_MANUALS:%=$(outdir)/%.html)\
66 $(SPLIT_HTML_MANUALS:%=$(outdir)/%-big-page.html)
67 DEEP_HTML_FILES = $(NOT_TOPDIR_HTML_MANUALS:%=$(outdir)/%/index.html)
69 # Symlinks to refer to external source documents from split and non-split HTML
70 source-links = $(outdir)/source\
71 $(foreach manual, $(SPLIT_HTML_MANUALS), $(outdir)/$(manual)/source)
75 MAIN_INFO_DOC = lilypond-web
76 INFO_DOCS = lilypond-usage lilypond-changes lilypond-contributor lilypond-internals \
77 lilypond-essay lilypond-learning lilypond-notation music-glossary \
78 lilypond-web lilypond-extending
80 INFO_DOCS += lilypond-snippets
82 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
85 INFO_IMAGES_DIR = lilypond
86 DEST_INFO_IMAGES_SUBDIR = Documentation
89 include $(depth)/make/stepmake.make
91 OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
94 ### Web site idiosyncrasies
95 $(XREF_MAPS_DIR)/web.xref-map: XREF_MAP_FLAGS += --split=node
98 JS_FILES = $(call src-wildcard,*.js)
99 PHP_FILES = $(call src-wildcard,*.php)
101 OUT_JS_FILES = $(JS_FILES:%.js=$(outdir)/%.js)
102 OUT_PHP_FILES = $(PHP_FILES:%.php=$(outdir)/%.php)
106 ### bad hack for badly-integrated roadmap.
108 cp $(top-src-dir)/ROADMAP $(outdir)
109 $(outdir)/contributor.texi: $(outdir)/ROADMAP
111 ### bad hack for badly-integrated bibliography
112 $(outdir)/colorado.itexi:
113 BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \
114 -s $(top-src-dir)/Documentation/lily-bib \
115 -o $(outdir)/colorado.itexi \
117 $(src-dir)/essay/colorado.bib
119 $(outdir)/computer-notation.itexi:
120 BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \
121 -s $(top-src-dir)/Documentation/lily-bib \
122 -o $(outdir)/computer-notation.itexi \
124 $(src-dir)/essay/computer-notation.bib
126 $(outdir)/engravingbib.itexi:
127 BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \
128 -s $(top-src-dir)/Documentation/lily-bib \
129 -o $(outdir)/engravingbib.itexi \
131 $(src-dir)/essay/engravingbib.bib
133 $(outdir)/essay.texi: \
134 $(outdir)/colorado.itexi \
135 $(outdir)/computer-notation.itexi \
136 $(outdir)/engravingbib.itexi
142 default: local-txt-doc
144 local-help: extra-local-help
147 @echo " check-xrefs [ISOLANG=LL] validate Texinfo cross-references"
148 @echo " fix-xrefs [ISOLANG=LL] interactively fix Texinfo cross-references"
149 @echo " (use with caution)"
150 @echo " info update info pages"
151 @echo " xml update Docbook xml documentation"
153 @echo "Translations specific targets (see TRANSLATION for details):"
154 @echo " new-lang ISOLANG=LL create and initialize"
155 @echo " subdirectory \'LL' for language \'LL"
156 @echo " (if \'LL exists, update missing file)"
157 @echo " po-update update and replace PO files for"
158 @echo " documentation with msgmerged versions"
159 @echo " check-translation ISOLANG=LL show changes in English docs since"
160 @echo " last translation update"
161 @echo " update-translation ISOLANG=LL call $$$$EDITOR to help updating"
162 @echo " the translation"
163 @echo " snippet-update ISOLANG=LL update ly snippets in Texinfo translation"
164 @echo " according to docs in English"
165 @echo " (use with caution)"
167 @echo " LL refers to the desired locale"
168 @echo " (most often only the ISO 639 language code)."
173 xml: $(outdir)/notation/notation.xml $(outdir)/internals/internals.xml
177 rm -f $(INFO_IMAGES_DIR)
182 local-WWW-1: $(OUT_TEXINFO_MANUALS) $(PDF_FILES) info
184 ifeq ($(AJAX_SEARCH),1)
185 local-WWW-2: txt-to-html $(OUT_HTML_FILES) $(DEEP_HTML_FILES) $(OUT_JS_FILES) $(OUT_PHP_FILES) $(source-links) $(OMF_FILES)
187 local-WWW-2: txt-to-html $(OUT_HTML_FILES) $(DEEP_HTML_FILES) $(source-links) $(OMF_FILES)
196 $(outdir)/lilypond-%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi $(outdir)/weblinks.itexi | $(OUT_TEXINFO_MANUALS)
197 $(buildscript-dir)/run-and-check "$(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $<" "$*.makeinfo.log"
199 txt-to-html: $(OUT_TXT_FILES) $(OUT_TXT_FILES:%.txt=%.html)
201 $(OUT_TXT_FILES): $(outdir)/%.txt: $(top-src-dir)/%
204 $(OUT_TXT_FILES:%.txt=%.html): $(outdir)/%.html: $(outdir)/%.txt
205 $(buildscript-dir)/text2html $<
207 # Explicitly list the dependencies on generated content
208 $(outdir)/web.texi: $(outdir)/we-wrote.itexi $(outdir)/others-did.itexi $(outdir)/weblinks.itexi
211 ## Extra images dependencies
212 $(OUT_TEXINFO_MANUALS): $(outdir)/pictures
215 $(MAKE) -C pictures WWW-1
216 ln -sf ../pictures/$(outdir) $@
218 $(outdir)/web.texi: $(outdir)/css $(outdir)/ly-examples
222 ln -sf ../css/$(outdir) $@
224 $(outdir)/ly-examples:
225 $(MAKE) -C ly-examples
226 ln -sf ../ly-examples/$(outdir) $@
230 # Ugh, using '%' twice not possible
231 $(outdir)/notation/notation.xml: $(outdir)/notation.texi
233 $(buildscript-dir)/run-and-check "$(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<" "$*.makeinfoxml.log"
235 $(outdir)/internals/internals.xml: $(outdir)/internals.texi
237 $(buildscript-dir)/run-and-check "$(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<" "$*.makeinfoxml.log"
239 $(outdir)/learning.texi $(outdir)/notation.texi: $(OUT_PDF_IMAGES)
248 ln -sf $(depth)/.. $(@)
251 ## Snippets rules idiosyncrasies
252 $(outdir)/%.itely: snippets/%-intro.itely snippets/%.snippet-list
253 xargs $(LYS_TO_TELY) -f doctitle,texidoc,verbatim --name=$@ --template=$< < $(filter %.snippet-list, $^)
255 $(TEXI_FILES_FROM_TELY): $(GENERATED_ITELY_FILES) $(OUT_SNIPPET_LY_FILES)
257 $(OUT_SNIPPET_LY_FILES): out/ly-snippets.dep
259 out/ly-snippets.dep: $(SNIPPET_LY_FILES)
260 mkdir -p snippets/out
261 $(buildscript-dir)/makesnippets $(src-dir)/snippets snippets/out $(src-dir)
265 $(outdir)/%.bib: %.bib
271 $(outdir)/%.php: %.php
274 ## notation.texi deps
275 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
276 $(MAKE) -C $(top-src-dir)/mf
278 $(outdir)/notation.texi: $(outdir)/ly-grammar.txt
280 ## Rules for the automatically generated documentation
281 $(outdir)/ly-grammar.txt: $(top-src-dir)/lily/parser.yy
282 cd $(outdir) && $(BISON) -v $<
283 $(buildscript-dir)/yyout2grammar $(outdir)/parser.output $@
285 # There used to be a dependency on a dummy target, to force a rebuild
286 # of internals every time. however, this triggers
287 # compilation during install, which is a bad thing (tm).
289 $(outdir)/internals.texi: $(LILYPOND_BINARY) $(INIT_LY_SOURCES) $(SCHEME_SOURCES)
290 cd $(outdir) && $(buildscript-dir)/run-and-check "$(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation" "generate-documentation.log"
292 ###############################################
293 # Documentation and translations maintenance #
294 ###############################################
298 all-translations-update: po-update translation-status
299 $(foreach lang, $(LANGS), make ISOLANG=$(lang) skeleton-update snippet-update &&) true
302 CHECK_TRANSLATION_FLAGS = --no-color
307 mkdir -p $(ISOLANG)/$(DIR)
308 rm -f $(outdir)/*.*tely $(outdir)/*.*texi
309 $(PYTHON) $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext $$(cd $(ISOLANG) && ls -1 ../$(DIR).tely ../$(DIR).texi)
310 for i in $$(cd $(outdir) && ls -1 $(DIR).tely $(DIR).texi); do\
311 test -e $(ISOLANG)/$$i || mv $(outdir)/$$i $(ISOLANG)/$$i;\
313 rm -f $(outdir)/$(DIR).tely $(outdir)/$(DIR).texi
314 for i in $$(cd $(outdir) && ls -1 *.*tely *.*texi); do\
315 test -e $(ISOLANG)/$(DIR)/$$i\
316 || test -e $(ISOLANG)/$$i\
317 || mv $(outdir)/$$i $(ISOLANG)/$(DIR)/$$i;\
321 # Also for updating/adding missing files
322 mkdir -p $(ISOLANG)/included
323 if test -z "`ls $(ISOLANG)/included`"; then touch $(ISOLANG)/included/.gitignore; fi
324 cp fr/GNUmakefile $(ISOLANG)
325 sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile
326 $(foreach i,$(TRANSLATION_DIRS),$(MAKE) new-lang-dir DIR=$(i) &&) :
327 msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
328 test -e po/$(ISOLANG).po || cp po/lilypond-doc.pot po/$(ISOLANG).po
329 @echo "*** Please add a language definition for $(ISOLANG) in python/langdefs.py ***"
331 TRANSLATION_DIRS = web texidocs
332 TRANSLATION_FILES = $(shell git ls-files $(ISOLANG) | grep -v GNUmakefile)
333 TEXI_LANGUTIL_FLAGS += --skeleton
335 TELY_FILES = $(call src-wildcard,$(ISOLANG)/*.tely)
337 @echo "$@ has been discontinued"
338 @echo "simply copy .texi, .itexi files you want to translate"
341 $(PYTHON) $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) $(TEXI_LANGUTIL_FLAGS) $(TELY_FILES:$(ISOLANG)/%.tely=../%.tely)
342 $(PYTHON) $(auxscript-dir)/texi-skeleton-update.py $(ISOLANG) $(outdir)
345 $(PYTHON) $(auxscript-dir)/update-snippets.py user $(ISOLANG) '*.itely'
347 DOCUMENTS_INCLUDES:=-I $(ISOLANG) \
348 -I $(top-build-dir)/Documentation/$(ISOLANG)/out-www \
349 -I $(top-src-dir)/Documentation/snippets \
350 -I $(top-build-dir)/Documentation/out-www \
351 -I $(top-build-dir)/Documentation/out
353 else # ISOLANG is empty
355 DOCUMENTS_INCLUDES:=-I . \
356 -I $(top-build-dir)/Documentation/out-www \
357 -I $(top-src-dir)/Documentation/snippets \
358 -I $(top-build-dir)/Documentation/snippets/out-www \
359 -I $(top-build-dir)/Documentation/out
364 $(PYTHON) $(auxscript-dir)/check_texi_refs.py --batch \
365 $(DOCUMENTS_INCLUDES) $(auxpython-dir)/manuals_definitions.py
368 $(PYTHON) $(auxscript-dir)/check_texi_refs.py --auto-fix \
369 $(DOCUMENTS_INCLUDES) $(auxpython-dir)/manuals_definitions.py
372 ISOLANG=$(ISOLANG) $(PYTHON) $(auxscript-dir)/check_translation.py $(CHECK_TRANSLATION_FLAGS) $(TRANSLATION_FILES)
375 ISOLANG=$(ISOLANG) $(PYTHON) $(auxscript-dir)/check_translation.py --update $(CHECK_TRANSLATION_FLAGS) $(TRANSLATION_FILES)
377 # what's it gonna be, boy...tranlationS-/translation-
379 PYTHONPATH=$(top-src-dir)/python:$(top-src-dir)/python/auxiliar $(PYTHON) $(top-src-dir)/scripts/auxiliar/translations-status.py