]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
Change Snippets compilation
[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 HTML_FILES = $(TELY_FILES:%.tely=$(outdir)/%-big-page.html)\
20  $(outdir)/lilypond-internals-big-page.html
21
22 # todo: add latex.
23 PDF_FILES = $(TELY_FILES:%.tely=$(outdir)/%.pdf)
24 # this prevents aux files from being reused for translated docs
25 TEXI2PDF_FLAGS = --tidy
26
27 MAIN_INFO_DOC = lilypond
28 INFO_DOCS = lilypond lilypond-internals music-glossary lilypond-program lilypond-learning
29 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
30
31 ifeq ($(out),www)
32 INFO_IMAGES_DIR = lilypond
33 DEST_INFO_IMAGES_SUBDIR = Documentation/user
34 endif
35
36 STEPMAKE_TEMPLATES=tex texinfo omf documentation
37 OMF_FILES += $(outdir)/lilypond-internals.html.omf
38
39 LOCALSTEPMAKE_TEMPLATES=lilypond ly
40
41
42 TEXINPUTS=$(top-src-dir)/tex::
43 export TEXINPUTS
44
45 include $(depth)/make/stepmake.make
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 default:
60
61 local-clean:
62         rm -f $(INFO_IMAGES_DIR)
63
64 local-help: extra-local-help
65
66 extra-local-help:
67         @echo -e "\
68   info        update info pages\n\
69   ps          update PostScript documents\n\
70   xml         update Docbook xml documentation\n\
71 "
72
73 # Generic rule using % twice not possible?
74 # $(outdir)/%/%.html: $(outdir)/%.texi
75 $(outdir)/lilypond.texi: $(outdir)/lilypond-internals.texi
76 $(outdir)/lilypond.nexi: $(outdir)/lilypond-internals.texi
77
78 #
79 # Split manuals in HTML
80 #
81 $(outdir)/lilypond/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
82 $(outdir)/lilypond-learning/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
83
84
85 #
86 # Manuals in one big HTML page
87 #
88 $(outdir)/lilypond-big-page.html: $(OUT_PNG_IMAGES)
89 $(outdir)/lilypond-learning-big-page.html: $(OUT_PNG_IMAGES)
90
91 $(outdir)/lilypond.xml: $(outdir)/lilypond.texi
92         mkdir -p $(dir $@)
93         $(MAKEINFO) -I$(outdir) --output=$@ --docbook $<
94
95 $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internals.texi
96         mkdir -p $(dir $@)
97         $(MAKEINFO) --output=$(outdir)/lilypond-internals --docbook $<
98
99 $(outdir)/lilypond.pdf $(outdir)/lilypond-learning.pdf: $(OUT_PDF_IMAGES)
100
101 $(outdir)/%.png: %.png
102         convert -depth 8 -geometry 50x50% $< $@
103
104 $(outdir)/%.png: %.eps
105         gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
106
107 $(outdir)/%.pdf: %.png
108         convert -depth 8 $< $@
109
110 $(outdir)/%.pdf: %.eps
111         gs -dAutoRotatePages=/None -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $<
112
113
114 DEEP_HTML_FILES =\
115  $(outdir)/lilypond/index.html\
116  $(outdir)/lilypond-internals/index.html\
117  $(outdir)/music-glossary/index.html\
118  $(outdir)/lilypond-program/index.html\
119  $(outdir)/lilypond-learning/index.html
120
121 # Symlinks to refer to external source documents from split and non-split HTML
122 source-links = $(outdir)/source $(outdir)/lilypond/source $(outdir)/music-glossary/source \
123  $(outdir)/lilypond-program/source $(outdir)/lilypond-learning/source
124
125 $(outdir)/source:
126         @rm -f $(@)
127         ln -sf ../../ $(@)
128
129 $(outdir)/%/source:
130         @rm -f $(@)
131         mkdir -p $(dir $@)
132         ln -sf ../../../ $(@)
133
134 local-WWW: $(HTML_FILES) $(DEEP_HTML_FILES)\
135  $(datafiles) $(PDF_FILES) $(source-links) info
136
137 $(outdir)/%.bib: %.bib
138         ln -f $< $@
139
140
141 # lilypond.texi deps
142 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
143         $(MAKE) -C $(top-src-dir)/mf
144
145 $(outdir)/lilypond.texi $(outdir)/lilypond-program.texi $(outdir)/lilypond-learning.texi $(outdir)/music-glossary.texi: $(ITELY_FILES) $(ITEXI_FILES)
146 $(outdir)/lilypond.nexi $(outdir)/lilypond-program.nexi $(outdir)/lilypond-learning.nexi $(outdir)/music-glossary.nexi: $(ITELY_FILES) $(ITEXI_FILES)
147
148
149 # Rules for the automatically generated documentation
150
151 # There used to be a dependency on a dummy target, to force a rebuild
152 # of lilypond-internals every time.  however, this triggers
153 # compilation during install, which is a bad thing (tm).
154
155 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(LILYPOND_BINARY)
156         cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
157         rm -f $(outdir)/lilypond-internals.nexi
158         -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
159
160
161 ## unused
162 $(outdir)/interfaces.itexi: dummy
163         cd $(outdir) && lilypond $(top-src-dir)/ly/generate-interface-doc