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