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