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