]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/GNUmakefile
Update 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= texinfo.css TRANSLATION
11
12 include $(depth)/make/stepmake.make
13
14 default: local-doc
15
16 local-WWW: txt-to-html $(outdir)/index.html $(outdir)/devel.html
17
18 local-WWW-clean: deep-WWW-clean
19
20 deep-WWW-clean:
21         rm -rf $(outdir)/wiki-dump
22
23 OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
24
25 # cd $(outdir) rule gets bit hairy for --srcdir configure builds
26 txt-to-html:
27         $(foreach a, $(README_TOP_FILES), cp $(top-src-dir)/$(a) $(outdir)/$(a).txt && ) true
28         $(PYTHON) $(step-bindir)/text2html.py $(OUT_TXT_FILES)
29
30 po-update:
31         make -C po po-update
32
33 all-translations-update: po-update translation-status
34         $(foreach lang, $(LANGS), make ISOLANG=$(lang) skeleton-update snippet-update &&) true
35
36 ifneq ($(ISOLANG),)
37 new-lang:
38         @if (( $$(file -b $(ISOLANG)) == directory )) 2>/dev/null; \
39         then echo "Error: $(ISOLANG) directory already exists. Exiting." ; \
40         exit 3 ; \
41         fi
42         mkdir -p $(ISOLANG)/user
43         cp fr/GNUmakefile $(ISOLANG)
44         cp fr/user/GNUmakefile $(ISOLANG)/user
45         sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/user/GNUmakefile
46         $(PYTHON) $(buildscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext ../user/lilypond-learning.tely
47         mv $(outdir)/*.*tely $(ISOLANG)/user
48         msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
49         cp po/lilypond-doc.pot po/$(ISOLANG).po
50         @echo "***  Please add a language definition for $(ISOLANG) in python/langdefs.py  ***"
51
52 CHECKED_FILES = $(ISOLANG)/index.html.in $(shell find $(ISOLANG)/user/ -maxdepth 1 -name '*.*te??')
53
54 TELY_FILES = $(call src-wildcard,$(ISOLANG)/user/*.tely)
55 skeleton-update:
56         $(PYTHON) $(buildscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) --skeleton $(TELY_FILES:$(ISOLANG)/user/%.tely=../user/%.tely)
57         $(PYTHON) $(buildscript-dir)/texi-skeleton-update.py $(ISOLANG)/user $(outdir)
58
59 snippet-update:
60         $(PYTHON) $(buildscript-dir)/update-snippets.py user $(ISOLANG)/user '*.itely'
61
62 DOCUMENTS_INCLUDES:=-I $(ISOLANG)/user \
63 -I $(top-build-dir)/Documentation/$(ISOLANG)/user/out-www \
64 -I $(top-src-dir)/input/lsr \
65 -I $(top-build-dir)/input/lsr/out-www \
66 -I user -I $(top-build-dir)/Documentation/user/out-www
67
68 else # ISOLANG is empty
69
70 DOCUMENTS_INCLUDES:=-I user \
71 -I $(top-build-dir)/Documentation/user/out-www \
72 -I $(top-src-dir)/input/lsr \
73 -I $(top-build-dir)/input/lsr/out-www
74
75 endif # ISOLANG
76
77 check-xrefs:
78         $(PYTHON) $(buildscript-dir)/check_texi_refs.py --batch \
79         $(DOCUMENTS_INCLUDES) $(buildscript-dir)/manuals_definitions.py
80
81 fix-xrefs:
82         $(PYTHON) $(buildscript-dir)/check_texi_refs.py --auto-fix \
83         $(DOCUMENTS_INCLUDES) $(buildscript-dir)/manuals_definitions.py
84
85 check-translation:
86         $(PYTHON) $(buildscript-dir)/check_translation.py $(buildscript-dir) $(CHECKED_FILES)
87
88 update-translation:
89         $(PYTHON) $(buildscript-dir)/check_translation.py --update $(buildscript-dir) $(CHECKED_FILES)
90
91 translation-status:
92         make -C po out=www messages
93         $(PYTHON) $(buildscript-dir)/translations-status.py $(buildscript-dir)
94
95 local-help: extra-local-help
96
97 extra-local-help:
98         @echo -e "\
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 \n\
102 Translations specific targets (see TRANSLATION for details):\n\
103   new-lang ISOLANG=LL  create and initialize subdirectory \'LL' for language \'LL\n\
104   po-update            update and replace PO files for documentation with msgmerged versions\n\
105   check-translation ISOLANG=LL   show changes in English docs since last translation update\n\
106   update-translation ISOLANG=LL  call $$$$EDITOR to help updating the translation\n\
107   skeleton-update ISOLANG=LL     update Texinfo skeleton files\n\
108   snippet-update ISOLANG=LL      update ly snippets in Texinfo translation according to\n\
109                               docs in English (use with caution)\n\
110 \n\
111 LL refers to the desired locale (most often only the ISO 639 language code).\n"
112
113 info:
114         $(MAKE) -C user info