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