]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
lilypond-book robustness: ensure EOL at the end of @verbatim
[lilypond.git] / Documentation / user / GNUmakefile
1 depth=../..
2
3 LATEX_FILES =$(call src-wildcard,*.latex)
4
5
6 EXTRA_DIST_FILES = $(LATEX_FILES) $(IMAGES) $(EPS_ILLUSTRATIONS)
7 EXTRA_DIST_FILES += README.txt
8
9 IMAGES=$(call src-wildcard,*.png)
10 EPS_ILLUSTRATIONS=context-example.eps
11 PDF_ILLUSTRATIONS=context-example.pdf
12
13 OUT_PDF_IMAGES=$(IMAGES:%.png=$(outdir)/%.pdf) $(addprefix $(outdir)/,$(PDF_ILLUSTRATIONS))
14
15 OUT_PNG_IMAGES=$(OUT_PDF_IMAGES:%.pdf=%.png)
16
17 OUT_MASTER_TEXI_FILES = $(outdir)/lilypond-internals.texi
18 OUT_TEXI_FILES=$(ITEXI_FILES:%.itexi=$(outdir)/%.texi)\
19  $(ITELY_FILES:%.itely=$(outdir)/%.texi)
20
21 HTML_FILES = $(TELY_FILES:%.tely=$(outdir)/%-big-page.html)\
22  $(outdir)/lilypond-internals-big-page.html
23
24 # todo: add latex.
25 PDF_FILES = $(TELY_FILES:%.tely=$(outdir)/%.pdf)\
26  $(outdir)/lilypond-internals.pdf
27
28 MAIN_INFO_DOC = lilypond
29 INFO_DOCS = lilypond lilypond-internals music-glossary lilypond-program lilypond-learning
30 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
31
32 TEXI2PDF_FLAGS = \
33   -I $(outdir) \
34   -I $(top-src-dir)/Documentation/user \
35   -I $(top-build-dir)/Documentation/user/$(outconfbase)
36
37 ifeq ($(out),www)
38 INFO_IMAGES_DIR = lilypond
39 DEST_INFO_IMAGES_SUBDIR = Documentation/user
40 endif
41
42 STEPMAKE_TEMPLATES=texinfo omf documentation
43 OMF_FILES += $(outdir)/lilypond-internals.html.omf
44
45 LOCALSTEPMAKE_TEMPLATES=lilypond ly
46
47 include $(depth)/make/stepmake.make
48
49 default:
50
51 info: $(INFO_FILES)
52         @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
53         @echo export PYTHONPATH=$(PYTHONPATH)
54
55 xml: $(outdir)/lilypond/lilypond.xml $(outdir)/lilypond-internals/lilypond-internals.xml
56
57
58 local-clean:
59         rm -f $(INFO_IMAGES_DIR)
60
61 local-help: extra-local-help
62
63 extra-local-help:
64         @echo -e "\
65   info        update info pages\n\
66   xml         update Docbook xml documentation\n\
67 "
68
69 #
70 # Split manuals in HTML
71 #
72 $(outdir)/lilypond/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
73 $(outdir)/lilypond-learning/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
74
75
76 #
77 # Manuals in one big HTML page
78 #
79 $(outdir)/lilypond-big-page.html: $(OUT_PNG_IMAGES)
80 $(outdir)/lilypond-learning-big-page.html: $(OUT_PNG_IMAGES)
81
82 $(outdir)/lilypond.xml: $(outdir)/lilypond.texi
83         mkdir -p $(dir $@)
84         $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ --docbook $<
85
86 $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internals.texi
87         mkdir -p $(dir $@)
88         $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(outdir)/lilypond-internals --docbook $<
89
90 $(outdir)/lilypond.pdf $(outdir)/lilypond-learning.pdf: $(OUT_PDF_IMAGES)
91
92 $(outdir)/%.png: %.png
93         convert -depth 8 -geometry 50x50% $< $@
94
95 $(outdir)/%.png: %.eps
96         gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
97
98 $(outdir)/%.pdf: %.png
99         convert -depth 8 $< $@
100
101 $(outdir)/%.pdf: %.eps
102         gs -dAutoRotatePages=/None -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $<
103
104
105 DEEP_HTML_FILES =\
106  $(outdir)/lilypond/index.html\
107  $(outdir)/lilypond-internals/index.html\
108  $(outdir)/music-glossary/index.html\
109  $(outdir)/lilypond-program/index.html\
110  $(outdir)/lilypond-learning/index.html
111
112 # Symlinks to refer to external source documents from split and non-split HTML
113 source-links = $(outdir)/source $(outdir)/lilypond/source $(outdir)/music-glossary/source \
114  $(outdir)/lilypond-program/source $(outdir)/lilypond-learning/source $(outdir)/lilypond-internals/source
115
116 $(outdir)/source:
117         @rm -f $(@)
118         ln -sf $(depth) $(@)
119
120 $(outdir)/%/source:
121         @rm -f $(@)
122         mkdir -p $(dir $@)
123         ln -sf $(depth)/.. $(@)
124
125 ifeq ($(out),www)
126 local-WWW-1: $(MASTER_TEXI_FILES) $(PDF_FILES) info
127
128 local-WWW-2: $(HTML_FILES) $(DEEP_HTML_FILES) $(source-links)
129 endif
130
131 $(outdir)/%.bib: %.bib
132         ln -f $< $@
133
134 # lilypond.texi deps
135 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
136         $(MAKE) -C $(top-src-dir)/mf
137
138 $(outdir)/lilypond.texi $(outdir)/lilypond-program.texi $(outdir)/lilypond-learning.texi $(outdir)/music-glossary.texi: $(ITELY_FILES) $(ITEXI_FILES)
139
140 $(outdir)/lilypond.texi: $(outdir)/ly-grammar.txt
141
142 # Rules for the automatically generated documentation
143
144 $(outdir)/ly-grammar.txt: $(top-src-dir)/lily/parser.yy
145         cd $(outdir) && $(BISON) -v $<
146         $(auxscript-dir)/yyout2grammar.py $(outdir)/parser.output $@
147
148 # There used to be a dependency on a dummy target, to force a rebuild
149 # of lilypond-internals every time.  however, this triggers
150 # compilation during install, which is a bad thing (tm).
151
152 $(outdir)/lilypond-internals.texi: $(LILYPOND_BINARY)
153         cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
154
155 .SECONDARY: