]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
patch::: 1.3.140.jcn5
[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)  $(OUTDOC_FILES:.doc=.ps) $(OUTTEX_FILES:.tex=.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 defaulbt, otherwise they get built during make install
50 info: $(INFO_FILES)
51
52
53 # The new pretest version of makeinfo, 4.0a splits html files into their own
54 # directory.  Available from
55 # ftp://texinfo.org/texinfo/pretests/texinfo-4.0a.tar.gz
56 SPLITTING_MAKEINFO = $(shell makeinfo --version | egrep '4.0((.jcn[2,3])|a)')
57
58
59 # Generic rule using % twice not possible?
60 # $(outdir)/%/%.html: $(outdir)/%.texi
61 $(outdir)/lilypond/lilypond.html: $(outdir)/lilypond.texi
62         $(MAKEINFO) --output=$@ --html $<
63         -cp -f $(outdir)/*.png $(outdir)/lilypond
64         -cp -f $(outdir)/lilypond/index.html $@
65         $(deep-footify) $(shell find $(outdir)/$(*F)/*.html)
66
67 $(outdir)/lilypond-internals/lilypond-internals.html: $(outdir)/lilypond-internals.texi
68         $(MAKEINFO) --output=$@ --html $<
69         -cp -f $(outdir)/*.png $(outdir)/lilypond-internals
70         -cp -f $(outdir)/lilypond-internals/index.html $@
71         $(deep-footify) $(shell find $(outdir)/$(*F)/*.html)
72
73 ifneq ($(SPLITTING_MAKEINFO),)
74
75 DEEP_HTML_FILES = $(outdir)/lilypond/lilypond.html $(outdir)/lilypond-internals/lilypond-internals.html
76
77 else
78
79 DEEP_HTML_FILES = $(outdir)/lilypond.html $(outdir)/lilypond-internals.html
80
81 local-WWW: deep-symlinks
82
83
84
85 # Links referred to by Documentation index
86 LILYPOND_LINKS=Reference-Manual.html Features.html Ly2dvi.html Midi2ly.html
87
88 deep-symlinks:
89         cd $(outdir) && rm -f lilypond && ln -s . lilypond
90         cd $(outdir) && rm -f lilypond-internals && ln -s . lilypond-internals
91         cd $(outdir) && $(foreach i, $(LILYPOND_LINKS),\
92                 rm -f $(i) && ln -s lilypond.html $(i) &&) true
93 endif
94
95
96 local-WWW: $(HTML_FILES) $(datafiles) $(PS_GZ_FILES) $(DEEP_HTML_FILES) info-dir
97
98 local-WWW-clean: deep-WWW-clean
99
100 deep-WWW-clean:
101         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals
102
103 info-dir:
104         $(SHELL) $(buildscript-dir)/install-info-html.sh --dir=$(outdir) lilypond lilypond-internals
105         $(MAKE) footify
106         $(MAKE) deep-footify
107
108
109 $(outdir)/%.bib: %.bib
110         ln -f $< $@
111 # we want footers even if website builds (or is built) partly
112         $(MAKE) footify
113
114 local-clean:
115         rm -f fonts.aux fonts.log feta*.tfm feta*.*pk 
116         rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals
117
118 # when cross-compiling, we don't have lilypond
119 ifneq ($(CROSS),yes)
120 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi:
121         cd $(outdir) && ../$(depth)/$(builddir)/lily/$(outconfbase)/lilypond ../$(src-depth)/ly/generate-documentation
122         -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
123 else
124 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi:
125         touch $@
126         touch $(outdir)/$(*F).nexi
127 endif
128