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