]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / Documentation / user / GNUmakefile
1 depth=../..
2
3 LATEX_FILES =$(call src-wildcard,*.latex)
4
5
6 EXTRA_DIST_FILES = $(LATEX_FILES) $(IMAGES) $(EPS_ILLUSTRATIONS)
7 EXTRA_DIST_FILES += README.txt writing-texinfo.txt policy.txt writing-sections.txt
8
9 IMAGES=$(call src-wildcard,*.png)
10 EPS_ILLUSTRATIONS=context-example.eps
11 PDF_ILLUSTRATIONS=context-example.pdf
12
13 OUT_PDF_IMAGES=$(IMAGES:%.png=$(outdir)/%.pdf) $(addprefix $(outdir)/,$(PDF_ILLUSTRATIONS))
14
15 OUT_PNG_IMAGES=$(OUT_PDF_IMAGES:%.pdf=%.png)
16
17 OUT_MASTER_TEXI_FILES = $(outdir)/lilypond-internals.texi
18 OUT_TEXI_FILES=$(ITEXI_FILES:%.itexi=$(outdir)/%.texi)\
19  $(ITELY_FILES:%.itely=$(outdir)/%.texi)
20
21 HTML_FILES = $(TELY_FILES:%.tely=$(outdir)/%-big-page.html)\
22  $(outdir)/lilypond-internals-big-page.html
23
24 # todo: add latex.
25 PDF_FILES = $(TELY_FILES:%.tely=$(outdir)/%.pdf)\
26  $(outdir)/lilypond-internals.pdf
27
28 MAIN_INFO_DOC = lilypond
29 INFO_DOCS = lilypond lilypond-internals music-glossary lilypond-program lilypond-learning
30 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
31
32 TEXI2PDF_FLAGS = -I $(top-src-dir)/Documentation/user
33
34 ifeq ($(out),www)
35 INFO_IMAGES_DIR = lilypond
36 DEST_INFO_IMAGES_SUBDIR = Documentation/user
37 endif
38
39 STEPMAKE_TEMPLATES=texinfo omf documentation
40 OMF_FILES += $(outdir)/lilypond-internals.html.omf
41
42 LOCALSTEPMAKE_TEMPLATES=lilypond ly
43
44 include $(depth)/make/stepmake.make
45
46 default:
47
48 info: $(INFO_FILES)
49         @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
50         @echo export PYTHONPATH=$(PYTHONPATH)
51
52 xml: $(outdir)/lilypond/lilypond.xml $(outdir)/lilypond-internals/lilypond-internals.xml
53
54
55 local-clean:
56         rm -f $(INFO_IMAGES_DIR)
57
58 local-help: extra-local-help
59
60 extra-local-help:
61         @echo -e "\
62   info        update info pages\n\
63   xml         update Docbook xml documentation\n\
64 "
65
66 #
67 # Split manuals in HTML
68 #
69 $(outdir)/lilypond/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
70 $(outdir)/lilypond-learning/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
71
72
73 #
74 # Manuals in one big HTML page
75 #
76 $(outdir)/lilypond-big-page.html: $(OUT_PNG_IMAGES)
77 $(outdir)/lilypond-learning-big-page.html: $(OUT_PNG_IMAGES)
78
79 $(outdir)/lilypond.xml: $(outdir)/lilypond.texi
80         mkdir -p $(dir $@)
81         $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ --docbook $<
82
83 $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internals.texi
84         mkdir -p $(dir $@)
85         $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(outdir)/lilypond-internals --docbook $<
86
87 $(outdir)/lilypond.pdf $(outdir)/lilypond-learning.pdf: $(OUT_PDF_IMAGES)
88
89 $(outdir)/%.png: %.png
90         convert -depth 8 -geometry 50x50% $< $@
91
92 $(outdir)/%.png: %.eps
93         gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
94
95 $(outdir)/%.pdf: %.png
96         convert -depth 8 $< $@
97
98 $(outdir)/%.pdf: %.eps
99         gs -dAutoRotatePages=/None -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $<
100
101
102 DEEP_HTML_FILES =\
103  $(outdir)/lilypond/index.html\
104  $(outdir)/lilypond-internals/index.html\
105  $(outdir)/music-glossary/index.html\
106  $(outdir)/lilypond-program/index.html\
107  $(outdir)/lilypond-learning/index.html
108
109 # Symlinks to refer to external source documents from split and non-split HTML
110 source-links = $(outdir)/source $(outdir)/lilypond/source $(outdir)/music-glossary/source \
111  $(outdir)/lilypond-program/source $(outdir)/lilypond-learning/source $(outdir)/lilypond-internals/source
112
113 $(outdir)/source:
114         @rm -f $(@)
115         ln -sf $(depth) $(@)
116
117 $(outdir)/%/source:
118         @rm -f $(@)
119         mkdir -p $(dir $@)
120         ln -sf $(depth)/.. $(@)
121
122 local-WWW-1: $(MASTER_TEXI_FILES) $(PDF_FILES) info
123
124 local-WWW-2: $(HTML_FILES) $(DEEP_HTML_FILES) $(source-links)
125
126 $(outdir)/%.bib: %.bib
127         ln -f $< $@
128
129 # lilypond.texi deps
130 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
131         $(MAKE) -C $(top-src-dir)/mf
132
133 $(outdir)/lilypond.texi $(outdir)/lilypond-program.texi $(outdir)/lilypond-learning.texi $(outdir)/music-glossary.texi: $(ITELY_FILES) $(ITEXI_FILES)
134
135
136 # Rules for the automatically generated documentation
137
138 # There used to be a dependency on a dummy target, to force a rebuild
139 # of lilypond-internals every time.  however, this triggers
140 # compilation during install, which is a bad thing (tm).
141
142 $(outdir)/lilypond-internals.texi: $(LILYPOND_BINARY)
143         cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
144
145 .SECONDARY: