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