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