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