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