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