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