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