4 LANGS = $(shell $(PYTHON) $(top-src-dir)/python/langdefs.py)
5 SUBDIRS = application contributor learning notation snippets\
6 bibliography pictures misc po $(LANGS)
7 STEPMAKE_TEMPLATES = documentation texinfo tex omf
8 LOCALSTEPMAKE_TEMPLATES = lilypond ly
12 LILYPOND_BOOK_FLAGS = --extra-options '-e "(ly:set-option (quote internal-type-checking) \#t)"'
15 -I $(top-build-dir)/Documentation/$(outconfbase)
16 $(outdir)/snippets-big-page.html: TEXI2HTML_FLAGS += -D short_toc
17 $(outdir)/snippets/index..html: TEXI2HTML_FLAGS += -D short_toc
19 ### Extra source files
21 README_TOP_FILES= DEDICATION THANKS
22 LATEX_FILES =$(call src-wildcard,*.latex)
23 IMAGES=$(call src-wildcard,*.png)
24 EPS_ILLUSTRATIONS=context-example.eps
26 IN_ITELY_FILES = $(call src-wildcard,snippets/*-intro.itely)
27 SNIPPET_LY_FILES = $(call src-wildcard,snippets/*.ly)
33 GENERATED_ITELY_FILES = $(IN_ITELY_FILES:snippets/%-intro.itely=$(outdir)/%.itely)
35 OUT_PDF_IMAGES = $(IMAGES:%.png=$(outdir)/%.pdf)
36 OUT_PDF_IMAGES += $(EPS_ILLUSTRATIONS:%.eps=$(outdir)/%.pdf)
37 OUT_PNG_IMAGES = $(OUT_PDF_IMAGES:%.pdf=%.png)
39 XREF_MAPS_FILES += $(XREF_MAPS_DIR)/internals.xref-map
40 OMF_FILES += $(outdir)/internals.html.omf $(outdir)/internals.pdf.omf
44 OUT_MASTER_TEXI_FILES = $(outdir)/internals.texi
45 #OUT_TEXI_FILES=$(ITEXI_FILES:%.itexi=$(outdir)/%.texi)\
46 # $(ITELY_FILES:%.itely=$(outdir)/%.texi)
49 $(TELY_FILES:%.tely=$(outdir)/%-big-page.html)\
50 $(TEXI_FILES:%.texi=$(outdir)/%-big-page.html)\
51 $(outdir)/internals-big-page.html
54 $(TELY_FILES:%.tely=$(outdir)/%.pdf)\
55 $(TELY_FILES:%.texi=$(outdir)/%.pdf)\
56 $(outdir)/internals.pdf
59 HTML_PAGE_NAMES= index translations devel
60 OUT_HTML_FILES= $(HTML_PAGE_NAMES:%=$(outdir)/%.html)
61 OUT_CSS_FILES= $(CSS_FILES:%.css=$(outdir)/%.css)
63 MAIN_INFO_DOC = lilypond-notation
64 INFO_DOCS = lilypond-application lilypond-changes lilypond-contributor lilypond-internals \
65 lilypond-learning lilypond-notation music-glossary
67 INFO_DOCS += lilypond-snippets
69 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
72 INFO_IMAGES_DIR = lilypond
73 DEST_INFO_IMAGES_SUBDIR = Documentation/
77 include $(depth)/make/stepmake.make
83 local-WWW-2: txt-to-html $(OUT_HTML_FILES)
85 local-WWW-clean: deep-WWW-clean
88 rm -rf $(outdir)/wiki-dump
91 OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
93 # cd $(outdir) rule gets bit hairy for --srcdir configure builds
95 $(foreach a, $(README_TOP_FILES), cp $(top-src-dir)/$(a) $(outdir)/$(a).txt && ) true
96 $(PYTHON) $(step-bindir)/text2html.py $(OUT_TXT_FILES)
98 $(OUT_HTML_FILES): $(OUT_CSS_FILES)
100 $(outdir)/%.css: %.css
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"
123 #####################################
127 @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
128 @echo export PYTHONPATH=$(PYTHONPATH)
130 xml: $(outdir)/notation/notation.xml $(outdir)/internals/internals.xml
134 rm -f $(INFO_IMAGES_DIR)
138 # Split manuals in HTML
140 $(outdir)/learning/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
141 $(outdir)/notation/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
145 # Manuals in one big HTML page
147 $(outdir)/learning-big-page.html: $(OUT_PNG_IMAGES)
148 $(outdir)/notation-big-page.html: $(OUT_PNG_IMAGES)
150 # Ugh, using '%' twice not possible
151 $(outdir)/notation/notation.xml: $(outdir)/notation.texi
153 $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<
155 $(outdir)/internals/internals.xml: $(outdir)/internals.texi
157 $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<
159 $(outdir)/learning.texi $(outdir)/notation.texi: $(OUT_PDF_IMAGES)
161 $(foreach manual, application contributor learning notation,\
162 $(eval $(outdir)/(i).texi: $(call src-wildcard,$(i)/*.ite??)))
164 $(outdir)/%.png: %.png
165 convert -depth 8 -geometry 50x50% $< $@
167 $(outdir)/%.png: %.eps
168 gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
170 $(outdir)/%.pdf: %.png
171 convert -depth 8 $< $@
173 $(outdir)/%.pdf: %.eps
174 gs -dAutoRotatePages=/None -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $<
177 ### Splitted HTML manuals
180 $(outdir)/application/index.html\
181 $(outdir)/internals/index.html\
182 $(outdir)/learning/index.html\
183 $(outdir)/notation/index.html\
184 $(outdir)/music-glossary/index.html\
185 $(outdir)/snippets/index.html
187 # Symlinks to refer to external source documents from split and non-split HTML
188 source-links = $(outdir)/source $(outdir)/notation/source $(outdir)/music-glossary/source \
189 $(outdir)/application/source $(outdir)/learning/source $(outdir)/internals/source \
190 $(outdir)/snippets/source
199 ln -sf $(depth)/.. $(@)
201 ################################
202 ### Snippets rules idiosyncrases
204 $(outdir)/%.itely: snippets/%-intro.itely snippets/%.snippet-list
205 xargs $(LYS_TO_TELY) -f doctitle,texidoc,verbatim --name=$@ --template=$< < $(filter %.snippet-list, $^)
207 $(outdir)/snippets.texi: $(GENERATED_ITELY_FILES) $(SNIPPET_LY_FILES)
213 local-WWW-1: $(MASTER_TEXI_FILES) $(PDF_FILES) info
215 local-WWW-2: $(HTML_FILES) $(DEEP_HTML_FILES) $(source-links)
218 $(outdir)/%.bib: %.bib
222 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
223 $(MAKE) -C $(top-src-dir)/mf
225 $(outdir)/notation.texi: $(outdir)/ly-grammar.txt
227 # Rules for the automatically generated documentation
229 $(outdir)/ly-grammar.txt: $(top-src-dir)/lily/parser.yy
230 cd $(outdir) && $(BISON) -v $<
231 $(auxscript-dir)/yyout2grammar.py $(outdir)/parser.output $@
233 # There used to be a dependency on a dummy target, to force a rebuild
234 # of internals every time. however, this triggers
235 # compilation during install, which is a bad thing (tm).
237 $(outdir)/internals.texi: $(LILYPOND_BINARY)
238 cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
243 #####################################
244 # Translations maintenance targets #
245 #####################################
249 all-translations-update: po-update translation-status
250 $(foreach lang, $(LANGS), make ISOLANG=$(lang) skeleton-update snippet-update &&) true
253 CHECK_TRANSLATION_FLAGS = --no-color
258 @if (( $$(file -b $(ISOLANG)) == directory )) 2>/dev/null; \
259 then echo "Error: $(ISOLANG) directory already exists. Exiting." ; \
262 mkdir -p $(ISOLANG)/user
263 cp fr/GNUmakefile $(ISOLANG)
264 cp fr/user/GNUmakefile $(ISOLANG)/user
265 sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/user/GNUmakefile
266 $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext ../learning.tely
267 mv $(outdir)/*.*tely $(ISOLANG)/user
268 msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
269 cp po/lilypond-doc.pot po/$(ISOLANG).po
270 @echo "*** Please add a language definition for $(ISOLANG) in python/langdefs.py ***"
272 CHECKED_FILES = $(ISOLANG)/index.html.in $(shell find $(ISOLANG)/user/ -maxdepth 1 -name '*.*te??') \
273 $(shell find $(depth)/input/texidocs/ -name '*.texidoc')
275 TELY_FILES = $(call src-wildcard,$(ISOLANG)/user/*.tely)
277 $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) --skeleton $(TELY_FILES:$(ISOLANG)/user/%.tely=../user/%.tely)
278 $(auxscript-dir)/texi-skeleton-update.py $(ISOLANG)/user $(outdir)
281 $(auxscript-dir)/update-snippets.py user $(ISOLANG)/user '*.itely'
283 DOCUMENTS_INCLUDES:=-I $(ISOLANG)/user \
284 -I $(top-build-dir)/Documentation/$(ISOLANG)/user/out-www \
285 -I $(top-src-dir)/input/lsr \
286 -I $(top-build-dir)/input/lsr/out-www \
287 -I user -I $(top-build-dir)/Documentation/user/out-www
289 else # ISOLANG is empty
291 DOCUMENTS_INCLUDES:=-I user \
292 -I $(top-build-dir)/Documentation/user/out-www \
293 -I $(top-src-dir)/input/lsr \
294 -I $(top-build-dir)/input/lsr/out-www
299 $(auxscript-dir)/check_texi_refs.py --batch \
300 $(DOCUMENTS_INCLUDES) $(auxpython-dir)/manuals_definitions.py
303 $(auxscript-dir)/check_texi_refs.py --auto-fix \
304 $(DOCUMENTS_INCLUDES) $(auxpython-dir)/manuals_definitions.py
307 ISOLANG=$(ISOLANG) $(auxscript-dir)/check_translation.py $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES)
310 ISOLANG=$(ISOLANG) $(auxscript-dir)/check_translation.py --update $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES)
313 make -C po out=www messages
314 $(auxscript-dir)/translations-status.py