]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
Merge branch 'master' of ssh://kainhofer@git.sv.gnu.org/srv/git/lilypond into dev...
[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 writing-texinfo.txt policy.txt writing-sections.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_TEXI_FILES=$(ITEXI_FILES:%.itexi=$(outdir)/%.texi)\
18  $(ITELY_FILES:%.itely=$(outdir)/%.texi)
19
20 MASTER_TEXI_FILES = $(TELY_FILES:%.tely=$(outdir)/%.texi)\
21  $(outdir)/lilypond-internals.texi
22
23 HTML_FILES = $(TELY_FILES:%.tely=$(outdir)/%-big-page.html)\
24  $(outdir)/lilypond-internals-big-page.html
25
26 # todo: add latex.
27 PDF_FILES = $(TELY_FILES:%.tely=$(outdir)/%.pdf)
28
29 MAIN_INFO_DOC = lilypond
30 INFO_DOCS = lilypond lilypond-internals music-glossary lilypond-program lilypond-learning
31 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
32
33 ifeq ($(out),www)
34 INFO_IMAGES_DIR = lilypond
35 DEST_INFO_IMAGES_SUBDIR = Documentation/user
36 endif
37
38 STEPMAKE_TEMPLATES=texinfo omf documentation
39 OMF_FILES += $(outdir)/lilypond-internals.html.omf
40
41 LOCALSTEPMAKE_TEMPLATES=lilypond ly
42
43 include $(depth)/make/stepmake.make
44
45 default:
46
47 info: $(INFO_FILES)
48         @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
49         @echo export PYTHONPATH=$(PYTHONPATH)
50
51 xml: $(outdir)/lilypond/lilypond.xml $(outdir)/lilypond-internals/lilypond-internals.xml
52
53
54 # All web targets, except info image symlinks and info docs are
55 # installed in non-recursing target from TOP-SRC-DIR
56 local-install-WWW: local-install-info
57 local-uninstall-WWW: local-uninstall-info
58
59 local-clean:
60         rm -f $(INFO_IMAGES_DIR)
61
62 local-help: extra-local-help
63
64 extra-local-help:
65         @echo -e "\
66   info        update info pages\n\
67   xml         update Docbook xml documentation\n\
68 "
69
70 $(outdir)/lilypond.texi: $(outdir)/lilypond-internals.texi
71
72 #
73 # Split manuals in HTML
74 #
75 $(outdir)/lilypond/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
76 $(outdir)/lilypond-learning/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
77
78
79 #
80 # Manuals in one big HTML page
81 #
82 $(outdir)/lilypond-big-page.html: $(OUT_PNG_IMAGES)
83 $(outdir)/lilypond-learning-big-page.html: $(OUT_PNG_IMAGES)
84
85 $(outdir)/lilypond.xml: $(outdir)/lilypond.texi
86         mkdir -p $(dir $@)
87         $(MAKEINFO) -I$(outdir) --output=$@ --docbook $<
88
89 $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internals.texi
90         mkdir -p $(dir $@)
91         $(MAKEINFO) --output=$(outdir)/lilypond-internals --docbook $<
92
93 $(outdir)/lilypond.pdf $(outdir)/lilypond-learning.pdf: $(OUT_PDF_IMAGES)
94
95 $(outdir)/%.png: %.png
96         convert -depth 8 -geometry 50x50% $< $@
97
98 $(outdir)/%.png: %.eps
99         gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
100
101 $(outdir)/%.pdf: %.png
102         convert -depth 8 $< $@
103
104 $(outdir)/%.pdf: %.eps
105         gs -dAutoRotatePages=/None -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $<
106
107
108 DEEP_HTML_FILES =\
109  $(outdir)/lilypond/index.html\
110  $(outdir)/lilypond-internals/index.html\
111  $(outdir)/music-glossary/index.html\
112  $(outdir)/lilypond-program/index.html\
113  $(outdir)/lilypond-learning/index.html
114
115 # Symlinks to refer to external source documents from split and non-split HTML
116 source-links = $(outdir)/source $(outdir)/lilypond/source $(outdir)/music-glossary/source \
117  $(outdir)/lilypond-program/source $(outdir)/lilypond-learning/source
118
119 $(outdir)/source:
120         @rm -f $(@)
121         ln -sf $(depth) $(@)
122
123 $(outdir)/%/source:
124         @rm -f $(@)
125         mkdir -p $(dir $@)
126         ln -sf $(depth)/.. $(@)
127
128 local-WWW-1: $(MASTER_TEXI_FILES) $(MASTER_TEXI_FILES:%.texi=%.xref-map) $(outdir)/lilypond-snippets.xref-map $(PDF_FILES) info
129
130 local-WWW-2: $(HTML_FILES) $(DEEP_HTML_FILES) $(source-links)
131
132 $(outdir)/%.bib: %.bib
133         ln -f $< $@
134
135 $(outdir)/lilypond-snippets.xref-map:
136         ln -fs ../../../input/lsr/$@ $@
137
138 # lilypond.texi deps
139 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
140         $(MAKE) -C $(top-src-dir)/mf
141
142 $(outdir)/lilypond.texi $(outdir)/lilypond-program.texi $(outdir)/lilypond-learning.texi $(outdir)/music-glossary.texi: $(ITELY_FILES) $(ITEXI_FILES)
143
144
145 # Rules for the automatically generated documentation
146
147 # There used to be a dependency on a dummy target, to force a rebuild
148 # of lilypond-internals every time.  however, this triggers
149 # compilation during install, which is a bad thing (tm).
150
151 $(outdir)/lilypond-internals.texi: $(LILYPOND_BINARY)
152         cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
153
154 .SECONDARY: