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