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