3 ########################
4 # Documentation build #
5 ########################
11 LANGS = $(shell $(PYTHON) $(top-src-dir)/python/langdefs.py)
12 MANUALS_SUBDIRS = application contributor essay general 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 = $(subst $(outdir)/general.pdf,,$(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 lilypond
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)))
90 ### Web site idiosyncrases
92 OUT_HTML_FILES := $(subst $(outdir)/general-big-page.html,,$(OUT_HTML_FILES))
94 ## Different init file and CSS
95 $(outdir)/general/index.html: \
96 TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/web-texi2html.init
101 default: local-txt-doc
103 local-help: extra-local-help
107 check-xrefs [ISOLANG=LL] validate Texinfo cross-references\n\
108 fix-xrefs [ISOLANG=LL] interactively fix Texinfo cross-references (use with caution)\n\
109 info update info pages\n\
110 xml update Docbook xml documentation\n\
112 Translations specific targets (see TRANSLATION for details):\n\
113 new-lang ISOLANG=LL create and initialize subdirectory \'LL' for language \'LL\n\
114 po-update update and replace PO files for documentation with msgmerged versions\n\
115 check-translation ISOLANG=LL show changes in English docs since last translation update\n\
116 update-translation ISOLANG=LL call $$$$EDITOR to help updating the translation\n\
117 skeleton-update ISOLANG=LL update Texinfo skeleton files\n\
118 snippet-update ISOLANG=LL update ly snippets in Texinfo translation according to\n\
119 docs in English (use with caution)\n\
121 LL refers to the desired locale (most often only the ISO 639 language code).\n"
124 @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
125 @echo export PYTHONPATH=$(PYTHONPATH)
127 xml: $(outdir)/notation/notation.xml $(outdir)/internals/internals.xml
131 rm -f $(INFO_IMAGES_DIR)
136 local-WWW-1: $(OUT_TEXINFO_MANUALS) $(PDF_FILES) info
138 local-WWW-2: txt-to-html $(OUT_HTML_FILES) $(DEEP_HTML_FILES) $(source-links) $(OMF_FILES)
145 # cd $(outdir) rule gets bit hairy for --srcdir configure builds
147 $(foreach a, $(README_TOP_FILES), cp $(top-src-dir)/$(a) $(outdir)/$(a).txt && ) true
148 $(PYTHON) $(step-bindir)/text2html.py $(OUT_TXT_FILES)
151 ## Extra images dependencies
152 $(OUT_TEXINFO_MANUALS): $(outdir)/pictures
155 $(MAKE) -C pictures WWW-1
156 ln -sf ../pictures/$(outdir) $@
159 # Ugh, using '%' twice not possible
160 $(outdir)/notation/notation.xml: $(outdir)/notation.texi
162 $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<
164 $(outdir)/internals/internals.xml: $(outdir)/internals.texi
166 $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<
168 $(outdir)/learning.texi $(outdir)/notation.texi: $(OUT_PDF_IMAGES)
170 $(foreach manual, $(MANUAL_SUBDIRS),\
171 $(eval $(outdir)/(manual).texi: $(call src-wildcard,$(manual)/*.ite??)))
182 ln -sf $(depth)/.. $(@)
185 ## Snippets rules idiosyncrases
186 $(outdir)/%.itely: snippets/%-intro.itely snippets/%.snippet-list
187 xargs $(LYS_TO_TELY) -f doctitle,texidoc,verbatim --name=$@ --template=$< < $(filter %.snippet-list, $^)
189 $(outdir)/snippets.texi: $(GENERATED_ITELY_FILES) $(SNIPPET_LY_FILES)
191 $(outdir)/%.bib: %.bib
194 ## notation.texi deps
195 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
196 $(MAKE) -C $(top-src-dir)/mf
198 $(outdir)/notation.texi: $(outdir)/ly-grammar.txt
200 ## Rules for the automatically generated documentation
201 $(outdir)/ly-grammar.txt: $(top-src-dir)/lily/parser.yy
202 cd $(outdir) && $(BISON) -v $<
203 $(auxscript-dir)/yyout2grammar.py $(outdir)/parser.output $@
205 # There used to be a dependency on a dummy target, to force a rebuild
206 # of internals every time. however, this triggers
207 # compilation during install, which is a bad thing (tm).
209 $(outdir)/internals.texi: $(LILYPOND_BINARY)
210 cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
213 ###############################################
214 # Documentation and translations maintenance #
215 ###############################################
219 all-translations-update: po-update translation-status
220 $(foreach lang, $(LANGS), make ISOLANG=$(lang) skeleton-update snippet-update &&) true
223 CHECK_TRANSLATION_FLAGS = --no-color
228 @if (( $$(file -b $(ISOLANG)) == directory )) 2>/dev/null; \
229 then echo "Error: $(ISOLANG) directory already exists. Exiting." ; \
232 mkdir -p $(ISOLANG)/learning
233 cp fr/GNUmakefile $(ISOLANG)
234 cp fr/learning/GNUmakefile $(ISOLANG)/learning
235 sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/learning/GNUmakefile
236 $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext ../learning.tely
237 mv $(outdir)/*.*tely $(ISOLANG)/learning
238 msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
239 cp po/lilypond-doc.pot po/$(ISOLANG).po
240 @echo "*** Please add a language definition for $(ISOLANG) in python/langdefs.py ***"
242 CHECKED_FILES = $(ISOLANG)/index.html.in $(foreach i,learning notation application, \
243 $(shell find $(ISOLANG)/$(manual) -name '*.*te??' -not -wholename '*out-www*')) \
244 $(shell find $(ISOLANG)/texidocs/ -name '*.texidoc')
246 TELY_FILES = $(call src-wildcard,$(ISOLANG)/*.tely)
248 $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) --skeleton $(TELY_FILES:$(ISOLANG)/%.tely=../%.tely)
249 $(auxscript-dir)/texi-skeleton-update.py $(ISOLANG) $(outdir)
252 $(auxscript-dir)/update-snippets.py user $(ISOLANG) '*.itely'
254 DOCUMENTS_INCLUDES:=-I $(ISOLANG) \
255 -I $(top-build-dir)/Documentation/$(ISOLANG)/out-www \
256 -I $(top-src-dir)/Documentation/snippets \
257 -I $(top-build-dir)/Documentation/out-www
259 else # ISOLANG is empty
261 DOCUMENTS_INCLUDES:=-I . \
262 -I $(top-build-dir)/Documentation/out-www \
263 -I $(top-src-dir)/Documentation/snippets \
264 -I $(top-build-dir)/Documentation/snippets/out-www
269 $(auxscript-dir)/check_texi_refs.py --batch \
270 $(DOCUMENTS_INCLUDES) $(auxpython-dir)/manuals_definitions.py
273 $(auxscript-dir)/check_texi_refs.py --auto-fix \
274 $(DOCUMENTS_INCLUDES) $(auxpython-dir)/manuals_definitions.py
277 ISOLANG=$(ISOLANG) $(auxscript-dir)/check_translation.py $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES)
280 ISOLANG=$(ISOLANG) $(auxscript-dir)/check_translation.py --update $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES)
283 make -C po out=www messages
284 $(auxscript-dir)/translations-status.py