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