]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
* Documentation/topdocs/NEWS.texi: Add note about info docs with
[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 # Cancel the default info generation rule.  We want to generate info
38 # from `.nexi', making sure we don't run LilyPond for images, when
39 # generating info.  This will produce info docs without images.  For
40 # full info documentation including images, run make web.
41 $(outdir)/%.info: # $(outdir)/%.texi
42
43 default: 
44
45 # Info is now built by default via texinfo-rules.
46 # We must build them by default, otherwise they get built during make install
47 info: $(INFO_FILES)
48
49 local-help: extra-local-help
50
51 extra-local-help:
52         @echo -e "\
53   dvi         update dvi documents\n\
54   info        update info pages\n\
55   ps          update PostScript documents\n\
56 "
57
58 # Generic rule using % twice not possible?
59 # $(outdir)/%/%.html: $(outdir)/%.texi
60 $(outdir)/lilypond.texi: $(outdir)/lilypond-internals.texi
61 $(outdir)/lilypond.nexi: $(outdir)/lilypond-internals.texi
62
63
64 $(outdir)/lilypond/lilypond.html: $(outdir)/lilypond.texi 
65         mkdir -p $(dir $@)
66         $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --html $<
67         $(MAKEINFO) -I$(outdir) --output=$@ --html --no-split --no-headers $<
68         perl -i~ -pe 's!../lilypond-internals!lilypond-internals/!g' $(outdir)/lilypond.html
69         rm -f $(outdir)/lilypond/*.png $(outdir)/lilypond/*.ly 
70         -ln -f $(outdir)/*.png $(outdir)/*.ly $(outdir)/lilypond/
71
72 $(outdir)/lilypond-internals/lilypond-internals.html: $(outdir)/lilypond-internals.texi
73         mkdir -p $(dir $@)
74         $(MAKEINFO) --output=$(outdir)/lilypond-internals --html $<
75         $(MAKEINFO) -I$(outdir) --output=$@ --html --no-split --no-headers $<
76
77 ifeq ($(SPLITTING_MAKEINFO),yes)
78
79 $(outdir)/lilypond.dvi: $(OUT_EPS_IMAGES) $(OUT_PNG_IMAGES)
80
81 $(outdir)/%.png: %.png
82         convert -geometry 50x50% $< $@
83
84 $(outdir)/%.eps: %.png
85         convert $< $@
86
87 DEEP_HTML_FILES = $(outdir)/lilypond/lilypond.html $(outdir)/lilypond-internals/lilypond-internals.html
88
89 else
90
91 # Links referred to by Documentation index
92 LILYPOND_LINKS=Reference-Manual.html Tutorial.html Ly2dvi.html Midi2ly.html
93
94 local-WWW: outimages deep-symlinks
95
96 deep-symlinks:
97         mkdir -p $(outdir)/lilypond
98         cd $(outdir)/lilypond && $(foreach i, $(LILYPOND_LINKS),\
99                 rm -f $(i) && ln -s lilypond.html $(i) &&) true
100
101 endif
102
103
104 local-WWW: $(HTML_FILES) $(datafiles) $(PDF_FILES) $(PS_GZ_FILES) $(DEEP_HTML_FILES) info-with-images info-dir
105
106 # This builds all .info targets with images, in out-www.
107 # Viewawble with a recent Emacs, doing: M-x info out-www/lilypond.info
108 # TODO: install .info into $(INFODIR)/lilypond/,
109 # adding symlinks for images (or devise image include dir for Info?).
110 info-with-images: $(INFO_FILES)
111         -cp -f $(INFO_INSTALL_FILES) $(builddir)/Documentation/user/$(outconfbase)
112
113 local-install-info:
114 # URG, silly home-brewn web-install target works from TOPDIR using tarball.
115 # FIXME: doc pics get installed twice
116 #       (cd $(package_infodir) && ln -s $(local_package_docdir)/html/*png .)
117         -(cd $(package_infodir) && ln -f $(builddir)/Documentation/user/$(outconfbase)-www/*png .)
118         
119 local-uninstall-info:
120         rm -f $(package_infodir)/*.png
121
122 local-WWW-clean: deep-WWW-clean
123
124 deep-WWW-clean:
125         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals
126
127 info-dir:
128         $(SHELL) $(buildscript-dir)/install-info-html.sh --dir=$(outdir) lilypond lilypond-internals
129
130
131 $(outdir)/%.bib: %.bib
132         ln -f $< $@
133
134 local-clean:
135         rm -f fonts.aux fonts.log feta*.tfm feta*.*pk 
136         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals
137
138 # lilypond.texi deps
139 $(builddir)/mf/$(outconfbase)/feta16list.ly:
140         $(MAKE) -C $(topdir)/mf
141
142 $(outdir)/lilypond.texi: $(ITELY_FILES) macros.itexi 
143
144 # Rules for the automatically generated documentation
145 # When cross-compiling, we don't have lilypond, so we fake
146 ifneq ($(CROSS),yes)
147
148
149 # There used to be a dependency on a dummy target, to force a rebuild
150 # of lilypond-internals every time.  however, this triggers
151 # compilation during install, which is a bad thing (tm).
152
153 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(builddir)/lily/$(outconfbase)/lilypond-bin
154         cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond-bin --verbose $(abs-srcdir)/ly/generate-documentation
155         rm -f $(outdir)/lilypond-internals.nexi
156         -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
157
158
159 ## unused
160 $(outdir)/interfaces.itexi: dummy
161         cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond-bin $(abs-srcdir)/ly/generate-interface-doc
162
163 else
164
165 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi:
166         touch $@
167         touch $(outdir)/$(*F).nexi
168
169 $(outdir)/interfaces.itexi:
170         cp dummy-interfaces.itexi $@
171 endif
172
173
174 local-clean: local-delete
175
176 local-delete:
177         -rm -f $(outdir)/lily-1*
178         -rm -f $(outdir)/*