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