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