3 ########################
4 # Documentation build #
5 ########################
11 LANGS = $(shell $(PYTHON) $(top-src-dir)/python/langdefs.py)
12 MANUALS_SUBDIRS = application contributor essay learning notation
13 SUBDIRS = $(MANUALS_SUBDIRS) snippets bibliography logo pictures misc po $(LANGS)
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 THANKS
29 LATEX_FILES =$(call src-wildcard,*.latex)
31 IN_ITELY_FILES = $(call src-wildcard,snippets/*-intro.itely)
32 SNIPPET_LY_FILES = $(call src-wildcard,snippets/*.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)
56 UNSPLITTED_HTML_MANUALS = changes
57 SPLITTED_HTML_MANUALS = $(foreach manual, $(TEXINFO_MANUALS),\
58 $(if $(findstring $(manual), $(UNSPLITTED_HTML_MANUALS)),,$(manual)))
60 OUT_HTML_FILES = $(UNSPLITTED_HTML_MANUALS:%=$(outdir)/%.html)\
61 $(SPLITTED_HTML_MANUALS:%=$(outdir)/%-big-page.html)
62 DEEP_HTML_FILES = $(SPLITTED_HTML_MANUALS:%=$(outdir)/%/index.html)
64 # Symlinks to refer to external source documents from split and non-split HTML
65 source-links = $(outdir)/source\
66 $(foreach manual, $(SPLITTED_HTML_MANUALS), $(outdir)/$(manual)/source)
70 HTML_PAGE_NAMES= index translations devel
71 OUT_HTML_FILES += $(HTML_PAGE_NAMES:%=$(outdir)/%.html)
73 MAIN_INFO_DOC = lilypond-notation
74 INFO_DOCS = lilypond-application lilypond-changes lilypond-contributor lilypond-internals \
75 lilypond-essay lilypond-learning lilypond-notation music-glossary
77 INFO_DOCS += lilypond-snippets
79 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
82 INFO_IMAGES_DIR = lilypond
83 DEST_INFO_IMAGES_SUBDIR = Documentation/
86 include $(depth)/make/stepmake.make
88 OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
93 default: local-txt-doc
95 local-help: extra-local-help
99 check-xrefs [ISOLANG=LL] validate Texinfo cross-references\n\
100 fix-xrefs [ISOLANG=LL] interactively fix Texinfo cross-references (use with caution)\n\
101 info update info pages\n\
102 xml update Docbook xml documentation\n\
104 Translations specific targets (see TRANSLATION for details):\n\
105 new-lang ISOLANG=LL create and initialize subdirectory \'LL' for language \'LL\n\
106 po-update update and replace PO files for documentation with msgmerged versions\n\
107 check-translation ISOLANG=LL show changes in English docs since last translation update\n\
108 update-translation ISOLANG=LL call $$$$EDITOR to help updating the translation\n\
109 skeleton-update ISOLANG=LL update Texinfo skeleton files\n\
110 snippet-update ISOLANG=LL update ly snippets in Texinfo translation according to\n\
111 docs in English (use with caution)\n\
113 LL refers to the desired locale (most often only the ISO 639 language code).\n"
116 @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
117 @echo export PYTHONPATH=$(PYTHONPATH)
119 xml: $(outdir)/notation/notation.xml $(outdir)/internals/internals.xml
123 rm -f $(INFO_IMAGES_DIR)
128 local-WWW-1: $(OUT_TEXINFO_MANUALS) $(PDF_FILES) info
130 local-WWW-2: txt-to-html $(OUT_HTML_FILES) $(DEEP_HTML_FILES) $(source-links) $(OMF_FILES)
137 # cd $(outdir) rule gets bit hairy for --srcdir configure builds
139 $(foreach a, $(README_TOP_FILES), cp $(top-src-dir)/$(a) $(outdir)/$(a).txt && ) true
140 $(PYTHON) $(step-bindir)/text2html.py $(OUT_TXT_FILES)
143 ## Extra images dependencies
144 $(OUT_TEXINFO_MANUALS): $(outdir)/pictures
146 $(outdir)/pictures: pictures-subdir
147 ln -sf ../pictures/$(outdir) $@
150 $(MAKE) -C pictures WWW-1
153 # Ugh, using '%' twice not possible
154 $(outdir)/notation/notation.xml: $(outdir)/notation.texi
156 $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<
158 $(outdir)/internals/internals.xml: $(outdir)/internals.texi
160 $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<
162 $(outdir)/learning.texi $(outdir)/notation.texi: $(OUT_PDF_IMAGES)
164 $(foreach manual, $(MANUAL_SUBDIRS),\
165 $(eval $(outdir)/(manual).texi: $(call src-wildcard,$(manual)/*.ite??)))
176 ln -sf $(depth)/.. $(@)
179 ## Snippets rules idiosyncrases
180 $(outdir)/%.itely: snippets/%-intro.itely snippets/%.snippet-list
181 xargs $(LYS_TO_TELY) -f doctitle,texidoc,verbatim --name=$@ --template=$< < $(filter %.snippet-list, $^)
183 $(outdir)/snippets.texi: $(GENERATED_ITELY_FILES) $(SNIPPET_LY_FILES)
185 $(outdir)/%.bib: %.bib
188 ## notation.texi deps
189 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
190 $(MAKE) -C $(top-src-dir)/mf
192 $(outdir)/notation.texi: $(outdir)/ly-grammar.txt
194 ## Rules for the automatically generated documentation
195 $(outdir)/ly-grammar.txt: $(top-src-dir)/lily/parser.yy
196 cd $(outdir) && $(BISON) -v $<
197 $(auxscript-dir)/yyout2grammar.py $(outdir)/parser.output $@
199 # There used to be a dependency on a dummy target, to force a rebuild
200 # of internals every time. however, this triggers
201 # compilation during install, which is a bad thing (tm).
203 $(outdir)/internals.texi: $(LILYPOND_BINARY)
204 cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
207 ###############################################
208 # Documentation and translations maintenance #
209 ###############################################
213 all-translations-update: po-update translation-status
214 $(foreach lang, $(LANGS), make ISOLANG=$(lang) skeleton-update snippet-update &&) true
217 CHECK_TRANSLATION_FLAGS = --no-color
222 @if (( $$(file -b $(ISOLANG)) == directory )) 2>/dev/null; \
223 then echo "Error: $(ISOLANG) directory already exists. Exiting." ; \
226 mkdir -p $(ISOLANG)/learning
227 cp fr/GNUmakefile $(ISOLANG)
228 cp fr/learning/GNUmakefile $(ISOLANG)/learning
229 sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/learning/GNUmakefile
230 $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext ../learning.tely
231 mv $(outdir)/*.*tely $(ISOLANG)/learning
232 msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
233 cp po/lilypond-doc.pot po/$(ISOLANG).po
234 @echo "*** Please add a language definition for $(ISOLANG) in python/langdefs.py ***"
236 CHECKED_FILES = $(ISOLANG)/index.html.in $(foreach i,learning notation application, \
237 $(shell find $(ISOLANG)/$(manual) -name '*.*te??' -not -wholename '*out-www*')) \
238 $(shell find $(ISOLANG)/texidocs/ -name '*.texidoc')
240 TELY_FILES = $(call src-wildcard,$(ISOLANG)/*.tely)
242 $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) --skeleton $(TELY_FILES:$(ISOLANG)/%.tely=../%.tely)
243 $(auxscript-dir)/texi-skeleton-update.py $(ISOLANG) $(outdir)
246 $(auxscript-dir)/update-snippets.py user $(ISOLANG) '*.itely'
248 DOCUMENTS_INCLUDES:=-I $(ISOLANG) \
249 -I $(top-build-dir)/Documentation/$(ISOLANG)/out-www \
250 -I $(top-src-dir)/Documentation/snippets \
251 -I $(top-build-dir)/Documentation/out-www
253 else # ISOLANG is empty
255 DOCUMENTS_INCLUDES:=-I . \
256 -I $(top-build-dir)/Documentation/out-www \
257 -I $(top-src-dir)/Documentation/snippets \
258 -I $(top-build-dir)/Documentation/snippets/out-www
263 $(auxscript-dir)/check_texi_refs.py --batch \
264 $(DOCUMENTS_INCLUDES) $(auxpython-dir)/manuals_definitions.py
267 $(auxscript-dir)/check_texi_refs.py --auto-fix \
268 $(DOCUMENTS_INCLUDES) $(auxpython-dir)/manuals_definitions.py
271 ISOLANG=$(ISOLANG) $(auxscript-dir)/check_translation.py $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES)
274 ISOLANG=$(ISOLANG) $(auxscript-dir)/check_translation.py --update $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES)
277 make -C po out=www messages
278 $(auxscript-dir)/translations-status.py