]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/GNUmakefile
Merge commit 'origin/lilypond/translation'
[lilypond.git] / Documentation / GNUmakefile
1 depth = ..
2
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
11
12 include $(depth)/make/stepmake.make
13
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)
17
18 default: local-doc
19
20 local-WWW-2: txt-to-html $(OUT_HTML_FILES)
21
22 local-WWW-clean: deep-WWW-clean
23
24 deep-WWW-clean:
25         rm -rf $(outdir)/wiki-dump
26
27 OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
28
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)
33
34 $(OUT_HTML_FILES): $(OUT_CSS_FILES)
35
36 $(outdir)/%.css: %.css
37         ln -f $< $@
38
39 po-update:
40         make -C po po-update
41
42 all-translations-update: po-update translation-status
43         $(foreach lang, $(LANGS), make ISOLANG=$(lang) skeleton-update snippet-update &&) true
44
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 ; \
50         fi
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  ***"
60
61 CHECKED_FILES = $(ISOLANG)/index.html.in $(shell find $(ISOLANG)/user/ -maxdepth 1 -name '*.*te??')
62
63 TELY_FILES = $(call src-wildcard,$(ISOLANG)/user/*.tely)
64 skeleton-update:
65         $(PYTHON) $(buildscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) --skeleton $(TELY_FILES:$(ISOLANG)/user/%.tely=../user/%.tely)
66         $(PYTHON) $(buildscript-dir)/texi-skeleton-update.py $(ISOLANG)/user $(outdir)
67
68 snippet-update:
69         $(PYTHON) $(buildscript-dir)/update-snippets.py user $(ISOLANG)/user '*.itely'
70
71 DOCUMENTS_INCLUDES:=-I $(ISOLANG)/user \
72 -I $(top-build-dir)/Documentation/$(ISOLANG)/user/out-www \
73 -I $(top-src-dir)/input/lsr \
74 -I $(top-build-dir)/input/lsr/out-www \
75 -I user -I $(top-build-dir)/Documentation/user/out-www
76
77 else # ISOLANG is empty
78
79 DOCUMENTS_INCLUDES:=-I user \
80 -I $(top-build-dir)/Documentation/user/out-www \
81 -I $(top-src-dir)/input/lsr \
82 -I $(top-build-dir)/input/lsr/out-www
83
84 endif # ISOLANG
85
86 check-xrefs:
87         $(PYTHON) $(buildscript-dir)/check_texi_refs.py --batch \
88         $(DOCUMENTS_INCLUDES) $(buildscript-dir)/manuals_definitions.py
89
90 fix-xrefs:
91         $(PYTHON) $(buildscript-dir)/check_texi_refs.py --auto-fix \
92         $(DOCUMENTS_INCLUDES) $(buildscript-dir)/manuals_definitions.py
93
94 check-translation:
95         $(PYTHON) $(buildscript-dir)/check_translation.py $(CHECKED_FILES)
96
97 update-translation:
98         $(PYTHON) $(buildscript-dir)/check_translation.py --update $(CHECKED_FILES)
99
100 translation-status:
101         make -C po out=www messages
102         $(PYTHON) $(buildscript-dir)/translations-status.py
103
104 local-help: extra-local-help
105
106 extra-local-help:
107         @echo -e "\
108   check-xrefs [ISOLANG=LL] validate Texinfo cross-references\n\
109   fix-xrefs [ISOLANG=LL]   interactively fix Texinfo cross-references (use with caution)\n\
110 \n\
111 Translations specific targets (see TRANSLATION for details):\n\
112   new-lang ISOLANG=LL  create and initialize subdirectory \'LL' for language \'LL\n\
113   po-update            update and replace PO files for documentation with msgmerged versions\n\
114   check-translation ISOLANG=LL   show changes in English docs since last translation update\n\
115   update-translation ISOLANG=LL  call $$$$EDITOR to help updating the translation\n\
116   skeleton-update ISOLANG=LL     update Texinfo skeleton files\n\
117   snippet-update ISOLANG=LL      update ly snippets in Texinfo translation according to\n\
118                               docs in English (use with caution)\n\
119 \n\
120 LL refers to the desired locale (most often only the ISO 639 language code).\n"
121
122 info:
123         $(MAKE) -C user info