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