]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
06d695ac8efdaafdc30808f455d70ef69a4a452e
[lilypond.git] / Documentation / user / GNUmakefile
1 # Documentation/tex/Makefile
2
3 depth=../..
4
5
6 LATEX_FILES =$(wildcard *.latex)
7
8 # todo: add latex.
9 DVI_FILES = $(addprefix $(outdir)/, $(TELY_FILES:.tely=.dvi))
10
11 EXTRA_DIST_FILES= $(LATEX_FILES) $(IMAGES)
12 IMAGES=$(wildcard *.png)
13
14 OUT_EPS_IMAGES=$(addprefix $(outdir)/,$(IMAGES:.png=.eps))
15 OUT_PNG_IMAGES=$(addprefix $(outdir)/,$(IMAGES))
16
17 HTML_FILES = $(addprefix $(outdir)/, $(TELY_FILES:.tely=.html))
18
19 PS_FILES = $(DVI_FILES:.dvi=.ps)
20 PDF_FILES = $(DVI_FILES:.dvi=.pdf)
21
22 PS_GZ_FILES= $(addsuffix .gz, $(PS_FILES))
23
24 INFO_DOCS = lilypond lilypond-internals music-glossary
25 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
26
27 STEPMAKE_TEMPLATES=tex texinfo omf documentation
28
29 OMF_FILES += $(outdir)/lilypond-internals.html.omf
30
31 TEXINFO_PAPERSIZE = @afourpaper
32 DVIPS_PAPERSIZE = a4
33
34 LOCALSTEPMAKE_TEMPLATES=lilypond ly
35 LILYPOND_BOOK_FLAGS=--extra-options '-e "(ly:set-option (quote internal-type-checking) \#t)"'
36
37 include $(depth)/make/stepmake.make 
38
39 # Ugh,ugh.
40 # emacs cannot fix the menu structure when @mbinclude is used
41 # lilypond.tely uses mbinclude
42 TEXINFO_SOURCES := $(filter-out lilypond.tely, $(TEXINFO_SOURCES))
43
44
45 dvi: $(DVI_FILES)
46
47 ps: $(PS_FILES)
48
49 # Cancel the default info generation rule.  We want to generate info
50 # from `.nexi', making sure we don't run LilyPond for inline pictures,
51 # when just generating info:
52
53 $(outdir)/%.info: $(outdir)/%.texi
54
55 default: 
56
57 # Info is now built by default via texinfo-rules.
58 # We must build them by default, otherwise they get built during make install
59 info: $(INFO_FILES)
60
61 local-help: extra-local-help
62
63 extra-local-help:
64         @echo -e "\
65   dvi         update dvi documents\n\
66   info        update info pages\n\
67   ps          update PostScript documents\n\
68 "
69
70 # Generic rule using % twice not possible?
71 # $(outdir)/%/%.html: $(outdir)/%.texi
72 $(outdir)/lilypond/lilypond.html: $(outdir)/lilypond.texi 
73         mkdir -p $(dir $@)
74         $(MAKEINFO) --output=$(outdir)/lilypond --html $<
75         -cp -f $(outdir)/*.{png,ly} $(outdir)/lilypond
76         -cp -f $(outdir)/lilypond/index.html $@
77         $(deep-footify) $(shell find $(outdir)/$(*F)/*.html)
78
79 $(outdir)/lilypond-internals/lilypond-internals.html: $(outdir)/lilypond-internals.texi
80         mkdir -p $(dir $@)
81         $(MAKEINFO) --output=$(outdir)/lilypond-internals --html $<
82         -cp -f $(outdir)/*.{png,ly} $(outdir)/lilypond-internals
83         -cp -f $(outdir)/lilypond-internals/index.html $@
84         $(deep-footify) $(shell find $(outdir)/$(*F)/*.html)
85
86 ifeq ($(SPLITTING_MAKEINFO),yes)
87
88 $(outdir)/lilypond.dvi: $(OUT_EPS_IMAGES) $(OUT_PNG_IMAGES)
89
90 $(outdir)/%.png: %.png
91         convert -resize 50x50% $< $@
92
93 $(outdir)/%.eps: %.png
94         convert $< $@
95
96 DEEP_HTML_FILES = $(outdir)/lilypond/lilypond.html $(outdir)/lilypond-internals/lilypond-internals.html
97
98 else
99
100 # Links referred to by Documentation index
101 LILYPOND_LINKS=Reference-Manual.html Tutorial.html Ly2dvi.html Midi2ly.html
102
103 local-WWW: outimages deep-symlinks
104
105 deep-symlinks:
106         mkdir -p $(outdir)/lilypond
107         cd $(outdir)/lilypond && $(foreach i, $(LILYPOND_LINKS),\
108                 rm -f $(i) && ln -s lilypond.html $(i) &&) true
109
110 endif
111
112
113 local-WWW: $(HTML_FILES) $(datafiles) $(PDF_FILES) $(PS_GZ_FILES) $(DEEP_HTML_FILES) info-dir
114
115 local-WWW-clean: deep-WWW-clean
116
117 deep-WWW-clean:
118         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals
119
120 info-dir:
121         $(SHELL) $(buildscript-dir)/install-info-html.sh --dir=$(outdir) lilypond lilypond-internals
122         $(MAKE) footify
123         $(MAKE) deep-footify
124
125
126 $(outdir)/%.bib: %.bib
127         ln -f $< $@
128 # we want footers even if website builds (or is built) partly
129         $(MAKE) footify
130
131 local-clean:
132         rm -f fonts.aux fonts.log feta*.tfm feta*.*pk 
133         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals
134
135 #$(outdir)/lilypond.nexi: $(outdir)/interfaces.itexi
136 #$(outdir)/lilypond.texi: $(outdir)/interfaces.itexi
137
138 # Rules for the automatically generated documentation
139 # When cross-compiling, we don't have lilypond, so we fake
140 ifneq ($(CROSS),yes)
141
142
143 # there used to be a dependency on a dummy target, to force a rebuild of lilypond-internals every time.
144 # however, this triggers compilation during install, which  is a bad thing (tm).
145
146 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(builddir)/lily/$(outconfbase)/lilypond
147         cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond --verbose $(abs-srcdir)/ly/generate-documentation
148         -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
149
150
151 ## unused
152 $(outdir)/interfaces.itexi: dummy
153         cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond $(abs-srcdir)/ly/generate-interface-doc
154
155 else
156
157 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi:
158         touch $@
159         touch $(outdir)/$(*F).nexi
160
161 $(outdir)/interfaces.itexi:
162         cp dummy-interfaces.itexi $@
163 endif
164
165