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