]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
Merge branch 'master' of git://git.sv.gnu.org/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) 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
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 pathsettings:
42         @echo export PATH=$(PATH)
43         @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
44         @echo export PYTHONPATH=$(PYTHONPATH)
45
46 xml: $(outdir)/lilypond/lilypond.xml $(outdir)/lilypond-internals/lilypond-internals.xml
47
48 # There are two modes for info: with and without images.
49 ifeq ($(out),www)
50
51 # This builds all .info targets with images, in out-www.
52 # Viewawble with a recent Emacs, doing: M-x info out-www/lilypond.info
53
54 # Cancel the special, non-image info generation rule that skips images:
55 $(outdir)/%.info: $(outdir)/%.nexi
56
57 local-install-info: info
58         -$(INSTALL) -d $(DESTDIR)$(package_infodir)
59 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
60 ## Can not have absolute symlinks because some binary packages build schemes
61 ## install files in nonstandard root.  Best we can do is to notify the
62 ## builder or packager.
63         @echo
64         @echo "***************************************************************"
65         @echo "Please add or update the LilyPond direntries, do"
66         @echo
67         @echo "    install-info --info-dir=$(infodir) $(outdir)/lilypond.info"
68         @echo
69         @echo "For images in the INFO docs to work, do: "
70         @echo
71         @echo "    (cd $(package_infodir) && ln -sf ../../doc/lilypond/Documentation/user/*png .)"
72         @echo "or add something like that to the postinstall script."
73         @echo
74 else
75         -$(INSTALL) -d $(DESTDIR)$(package_infodir)
76         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond.info
77         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond-program.info
78         install-info --info-dir=$(infodir) $(outdir)/lilypond.info
79         (cd $(package_infodir) && ln -sf $(webdir)/Documentation/user/*png .)
80 endif
81
82 local-uninstall-WWW:
83         rm -f $(package_infodir)/*.png
84
85 else
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
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 --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         find $(outdir)/lilypond/ -name '*'.png -o -name '*'.ly | xargs rm -f
154 # symbolic links to save space
155         (cd $(outdir)/lilypond/ ; ln -sf ../*.png ../*.ly . )
156
157 #
158 # One big page user manual
159 #
160 $(outdir)/lilypond-big-page.html: $(outdir)/lilypond.texi $(OUT_PNG_IMAGES)
161         $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split -D bigpage --no-headers $<
162
163 #
164 # The split program usage
165 #
166 $(outdir)/lilypond-program/index.html: $(outdir)/lilypond-program.texi $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
167         mkdir -p $(dir $@)
168         $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond-program --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
169         find $(outdir)/lilypond-program/ -name '*'.png -o -name '*'.ly | xargs rm -f
170 # symbolic links to save space
171         (cd $(outdir)/lilypond-program/ ; ln -sf ../*.png ../*.ly . )
172
173 #
174 # One big page program usage
175 #
176 $(outdir)/lilypond-program-big-page.html: $(outdir)/lilypond-program.texi $(OUT_PNG_IMAGES)
177         $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split -D bigpage --no-headers $<
178
179
180 #
181 # The split internals reference
182 #
183 $(outdir)/lilypond-internals/index.html: $(outdir)/lilypond-internals.texi
184         mkdir -p $(dir $@)
185         $(MAKEINFO) --output=$(outdir)/lilypond-internals --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
186
187 #
188 # One big page internals reference
189 #
190 $(outdir)/lilypond-internals-big-page.html: $(outdir)/lilypond-internals.texi
191         $(MAKEINFO) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split -D bigpage --no-headers $<
192
193 #
194 # The split glossary
195 #
196 $(outdir)/music-glossary/index.html: $(outdir)/music-glossary.texi
197         mkdir -p $(dir $@)
198         $(MAKEINFO) --output=$(outdir)/music-glossary --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
199         find $(outdir)/music-glossary/ -name '*'.png -o -name '*'.ly | xargs rm -f
200 # symbolic links to save space
201         (cd $(outdir)/music-glossary/ ; ln -sf ../*.png ../*.ly . )
202
203 $(outdir)/lilypond.xml: $(outdir)/lilypond.texi
204         mkdir -p $(dir $@)
205         $(MAKEINFO) -I$(outdir) --output=$@ --docbook $<
206
207 $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internals.texi
208         mkdir -p $(dir $@)
209         $(MAKEINFO) --output=$(outdir)/lilypond-internals --docbook $<
210
211 $(outdir)/lilypond.pdf: $(OUT_PDF_IMAGES) $(OUT_PNG_IMAGES)
212
213 $(outdir)/lilypond-program.pdf: $(OUT_PDF_IMAGES) $(OUT_PNG_IMAGES)
214
215 $(outdir)/%.png: %.png
216         convert -depth 8 -geometry 50x50% $< $@
217
218 $(outdir)/%.png: %.eps
219         gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
220
221 $(outdir)/%.pdf: %.png
222         convert -depth 8 $< $@
223
224 $(outdir)/%.pdf: %.eps
225         gs -dAutoRotatePages=/None -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $<
226
227
228 DEEP_HTML_FILES =\
229  $(outdir)/lilypond/index.html\
230  $(outdir)/lilypond-internals/index.html\
231  $(outdir)/music-glossary/index.html\
232  $(outdir)/lilypond-program/index.html
233
234 # Symlinks to refer to external source documents from split and non-split HTML
235 source-links = $(outdir)/source $(outdir)/lilypond/source $(outdir)/music-glossary/source $(outdir)/lilypond-program/source
236
237 $(outdir)/source:
238         @rm -f $(@)
239         ln -sf ../../ $(@)
240
241 $(outdir)/lilypond/source:
242         @rm -f $(@)
243         mkdir -p $(outdir)/lilypond
244         ln -sf ../../../ $(@)
245
246 $(outdir)/music-glossary/source:
247         @rm -f $(@)
248         mkdir -p $(outdir)/music-glossary
249         ln -sf ../../../ $(@)
250
251 $(outdir)/lilypond-program/source:
252         @rm -f $(@)
253         mkdir -p $(outdir)/lilypond-program
254         ln -sf ../../../ $(@)
255
256
257 local-WWW: $(HTML_FILES) $(DEEP_HTML_FILES)\
258  $(datafiles) $(PDF_FILES) $(source-links) info info-dir
259
260 info-dir:
261         $(SHELL) $(buildscript-dir)/install-info-html.sh --dir=$(outdir) lilypond lilypond-internals music-glossary lilypond-program
262
263
264 $(outdir)/%.bib: %.bib
265         ln -f $< $@
266
267
268 # lilypond.texi deps
269 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
270         $(MAKE) -C $(top-src-dir)/mf
271
272 $(outdir)/lilypond.texi: $(ITELY_FILES) $(ITEXI_FILES)
273 $(outdir)/lilypond.nexi: $(ITELY_FILES) $(ITEXI_FILES)
274
275 # Prevent building music-glossary.texi from default target
276 $(outdir)/music-glossary.nexi:
277
278 # Rules for the automatically generated documentation
279
280 # There used to be a dependency on a dummy target, to force a rebuild
281 # of lilypond-internals every time.  however, this triggers
282 # compilation during install, which is a bad thing (tm).
283
284 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(LILYPOND_BINARY)
285         cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
286         rm -f $(outdir)/lilypond-internals.nexi
287         -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
288
289
290 ## unused
291 $(outdir)/interfaces.itexi: dummy
292         cd $(outdir) && lilypond $(top-src-dir)/ly/generate-interface-doc