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