LSR: Update.
[lilypond.git] / Documentation / GNUmakefile
blob2f99e82fd77c0ac53a88e1a3a1c00a818ddce9d8
1 depth = ..
3 NAME = documentation
4 LANGS = $(shell $(PYTHON) $(top-src-dir)/python/langdefs.py)
5 SUBDIRS=user bibliography pictures topdocs misc po $(LANGS)
6 STEPMAKE_TEMPLATES=documentation texinfo tex
7 LOCALSTEPMAKE_TEMPLATES=lilypond ly
8 LILYPOND_BOOK_FLAGS=--extra-options '-e "(ly:set-option (quote internal-type-checking) \#t)"'
9 README_TOP_FILES= DEDICATION THANKS
10 EXTRA_DIST_FILES= TRANSLATION
12 include $(depth)/make/stepmake.make
14 HTML_PAGE_NAMES= index devel translations
15 OUT_HTML_FILES= $(HTML_PAGE_NAMES:%=$(outdir)/%.html)
16 OUT_CSS_FILES= $(CSS_FILES:%.css=$(outdir)/%.css)
18 default: local-doc
20 local-WWW-2: txt-to-html $(OUT_HTML_FILES)
22 local-WWW-clean: deep-WWW-clean
24 deep-WWW-clean:
25 rm -rf $(outdir)/wiki-dump
27 OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
29 # cd $(outdir) rule gets bit hairy for --srcdir configure builds
30 txt-to-html:
31 $(foreach a, $(README_TOP_FILES), cp $(top-src-dir)/$(a) $(outdir)/$(a).txt && ) true
32 $(PYTHON) $(step-bindir)/text2html.py $(OUT_TXT_FILES)
34 $(OUT_HTML_FILES): $(OUT_CSS_FILES)
36 $(outdir)/%.css: %.css
37 ln -f $< $@
39 po-update:
40 make -C po po-update
42 all-translations-update: po-update translation-status
43 $(foreach lang, $(LANGS), make ISOLANG=$(lang) skeleton-update snippet-update &&) true
45 ifneq ($(ISOLANG),)
46 new-lang:
47 @if (( $$(file -b $(ISOLANG)) == directory )) 2>/dev/null; \
48 then echo "Error: $(ISOLANG) directory already exists. Exiting." ; \
49 exit 3 ; \
51 mkdir -p $(ISOLANG)/user
52 cp fr/GNUmakefile $(ISOLANG)
53 cp fr/user/GNUmakefile $(ISOLANG)/user
54 sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/user/GNUmakefile
55 $(PYTHON) $(buildscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext ../user/lilypond-learning.tely
56 mv $(outdir)/*.*tely $(ISOLANG)/user
57 msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
58 cp po/lilypond-doc.pot po/$(ISOLANG).po
59 @echo "*** Please add a language definition for $(ISOLANG) in python/langdefs.py ***"
61 CHECKED_FILES = $(ISOLANG)/index.html.in $(shell find $(ISOLANG)/user/ -maxdepth 1 -name '*.*te??')
63 ifneq ($(NO_COLOR),)
64 CHECK_TRANSLATION_FLAGS = --no-color
65 endif
67 TELY_FILES = $(call src-wildcard,$(ISOLANG)/user/*.tely)
68 skeleton-update:
69 $(PYTHON) $(buildscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) --skeleton $(TELY_FILES:$(ISOLANG)/user/%.tely=../user/%.tely)
70 $(PYTHON) $(buildscript-dir)/texi-skeleton-update.py $(ISOLANG)/user $(outdir)
72 snippet-update:
73 $(PYTHON) $(buildscript-dir)/update-snippets.py user $(ISOLANG)/user '*.itely'
75 DOCUMENTS_INCLUDES:=-I $(ISOLANG)/user \
76 -I $(top-build-dir)/Documentation/$(ISOLANG)/user/out-www \
77 -I $(top-src-dir)/input/lsr \
78 -I $(top-build-dir)/input/lsr/out-www \
79 -I user -I $(top-build-dir)/Documentation/user/out-www
81 else # ISOLANG is empty
83 DOCUMENTS_INCLUDES:=-I user \
84 -I $(top-build-dir)/Documentation/user/out-www \
85 -I $(top-src-dir)/input/lsr \
86 -I $(top-build-dir)/input/lsr/out-www
88 endif # ISOLANG
90 check-xrefs:
91 $(PYTHON) $(buildscript-dir)/check_texi_refs.py --batch \
92 $(DOCUMENTS_INCLUDES) $(buildscript-dir)/manuals_definitions.py
94 fix-xrefs:
95 $(PYTHON) $(buildscript-dir)/check_texi_refs.py --auto-fix \
96 $(DOCUMENTS_INCLUDES) $(buildscript-dir)/manuals_definitions.py
98 check-translation:
99 $(PYTHON) $(buildscript-dir)/check_translation.py $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES)
101 update-translation:
102 $(PYTHON) $(buildscript-dir)/check_translation.py --update $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES)
104 translation-status:
105 make -C po out=www messages
106 $(PYTHON) $(buildscript-dir)/translations-status.py
108 local-help: extra-local-help
110 extra-local-help:
111 @echo -e "\
112 check-xrefs [ISOLANG=LL] validate Texinfo cross-references\n\
113 fix-xrefs [ISOLANG=LL] interactively fix Texinfo cross-references (use with caution)\n\
115 Translations specific targets (see TRANSLATION for details):\n\
116 new-lang ISOLANG=LL create and initialize subdirectory \'LL' for language \'LL\n\
117 po-update update and replace PO files for documentation with msgmerged versions\n\
118 check-translation ISOLANG=LL show changes in English docs since last translation update\n\
119 update-translation ISOLANG=LL call $$$$EDITOR to help updating the translation\n\
120 skeleton-update ISOLANG=LL update Texinfo skeleton files\n\
121 snippet-update ISOLANG=LL update ly snippets in Texinfo translation according to\n\
122 docs in English (use with caution)\n\
124 LL refers to the desired locale (most often only the ISO 639 language code).\n"
126 info:
127 $(MAKE) -C user info