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