]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
f94800161cf37f1577e46ff92e25bde34fb85717
[lilypond.git] / Documentation / user / GNUmakefile
1 depth=../..
2
3 LATEX_FILES =$(call src-wildcard,*.latex)
4
5
6 EXTRA_DIST_FILES = $(LATEX_FILES) $(IMAGES) $(EPS_ILLUSTRATIONS)
7 EXTRA_DIST_FILES += README.txt writing-texinfo.txt policy.txt writing-sections.txt
8
9 IMAGES=$(call src-wildcard,*.png)
10 EPS_ILLUSTRATIONS=context-example.eps
11 PDF_ILLUSTRATIONS=context-example.pdf
12
13 OUT_PDF_IMAGES=$(IMAGES:%.png=$(outdir)/%.pdf) $(addprefix $(outdir)/,$(PDF_ILLUSTRATIONS))
14
15 OUT_PNG_IMAGES=$(OUT_PDF_IMAGES:%.pdf=%.png)
16
17 OUT_TEXI_FILES=$(ITEXI_FILES:%.itexi=$(outdir)/%.texi)\
18  $(ITELY_FILES:%.itely=$(outdir)/%.texi)
19 HTML_FILES = $(TELY_FILES:%.tely=$(outdir)/%-big-page.html)\
20  $(outdir)/lilypond-internals-big-page.html
21
22 # todo: add latex.
23 PDF_FILES = $(TELY_FILES:%.tely=$(outdir)/%.pdf)
24 # this prevents aux files from being reused for translated docs
25 TEXI2PDF_FLAGS = --tidy
26
27 INFO_DOCS = lilypond lilypond-internals music-glossary lilypond-program lilypond-learning
28 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
29
30 ifeq ($(out),www)
31 INFO_IMAGES_DIR = lilypond
32 endif
33
34 STEPMAKE_TEMPLATES=tex texinfo omf documentation
35 OMF_FILES += $(outdir)/lilypond-internals.html.omf
36
37 LOCALSTEPMAKE_TEMPLATES=lilypond ly
38
39
40 TEXINPUTS=$(top-src-dir)/tex::
41 export TEXINPUTS
42
43 include $(depth)/make/stepmake.make
44
45 info: $(INFO_FILES)
46         @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
47         @echo export PYTHONPATH=$(PYTHONPATH)
48
49 xml: $(outdir)/lilypond/lilypond.xml $(outdir)/lilypond-internals/lilypond-internals.xml
50
51 # There are two modes for info: with and without images.
52 ifeq ($(out),www)
53
54 # This builds all .info targets with images, in out-www.
55 # Viewable with a recent Emacs, doing: C-u C-h i out-www/lilypond.info
56
57 local-install-info: info
58         -$(INSTALL) -d $(DESTDIR)$(infodir)
59 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
60 ## Can not have absolute symlinks because some binary packages build schemes
61 ## install files in nonstandard root.  Best we can do is to notify the
62 ## builder or packager.
63         @echo
64         @echo "***************************************************************"
65         @echo "Please add or update the LilyPond direntries, do"
66         @echo
67         @echo "    install-info --info-dir=$(infodir) $(outdir)/lilypond.info"
68         @echo
69         @echo "For images in the INFO docs to work, do: "
70         @echo
71         @echo "    (cd $(infodir) && ln -sfT ../doc/lilypond/html/Documentation/user lilypond)"
72         @echo "or add something like that to the postinstall script."
73         @echo
74 else # installing directly into standard /usr/...
75         -$(INSTALL) -d $(DESTDIR)$(infodir)
76         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond.info
77         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond-program.info
78         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond-learning.info
79         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond-internals.info
80         -install-info --remove --info-dir=$(infodir) $(outdir)/music-glossary.info
81         install-info --info-dir=$(infodir) $(outdir)/lilypond.info
82         cd $(infodir) && ln -sfT $(webdir)/Documentation/user lilypond
83 endif # installing directly into standard /usr/...
84
85 local-uninstall-WWW:
86         rm -f $(infodir)/lilypond
87
88 else # out!=www
89
90 local-install-info: info
91         -$(INSTALL) -d $(DESTDIR)$(package_infodir)
92 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
93 ## Can not have absolute symlinks because some binary packages build schemes
94 ## install files in nonstandard root.  Best we can do is to notify the
95 ## builder or packager.
96         @echo
97         @echo "***************************************************************"
98         @echo "Please add or update the LilyPond direntries, do"
99         @echo
100         @echo "    install-info --info-dir=$(infodir) out/lilypond.info"
101         @echo
102         @echo "For images in the INFO docs to work, do"
103         @echo
104         @echo "    make out=www install-info "
105         @echo
106         @echo "and read the extra instructions."
107         @echo
108 else # installing directly into standard /usr/...
109         -$(INSTALL) -d $(DESTDIR)$(infodir)
110         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond.info
111         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond-program.info
112         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond-learning.info
113         -install-info --remove --info-dir=$(infodir) $(outdir)/lilypond-internals.info
114         -install-info --remove --info-dir=$(infodir) $(outdir)/music-glossary.info
115         install-info --info-dir=$(infodir) $(outdir)/lilypond.info
116         @echo
117         @echo "***************************************************************"
118         @echo "For images in the INFO docs to work, do"
119         @echo
120         @echo "    make out=www install-info "
121         @echo
122 endif # installing into standard /usr/* root# installing into /usr/...
123
124 endif # out!=www
125
126 # All web targets, except info image symlinks and info docs are
127 # installed in non-recursing target from TOP-SRC-DIR
128 local-install-WWW: local-install-info
129 local-uninstall-WWW: local-uninstall-info
130
131 default:
132
133 local-clean:
134         rm -f $(INFO_IMAGES_DIR)
135
136 local-help: extra-local-help
137
138 extra-local-help:
139         @echo -e "\
140   info        update info pages\n\
141   ps          update PostScript documents\n\
142   xml         update Docbook xml documentation\n\
143 "
144
145 # Generic rule using % twice not possible?
146 # $(outdir)/%/%.html: $(outdir)/%.texi
147 $(outdir)/lilypond.texi: $(outdir)/lilypond-internals.texi
148 $(outdir)/lilypond.nexi: $(outdir)/lilypond-internals.texi
149
150 #
151 # Split manuals in HTML
152 #
153 $(outdir)/lilypond/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
154 $(outdir)/lilypond-learning/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
155
156
157 #
158 # Manuals in one big HTML page
159 #
160 $(outdir)/lilypond-big-page.html: $(OUT_PNG_IMAGES)
161 $(outdir)/lilypond-learning-big-page.html: $(OUT_PNG_IMAGES)
162
163 $(outdir)/lilypond.xml: $(outdir)/lilypond.texi
164         mkdir -p $(dir $@)
165         $(MAKEINFO) -I$(outdir) --output=$@ --docbook $<
166
167 $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internals.texi
168         mkdir -p $(dir $@)
169         $(MAKEINFO) --output=$(outdir)/lilypond-internals --docbook $<
170
171 $(outdir)/lilypond.pdf $(outdir)/lilypond-learning.pdf: $(OUT_PDF_IMAGES)
172
173 $(outdir)/%.png: %.png
174         convert -depth 8 -geometry 50x50% $< $@
175
176 $(outdir)/%.png: %.eps
177         gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
178
179 $(outdir)/%.pdf: %.png
180         convert -depth 8 $< $@
181
182 $(outdir)/%.pdf: %.eps
183         gs -dAutoRotatePages=/None -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $<
184
185
186 DEEP_HTML_FILES =\
187  $(outdir)/lilypond/index.html\
188  $(outdir)/lilypond-internals/index.html\
189  $(outdir)/music-glossary/index.html\
190  $(outdir)/lilypond-program/index.html\
191  $(outdir)/lilypond-learning/index.html
192
193 # Symlinks to refer to external source documents from split and non-split HTML
194 source-links = $(outdir)/source $(outdir)/lilypond/source $(outdir)/music-glossary/source $(outdir)/lilypond-program/source $(outdir)/lilypond-learning/source
195
196 $(outdir)/source:
197         @rm -f $(@)
198         ln -sf ../../ $(@)
199
200 $(outdir)/%/source:
201         @rm -f $(@)
202         mkdir -p $(dir $@)
203         ln -sf ../../../ $(@)
204
205 local-WWW: $(HTML_FILES) $(DEEP_HTML_FILES)\
206  $(datafiles) $(PDF_FILES) $(source-links) info
207
208 $(outdir)/%.bib: %.bib
209         ln -f $< $@
210
211
212 # lilypond.texi deps
213 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
214         $(MAKE) -C $(top-src-dir)/mf
215
216 $(outdir)/lilypond.texi $(outdir)/lilypond-program.texi $(outdir)/lilypond-learning.texi $(outdir)/music-glossary.texi: $(ITELY_FILES) $(ITEXI_FILES)
217 $(outdir)/lilypond.nexi $(outdir)/lilypond-program.nexi $(outdir)/lilypond-learning.nexi $(outdir)/music-glossary.nexi: $(ITELY_FILES) $(ITEXI_FILES)
218
219
220 # Rules for the automatically generated documentation
221
222 # There used to be a dependency on a dummy target, to force a rebuild
223 # of lilypond-internals every time.  however, this triggers
224 # compilation during install, which is a bad thing (tm).
225
226 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(LILYPOND_BINARY)
227         cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
228         rm -f $(outdir)/lilypond-internals.nexi
229         -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
230
231
232 ## unused
233 $(outdir)/interfaces.itexi: dummy
234         cd $(outdir) && lilypond $(top-src-dir)/ly/generate-interface-doc