]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
d58ce5c1bc9e715fb97570cab34ab149f30fcd16
[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 convert-ly.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)/%.html)\
19  $(outdir)/lilypond-internals.html
20
21 # todo: add latex.
22 PDF_FILES = $(TELY_FILES:%.tely=$(outdir)/%.pdf)
23
24 INFO_DOCS = lilypond lilypond-internals music-glossary
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 LILYPONDPREFIX=$(LILYPONDPREFIX)
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 --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 --info-dir=$(infodir) $(outdir)/lilypond.info
111         @echo
112         @echo "***************************************************************"
113         @echo "For images in the INFO docs to work, do"
114         @echo
115         @echo "    make out=www install-info "
116         @echo
117 endif
118
119
120 endif
121
122 # All web targets, except info image symlinks and info docs are
123 # installed in non-recursing target from TOP-SRC-DIR
124 local-install-WWW: local-install-info
125 local-uninstall-WWW: local-uninstall-info
126
127 default:
128
129
130 local-help: extra-local-help
131
132 extra-local-help:
133         @echo -e "\
134   dvi         update dvi documents\n\
135   info        update info pages\n\
136   ps          update PostScript documents\n\
137   xml         update Docbook xml documentation\n\
138 "
139
140 # Generic rule using % twice not possible?
141 # $(outdir)/%/%.html: $(outdir)/%.texi
142 $(outdir)/lilypond.texi: $(outdir)/lilypond-internals.texi
143 $(outdir)/lilypond.nexi: $(outdir)/lilypond-internals.texi
144
145 #
146 # The split user manual
147 #
148 $(outdir)/lilypond/index.html: $(outdir)/lilypond.texi $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
149         mkdir -p $(dir $@)
150         $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
151         find $(outdir)/lilypond/ -name '*'.png -o -name '*'.ly | xargs rm -f
152 # symbolic links to save space
153         (cd $(outdir)/lilypond/ ; ln -sf ../*.png ../*.ly . )
154
155 #
156 # One big page manual
157 #
158 $(outdir)/lilypond.html: $(outdir)/lilypond.texi $(OUT_PNG_IMAGES)
159         $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $<
160
161 #
162 # The split internals reference
163 #
164 $(outdir)/lilypond-internals/index.html: $(outdir)/lilypond-internals.texi
165         mkdir -p $(dir $@)
166         $(MAKEINFO) --output=$(outdir)/lilypond-internals --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
167
168 #
169 # One big page internals reference
170 #
171 $(outdir)/lilypond-internals.html: $(outdir)/lilypond-internals.texi
172         $(MAKEINFO) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $<
173
174 #
175 # The split glossary
176 #
177 $(outdir)/music-glossary/index.html: $(outdir)/music-glossary.texi
178         mkdir -p $(dir $@)
179         $(MAKEINFO) --output=$(outdir)/music-glossary --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
180         find $(outdir)/music-glossary/ -name '*'.png -o -name '*'.ly | xargs rm -f
181 # symbolic links to save space
182         (cd $(outdir)/music-glossary/ ; ln -sf ../*.png ../*.ly . )
183
184 $(outdir)/lilypond.xml: $(outdir)/lilypond.texi
185         mkdir -p $(dir $@)
186         $(MAKEINFO) -I$(outdir) --output=$@ --docbook $<
187
188 $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internals.texi
189         mkdir -p $(dir $@)
190         $(MAKEINFO) --output=$(outdir)/lilypond-internals --docbook $<
191
192 $(outdir)/lilypond.pdf: $(OUT_PDF_IMAGES) $(OUT_PNG_IMAGES)
193
194 $(outdir)/%.png: %.png
195         convert -geometry 50x50% $< $@
196
197 $(outdir)/%.png: %.eps
198         convert $< $@
199
200 $(outdir)/%.eps: %.png
201         convert $< $@
202
203 $(outdir)/%.eps: %.eps
204         cp $< $@
205
206 $(outdir)/%.pdf: %.png
207         convert $< $@
208
209 $(outdir)/%.pdf: %.eps
210         gs -dAutoRotatePages=/None -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $<
211
212
213 DEEP_HTML_FILES =\
214  $(outdir)/lilypond/index.html\
215  $(outdir)/lilypond-internals/index.html\
216  $(outdir)/music-glossary/index.html
217
218 # Symlinks to refer to external source documents from split and non-split HTML
219 source-links = $(outdir)/source $(outdir)/lilypond/source $(outdir)/music-glossary/source
220
221 $(outdir)/source:
222         @rm -f $(@)
223         ln -sf ../../ $(@)
224
225 $(outdir)/lilypond/source:
226         @rm -f $(@)
227         ln -sf ../../../ $(@)
228
229 $(outdir)/music-glossary/source:
230         @rm -f $(@)
231         ln -sf ../../../ $(@)
232
233 local-WWW: $(HTML_FILES) $(DEEP_HTML_FILES)\
234  $(datafiles) $(PDF_FILES) $(source-links) info info-dir
235
236 local-WWW-clean: deep-WWW-clean
237
238 deep-WWW-clean:
239         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals
240
241 info-dir:
242         $(SHELL) $(buildscript-dir)/install-info-html.sh --dir=$(outdir) lilypond lilypond-internals music-glossary
243
244
245 $(outdir)/%.bib: %.bib
246         ln -f $< $@
247
248 local-clean:
249         rm -f fonts.aux fonts.log feta*.tfm feta*.*pk
250         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals $(outdir)/music-glossary
251
252 # lilypond.texi deps
253 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
254         $(MAKE) -C $(top-src-dir)/mf
255
256 $(outdir)/lilypond.texi: $(ITELY_FILES) $(ITEXI_FILES)
257 $(outdir)/lilypond.nexi: $(ITELY_FILES) $(ITEXI_FILES)
258
259 # Prevent building music-glossary.texi from default target
260 $(outdir)/music-glossary.nexi:
261
262 # Rules for the automatically generated documentation
263
264 # There used to be a dependency on a dummy target, to force a rebuild
265 # of lilypond-internals every time.  however, this triggers
266 # compilation during install, which is a bad thing (tm).
267
268 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(LILYPOND_BINARY)
269         cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
270         rm -f $(outdir)/lilypond-internals.nexi
271         -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
272
273
274 ## unused
275 $(outdir)/interfaces.itexi: dummy
276         cd $(outdir) && lilypond $(top-src-dir)/ly/generate-interface-doc
277
278
279 local-clean: local-delete
280
281 local-delete:
282         find $(outdir)/ -name 'lily-[0-9]*' | xargs rm -f
283         -rm -f $(outdir)/*