]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
Fix makeinfo --html doc build.
[lilypond.git] / Documentation / user / GNUmakefile
1 depth=../..
2
3 LATEX_FILES =$(call src-wildcard,*.latex)
4
5
6 EXTRA_DIST_FILES= $(LATEX_FILES) $(IMAGES) README.txt $(EPS_ILLUSTRATIONS)
7
8 IMAGES=$(call src-wildcard,*.png)
9 EPS_ILLUSTRATIONS=context-example.eps
10 PDF_ILLUSTRATIONS=context-example.pdf
11
12 OUT_PDF_IMAGES=$(IMAGES:%.png=$(outdir)/%.pdf) $(addprefix $(outdir)/,$(PDF_ILLUSTRATIONS))
13
14 OUT_PNG_IMAGES=$(OUT_PDF_IMAGES:%.pdf=%.png)
15
16 OUT_TEXI_FILES=$(ITEXI_FILES:%.itexi=$(outdir)/%.texi)\
17  $(ITELY_FILES:%.itely=$(outdir)/%.texi)
18 HTML_FILES = $(TELY_FILES:%.tely=$(outdir)/%-big-page.html)\
19  $(outdir)/lilypond-internals-big-page.html
20
21 # todo: add latex.
22 PDF_FILES = $(TELY_FILES:%.tely=$(outdir)/%.pdf)
23
24 INFO_DOCS = lilypond lilypond-internals music-glossary lilypond-program lilypond-learning
25 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
26
27 STEPMAKE_TEMPLATES=tex texinfo omf documentation
28 #TEXI2DVI_FLAGS = -E
29 OMF_FILES += $(outdir)/lilypond-internals.html.omf
30
31 LOCALSTEPMAKE_TEMPLATES=lilypond ly
32
33
34 TEXINPUTS=$(top-src-dir)/tex::
35 export TEXINPUTS
36
37 include $(depth)/make/stepmake.make
38
39 info: $(INFO_FILES)
40
41         @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
42         @echo export PYTHONPATH=$(PYTHONPATH)
43
44 xml: $(outdir)/lilypond/lilypond.xml $(outdir)/lilypond-internals/lilypond-internals.xml
45
46 # There are two modes for info: with and without images.
47 ifeq ($(out),www)
48
49 # This builds all .info targets with images, in out-www.
50 # Viewawble with a recent Emacs, doing: M-x info out-www/lilypond.info
51
52 # Cancel the special, non-image info generation rule that skips images:
53 $(outdir)/%.info: $(outdir)/%.nexi
54
55 local-install-info: info
56         -$(INSTALL) -d $(DESTDIR)$(package_infodir)
57 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
58 ## Can not have absolute symlinks because some binary packages build schemes
59 ## install files in nonstandard root.  Best we can do is to notify the
60 ## builder or packager.
61         @echo
62         @echo "***************************************************************"
63         @echo "Please add or update the LilyPond direntries, do"
64         @echo
65         @echo "    install-info --info-dir=$(infodir) $(outdir)/lilypond.info"
66         @echo
67         @echo "For images in the INFO docs to work, do: "
68         @echo
69         @echo "    (cd $(package_infodir) && ln -sf ../../doc/lilypond/Documentation/user/*png .)"
70         @echo "or add something like that to the postinstall script."
71         @echo
72 else
73         -$(INSTALL) -d $(DESTDIR)$(package_infodir)
74         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond.info
75         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond-program.info
76         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond-learning.info
77         install-info --info-dir=$(infodir) $(outdir)/lilypond.info
78         (cd $(package_infodir) && ln -sf $(webdir)/Documentation/user/*png .)
79 endif
80
81 local-uninstall-WWW:
82         rm -f $(package_infodir)/*.png
83
84 else
85
86 # Cancel the default info generation rule that generates images:
87 $(outdir)/%.info: # $(outdir)/%.texi
88
89 local-install-info: info
90         -$(INSTALL) -d $(DESTDIR)$(package_infodir)
91 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
92 ## Can not have absolute symlinks because some binary packages build schemes
93 ## install files in nonstandard root.  Best we can do is to notify the
94 ## builder or packager.
95         @echo
96         @echo "***************************************************************"
97         @echo "Please add or update the LilyPond direntries, do"
98         @echo
99         @echo "    install-info --info-dir=$(infodir) out/lilypond.info"
100         @echo
101         @echo "For images in the INFO docs to work, do"
102         @echo
103         @echo "    make out=www install-info "
104         @echo
105         @echo "and read the extra instructions."
106         @echo
107 else
108         -$(INSTALL) -d $(DESTDIR)$(package_infodir)
109         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond.info
110         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond-program.info
111         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond-learning.info
112         install-info --info-dir=$(infodir) $(outdir)/lilypond.info
113         @echo
114         @echo "***************************************************************"
115         @echo "For images in the INFO docs to work, do"
116         @echo
117         @echo "    make out=www install-info "
118         @echo
119 endif
120
121
122 endif
123
124 # All web targets, except info image symlinks and info docs are
125 # installed in non-recursing target from TOP-SRC-DIR
126 local-install-WWW: local-install-info
127 local-uninstall-WWW: local-uninstall-info
128
129 default:
130
131
132 local-help: extra-local-help
133
134 extra-local-help:
135         @echo -e "\
136   dvi         update dvi documents\n\
137   info        update info pages\n\
138   ps          update PostScript documents\n\
139   xml         update Docbook xml documentation\n\
140 "
141
142 # Generic rule using % twice not possible?
143 # $(outdir)/%/%.html: $(outdir)/%.texi
144 $(outdir)/lilypond.texi: $(outdir)/lilypond-internals.texi
145 $(outdir)/lilypond.nexi: $(outdir)/lilypond-internals.texi
146
147 #
148 # The split user manual
149 #
150 $(outdir)/lilypond/index.html: $(outdir)/lilypond.texi $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
151         mkdir -p $(dir $@)
152         $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
153 # we /might/ switch to texi2html if it can be fixed:
154 #       texi2html -I $(outdir) --output=$(outdir)/lilypond --css-include=$(top-src-dir)/Documentation/texinfo.css $<
155         find $(outdir)/lilypond/ -name '*'.png -o -name '*'.ly | xargs rm -f
156 # symbolic links to save space
157         (cd $(outdir)/lilypond/ ; ln -sf ../*.png ../*.ly . )
158
159 #
160 # One big page user manual
161 #
162 $(outdir)/lilypond-big-page.html: $(outdir)/lilypond.texi $(OUT_PNG_IMAGES)
163         $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split -D bigpage --no-headers $<
164
165 #
166 # The split program usage
167 #
168 $(outdir)/lilypond-program/index.html: $(outdir)/lilypond-program.texi $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
169         mkdir -p $(dir $@)
170         $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond-program --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
171         find $(outdir)/lilypond-program/ -name '*'.png -o -name '*'.ly | xargs rm -f
172 # symbolic links to save space
173         (cd $(outdir)/lilypond-program/ ; ln -sf ../*.png ../*.ly . )
174
175 #
176 # The Learning Manual
177 #
178 $(outdir)/lilypond-learning/index.html: $(outdir)/lilypond-learning.texi $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
179         mkdir -p $(dir $@)
180         $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond-learning --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
181         find $(outdir)/lilypond-learning/ -name '*'.png -o -name '*'.ly | xargs rm -f
182 # symbolic links to save space
183         (cd $(outdir)/lilypond-learning/ ; ln -sf ../*.png ../*.ly . )
184
185
186 #
187 # One big page program usage
188 #
189 $(outdir)/lilypond-program-big-page.html: $(outdir)/lilypond-program.texi $(OUT_PNG_IMAGES)
190         $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split -D bigpage --no-headers $<
191
192 #
193 # One big page learning manual
194 #
195 $(outdir)/lilypond-learning-big-page.html: $(outdir)/lilypond-learning.texi $(OUT_PNG_IMAGES)
196         $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split -D bigpage --no-headers $<
197
198
199
200
201 #
202 # The split internals reference
203 #
204 $(outdir)/lilypond-internals/index.html: $(outdir)/lilypond-internals.texi
205         mkdir -p $(dir $@)
206         $(MAKEINFO) --output=$(outdir)/lilypond-internals --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
207
208 #
209 # One big page internals reference
210 #
211 $(outdir)/lilypond-internals-big-page.html: $(outdir)/lilypond-internals.texi
212         $(MAKEINFO) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split -D bigpage --no-headers $<
213
214 #
215 # The split glossary
216 #
217 $(outdir)/music-glossary/index.html: $(outdir)/music-glossary.texi
218         mkdir -p $(dir $@)
219         $(MAKEINFO) --output=$(outdir)/music-glossary --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
220         find $(outdir)/music-glossary/ -name '*'.png -o -name '*'.ly | xargs rm -f
221 # symbolic links to save space
222         (cd $(outdir)/music-glossary/ ; ln -sf ../*.png ../*.ly . )
223
224 $(outdir)/lilypond.xml: $(outdir)/lilypond.texi
225         mkdir -p $(dir $@)
226         $(MAKEINFO) -I$(outdir) --output=$@ --docbook $<
227
228 $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internals.texi
229         mkdir -p $(dir $@)
230         $(MAKEINFO) --output=$(outdir)/lilypond-internals --docbook $<
231
232 $(outdir)/lilypond.pdf: $(OUT_PDF_IMAGES) $(OUT_PNG_IMAGES)
233
234 $(outdir)/lilypond-program.pdf: $(OUT_PDF_IMAGES) $(OUT_PNG_IMAGES)
235
236 $(outdir)/lilypond-learning.pdf: $(OUT_PDF_IMAGES) $(OUT_PNG_IMAGES)
237
238 $(outdir)/%.png: %.png
239         convert -depth 8 -geometry 50x50% $< $@
240
241 $(outdir)/%.png: %.eps
242         gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
243
244 $(outdir)/%.pdf: %.png
245         convert -depth 8 $< $@
246
247 $(outdir)/%.pdf: %.eps
248         gs -dAutoRotatePages=/None -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $<
249
250
251 DEEP_HTML_FILES =\
252  $(outdir)/lilypond/index.html\
253  $(outdir)/lilypond-internals/index.html\
254  $(outdir)/music-glossary/index.html\
255  $(outdir)/lilypond-program/index.html\
256  $(outdir)/lilypond-learning/index.html
257
258 # Symlinks to refer to external source documents from split and non-split HTML
259 source-links = $(outdir)/source $(outdir)/lilypond/source $(outdir)/music-glossary/source $(outdir)/lilypond-program/source $(outdir)/lilypond-learning/source
260
261 $(outdir)/source:
262         @rm -f $(@)
263         ln -sf ../../ $(@)
264
265 $(outdir)/lilypond/source:
266         @rm -f $(@)
267         mkdir -p $(outdir)/lilypond
268         ln -sf ../../../ $(@)
269
270 $(outdir)/music-glossary/source:
271         @rm -f $(@)
272         mkdir -p $(outdir)/music-glossary
273         ln -sf ../../../ $(@)
274
275 $(outdir)/lilypond-program/source:
276         @rm -f $(@)
277         mkdir -p $(outdir)/lilypond-program
278         ln -sf ../../../ $(@)
279
280 $(outdir)/lilypond-learning/source:
281         @rm -f $(@)
282         mkdir -p $(outdir)/lilypond-learning
283         ln -sf ../../../ $(@)
284
285 local-WWW: $(HTML_FILES) $(DEEP_HTML_FILES)\
286  $(datafiles) $(PDF_FILES) $(source-links) info info-dir
287
288 info-dir:
289         $(SHELL) $(buildscript-dir)/install-info-html.sh --dir=$(outdir) lilypond lilypond-internals music-glossary lilypond-program lilypond-learning
290
291
292 $(outdir)/%.bib: %.bib
293         ln -f $< $@
294
295
296 # lilypond.texi deps
297 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
298         $(MAKE) -C $(top-src-dir)/mf
299
300 $(outdir)/lilypond.texi: $(ITELY_FILES) $(ITEXI_FILES)
301 $(outdir)/lilypond.nexi: $(ITELY_FILES) $(ITEXI_FILES)
302
303 # Prevent building music-glossary.texi from default target
304 $(outdir)/music-glossary.nexi:
305
306 # Rules for the automatically generated documentation
307
308 # There used to be a dependency on a dummy target, to force a rebuild
309 # of lilypond-internals every time.  however, this triggers
310 # compilation during install, which is a bad thing (tm).
311
312 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(LILYPOND_BINARY)
313         cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
314         rm -f $(outdir)/lilypond-internals.nexi
315         -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
316
317
318 ## unused
319 $(outdir)/interfaces.itexi: dummy
320         cd $(outdir) && lilypond $(top-src-dir)/ly/generate-interface-doc