]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
* Documentation/user/tutorial.itely (Running LilyPond for the
[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         -$(INSTALL) -d $(DESTDIR)$(package_infodir)
69         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond.info
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 --remove --info-dir=$(infodir) $(outdir)/lilypond.info
103         install-info --info-dir=$(infodir) $(outdir)/lilypond.info
104         @echo
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 endif
111
112
113 endif
114
115 # All web targets, except info image symlinks and info docs are
116 # installed in non-recursing target from TOPDIR
117 local-install-WWW: local-install-info
118 local-uninstall-WWW: local-uninstall-info
119
120 default: 
121
122
123 local-help: extra-local-help
124
125 extra-local-help:
126         @echo -e "\
127   dvi         update dvi documents\n\
128   info        update info pages\n\
129   ps          update PostScript documents\n\
130   xml         update Docbook xml documentation\n\
131 "
132
133 # Generic rule using % twice not possible?
134 # $(outdir)/%/%.html: $(outdir)/%.texi
135 $(outdir)/lilypond.texi: $(outdir)/lilypond-internals.texi
136 $(outdir)/lilypond.nexi: $(outdir)/lilypond-internals.texi
137
138 #
139 # The split user manual
140 #
141 $(outdir)/lilypond/index.html: $(outdir)/lilypond.texi
142         mkdir -p $(dir $@)
143         $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --css-include=$(abs-srcdir)/Documentation/texinfo.css --html $<
144         find $(outdir)/lilypond/ -name '*'.png -o -name '*'.ly | xargs rm -f
145 # symbolic links to save space 
146         (cd $(outdir)/lilypond/ ; ln -sf ../*.png ../*.ly . )
147
148 #
149 # One big page manual
150 #
151 $(outdir)/lilypond.html: $(outdir)/lilypond.texi
152         $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(abs-srcdir)/Documentation/texinfo.css --html --no-split --no-headers $<
153
154 #
155 # The split internals reference
156 #
157 $(outdir)/lilypond-internals/index.html: $(outdir)/lilypond-internals.texi
158         mkdir -p $(dir $@)
159         $(MAKEINFO) --output=$(outdir)/lilypond-internals --css-include=$(abs-srcdir)/Documentation/texinfo.css --html $<
160
161 #
162 # One big page internals reference
163 #
164 $(outdir)/lilypond-internals.html: $(outdir)/lilypond-internals.texi
165         $(MAKEINFO) --output=$@ --css-include=$(abs-srcdir)/Documentation/texinfo.css --html --no-split --no-headers $<
166
167 #
168 # The split glossary
169 #
170 $(outdir)/music-glossary/index.html: $(outdir)/music-glossary.texi
171         mkdir -p $(dir $@)
172         $(MAKEINFO) --output=$(outdir)/music-glossary --css-include=$(abs-srcdir)/Documentation/texinfo.css --html $<
173         find $(outdir)/music-glossary/ -name '*'.png -o -name '*'.ly | xargs rm -f
174 # symbolic links to save space 
175         (cd $(outdir)/music-glossary/ ; ln -sf ../*.png ../*.ly . )
176
177 $(outdir)/lilypond.xml: $(outdir)/lilypond.texi 
178         mkdir -p $(dir $@)
179         $(MAKEINFO) -I$(outdir) --output=$@ --docbook $<
180
181 $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internals.texi
182         mkdir -p $(dir $@)
183         $(MAKEINFO) --output=$(outdir)/lilypond-internals --docbook $<
184
185 $(outdir)/lilypond.dvi: $(OUT_EPS_IMAGES) $(OUT_PNG_IMAGES)
186
187 $(outdir)/%.png: %.png
188         convert -geometry 50x50% $< $@
189
190 $(outdir)/%.eps: %.png
191         convert $< $@
192
193 DEEP_HTML_FILES =\
194  $(outdir)/lilypond/index.html\
195  $(outdir)/lilypond-internals/index.html\
196  $(outdir)/music-glossary/index.html
197
198 local-WWW: $(HTML_FILES) $(DEEP_HTML_FILES)\
199  $(datafiles) $(PDF_FILES) $(PS_GZ_FILES) info info-dir
200
201 local-WWW-clean: deep-WWW-clean
202
203 deep-WWW-clean:
204         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals
205
206 info-dir:
207         $(SHELL) $(buildscript-dir)/install-info-html.sh --dir=$(outdir) lilypond lilypond-internals music-glossary
208
209
210 $(outdir)/%.bib: %.bib
211         ln -f $< $@
212
213 local-clean:
214         rm -f fonts.aux fonts.log feta*.tfm feta*.*pk 
215         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals $(outdir)/music-glossary
216
217 # lilypond.texi deps
218 $(builddir)/mf/$(outconfbase)/feta16list.ly:
219         $(MAKE) -C $(topdir)/mf
220
221 $(outdir)/lilypond.texi: $(ITELY_FILES) $(ITEXI_FILES) 
222 $(outdir)/lilypond.nexi: $(ITELY_FILES) $(ITEXI_FILES)
223
224 # Rules for the automatically generated documentation
225 # When cross-compiling, we don't have lilypond, so we fake
226 ifneq ($(CROSS),yes)
227
228
229 # There used to be a dependency on a dummy target, to force a rebuild
230 # of lilypond-internals every time.  however, this triggers
231 # compilation during install, which is a bad thing (tm).
232
233 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(builddir)/lily/$(outconfbase)/lilypond
234         cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond --verbose $(abs-srcdir)/ly/generate-documentation
235         rm -f $(outdir)/lilypond-internals.nexi
236         -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
237
238
239 ## unused
240 $(outdir)/interfaces.itexi: dummy
241         cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond $(abs-srcdir)/ly/generate-interface-doc
242
243 else
244
245 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi:
246         touch $@
247         touch $(outdir)/$(*F).nexi
248
249 $(outdir)/interfaces.itexi:
250         cp dummy-interfaces.itexi $@
251 endif
252
253
254 local-clean: local-delete
255
256 local-delete:
257         -for i in $$(seq 0 9); do \
258                 for j in dvi eps eps.bbox eps.trans eps.trans.ps ps log png tex; do \
259                         rm -f $(outdir)/lily-$$i*$$j; \
260                 done; \
261         done
262         -rm -f $(outdir)/*