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