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