]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/GNUmakefile
Merge branch 'master' of carldsorensen@git.sv.gnu.org:/srv/git/lilypond into ralph
[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 ($(NO_COLOR),)
46 CHECK_TRANSLATION_FLAGS = --no-color
47 endif
48
49 ifneq ($(ISOLANG),)
50 new-lang:
51         @if (( $$(file -b $(ISOLANG)) == directory )) 2>/dev/null; \
52         then echo "Error: $(ISOLANG) directory already exists. Exiting." ; \
53         exit 3 ; \
54         fi
55         mkdir -p $(ISOLANG)/user
56         cp fr/GNUmakefile $(ISOLANG)
57         cp fr/user/GNUmakefile $(ISOLANG)/user
58         sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/user/GNUmakefile
59         $(PYTHON) $(buildscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext ../user/lilypond-learning.tely
60         mv $(outdir)/*.*tely $(ISOLANG)/user
61         msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
62         cp po/lilypond-doc.pot po/$(ISOLANG).po
63         @echo "***  Please add a language definition for $(ISOLANG) in python/langdefs.py  ***"
64
65 CHECKED_FILES = $(ISOLANG)/index.html.in $(shell find $(ISOLANG)/user/ -maxdepth 1 -name '*.*te??')
66
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)
71
72 snippet-update:
73         $(PYTHON) $(buildscript-dir)/update-snippets.py user $(ISOLANG)/user '*.itely'
74
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
80
81 else # ISOLANG is empty
82
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
87
88 endif # ISOLANG
89
90 check-xrefs:
91         $(PYTHON) $(buildscript-dir)/check_texi_refs.py --batch \
92         $(DOCUMENTS_INCLUDES) $(buildscript-dir)/manuals_definitions.py
93
94 fix-xrefs:
95         $(PYTHON) $(buildscript-dir)/check_texi_refs.py --auto-fix \
96         $(DOCUMENTS_INCLUDES) $(buildscript-dir)/manuals_definitions.py
97
98 check-translation:
99         $(PYTHON) $(buildscript-dir)/check_translation.py $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES)
100
101 update-translation:
102         $(PYTHON) $(buildscript-dir)/check_translation.py --update $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES)
103
104 translation-status:
105         make -C po out=www messages
106         $(PYTHON) $(buildscript-dir)/translations-status.py
107
108 local-help: extra-local-help
109
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\
114 \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\
123 \n\
124 LL refers to the desired locale (most often only the ISO 639 language code).\n"
125
126 info:
127         $(MAKE) -C user info