]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
d88c5eb21133477fcf2a7aa4c747345b87214d60
[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 --remove --info-dir=$(infodir) $(outdir)/lilypond.info
71         install-info --info-dir=$(infodir) $(outdir)/lilypond.info
72         (cd $(package_infodir) && ln -sf $(local_package_docdir)/Documentation/user/out-www/*png .)
73 endif
74
75 local-uninstall-WWW:
76         rm -f $(package_infodir)/*.png
77
78 else
79
80 # Cancel the default info generation rule that generates images:
81 $(outdir)/%.info: # $(outdir)/%.texi
82
83 local-install-info: info
84         -$(INSTALL) -d $(DESTDIR)$(package_infodir)
85 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
86 ## Can not have absolute symlinks because some binary packages build schemes
87 ## install files in nonstandard root.  Best we can do is to notify the
88 ## builder or packager.
89         @echo
90         @echo "***************************************************************"
91         @echo "Please add or update the LilyPond direntries, do"
92         @echo
93         @echo "    install-info --info-dir=$(infodir) out/lilypond.info"
94         @echo
95         @echo "For images in the INFO docs to work, do"
96         @echo
97         @echo "    make out=www install-info "
98         @echo
99         @echo "and read the extra instructions."
100         @echo
101 else
102         -$(INSTALL) -d $(DESTDIR)$(package_infodir)
103         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond.info
104         install-info --info-dir=$(infodir) $(outdir)/lilypond.info
105         @echo
106         @echo "***************************************************************"
107         @echo "For images in the INFO docs to work, do"
108         @echo
109         @echo "    make out=www install-info "
110         @echo
111 endif
112
113
114 endif
115
116 # All web targets, except info image symlinks and info docs are
117 # installed in non-recursing target from TOPDIR
118 local-install-WWW: local-install-info
119 local-uninstall-WWW: local-uninstall-info
120
121 default: 
122
123
124 local-help: extra-local-help
125
126 extra-local-help:
127         @echo -e "\
128   dvi         update dvi documents\n\
129   info        update info pages\n\
130   ps          update PostScript documents\n\
131   xml         update Docbook xml documentation\n\
132 "
133
134 # Generic rule using % twice not possible?
135 # $(outdir)/%/%.html: $(outdir)/%.texi
136 $(outdir)/lilypond.texi: $(outdir)/lilypond-internals.texi
137 $(outdir)/lilypond.nexi: $(outdir)/lilypond-internals.texi
138
139 #
140 # The split user manual
141 #
142 $(outdir)/lilypond/index.html: $(outdir)/lilypond.texi
143         mkdir -p $(dir $@)
144         $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --css-include=$(abs-srcdir)/Documentation/texinfo.css --html $<
145         find $(outdir)/lilypond/ -name '*'.png -o -name '*'.ly | xargs rm -f
146 # symbolic links to save space 
147         (cd $(outdir)/lilypond/ ; ln -sf ../*.png ../*.ly . )
148
149 #
150 # One big page manual
151 #
152 $(outdir)/lilypond.html: $(outdir)/lilypond.texi
153         $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(abs-srcdir)/Documentation/texinfo.css --html --no-split --no-headers $<
154
155 #
156 # The split internals reference
157 #
158 $(outdir)/lilypond-internals/index.html: $(outdir)/lilypond-internals.texi
159         mkdir -p $(dir $@)
160         $(MAKEINFO) --output=$(outdir)/lilypond-internals --css-include=$(abs-srcdir)/Documentation/texinfo.css --html $<
161
162 #
163 # One big page internals reference
164 #
165 $(outdir)/lilypond-internals.html: $(outdir)/lilypond-internals.texi
166         $(MAKEINFO) --output=$@ --css-include=$(abs-srcdir)/Documentation/texinfo.css --html --no-split --no-headers $<
167
168
169 $(outdir)/lilypond.xml: $(outdir)/lilypond.texi 
170         mkdir -p $(dir $@)
171         $(MAKEINFO) -I$(outdir) --output=$@ --docbook $<
172
173 $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internals.texi
174         mkdir -p $(dir $@)
175         $(MAKEINFO) --output=$(outdir)/lilypond-internals --docbook $<
176
177 ifeq ($(SPLITTING_MAKEINFO),yes)
178
179 $(outdir)/lilypond.dvi: $(OUT_EPS_IMAGES) $(OUT_PNG_IMAGES)
180
181 $(outdir)/%.png: %.png
182         convert -geometry 50x50% $< $@
183
184 $(outdir)/%.eps: %.png
185         convert $< $@
186
187 DEEP_HTML_FILES =\
188  $(outdir)/lilypond/index.html\
189  $(outdir)/lilypond-internals/index.html
190         
191 else
192
193 # Links referred to by Documentation index
194 LILYPOND_LINKS=Reference-Manual.html Tutorial.html Ly2dvi.html Midi2ly.html
195
196 local-WWW: outimages deep-symlinks
197
198 deep-symlinks:
199         mkdir -p $(outdir)/lilypond
200         cd $(outdir)/lilypond && $(foreach i, $(LILYPOND_LINKS),\
201                 rm -f $(i) && ln -s lilypond.html $(i) &&) true
202
203 endif
204
205 local-WWW: $(HTML_FILES) $(DEEP_HTML_FILES)\
206  $(datafiles) $(PDF_FILES) $(PS_GZ_FILES) info info-dir
207
208 local-WWW-clean: deep-WWW-clean
209
210 deep-WWW-clean:
211         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals
212
213 info-dir:
214         $(SHELL) $(buildscript-dir)/install-info-html.sh --dir=$(outdir) lilypond lilypond-internals
215
216
217 $(outdir)/%.bib: %.bib
218         ln -f $< $@
219
220 local-clean:
221         rm -f fonts.aux fonts.log feta*.tfm feta*.*pk 
222         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals
223
224 # lilypond.texi deps
225 $(builddir)/mf/$(outconfbase)/feta16list.ly:
226         $(MAKE) -C $(topdir)/mf
227
228 $(outdir)/lilypond.texi: $(ITELY_FILES) $(ITEXI_FILES) 
229 $(outdir)/lilypond.nexi: $(ITELY_FILES) $(ITEXI_FILES)
230
231 # Rules for the automatically generated documentation
232 # When cross-compiling, we don't have lilypond, so we fake
233 ifneq ($(CROSS),yes)
234
235
236 # There used to be a dependency on a dummy target, to force a rebuild
237 # of lilypond-internals every time.  however, this triggers
238 # compilation during install, which is a bad thing (tm).
239
240 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(builddir)/lily/$(outconfbase)/lilypond
241         cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond --verbose $(abs-srcdir)/ly/generate-documentation
242         rm -f $(outdir)/lilypond-internals.nexi
243         -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
244
245
246 ## unused
247 $(outdir)/interfaces.itexi: dummy
248         cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond $(abs-srcdir)/ly/generate-interface-doc
249
250 else
251
252 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi:
253         touch $@
254         touch $(outdir)/$(*F).nexi
255
256 $(outdir)/interfaces.itexi:
257         cp dummy-interfaces.itexi $@
258 endif
259
260
261 local-clean: local-delete
262
263 local-delete:
264         -for i in $$(seq 0 9); do \
265                 for j in dvi eps eps.bbox eps.trans log png tex; do \
266                         rm -f $(outdir)/lily-$$i*$$j; \
267                 done; \
268         done
269         -rm -f $(outdir)/*