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