]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/GNUmakefile
Add build/out include for building lilypond.pdf. Fixes doc build.
[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_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 DOCUMENTATION_INCLUDES = \
33   -I $(top-src-dir)/Documentation/user \
34   -I $(top-build-dir)/Documentation/user/$(outdir)
35
36 TEXI2PDF_FLAGS = $(DOCUMENTATION_INCLUDES)
37
38 ifeq ($(out),www)
39 INFO_IMAGES_DIR = lilypond
40 DEST_INFO_IMAGES_SUBDIR = Documentation/user
41 endif
42
43 STEPMAKE_TEMPLATES=texinfo omf documentation
44 OMF_FILES += $(outdir)/lilypond-internals.html.omf
45
46 LOCALSTEPMAKE_TEMPLATES=lilypond ly
47
48 include $(depth)/make/stepmake.make
49
50 default:
51
52 info: $(INFO_FILES)
53         @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
54         @echo export PYTHONPATH=$(PYTHONPATH)
55
56 xml: $(outdir)/lilypond/lilypond.xml $(outdir)/lilypond-internals/lilypond-internals.xml
57
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 #
71 # Split manuals in HTML
72 #
73 $(outdir)/lilypond/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
74 $(outdir)/lilypond-learning/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES)
75
76
77 #
78 # Manuals in one big HTML page
79 #
80 $(outdir)/lilypond-big-page.html: $(OUT_PNG_IMAGES)
81 $(outdir)/lilypond-learning-big-page.html: $(OUT_PNG_IMAGES)
82
83 $(outdir)/lilypond.xml: $(outdir)/lilypond.texi
84         mkdir -p $(dir $@)
85         $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ --docbook $<
86
87 $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internals.texi
88         mkdir -p $(dir $@)
89         $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(outdir)/lilypond-internals --docbook $<
90
91 $(outdir)/lilypond.pdf $(outdir)/lilypond-learning.pdf: $(OUT_PDF_IMAGES)
92
93 $(outdir)/%.png: %.png
94         convert -depth 8 -geometry 50x50% $< $@
95
96 $(outdir)/%.png: %.eps
97         gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
98
99 $(outdir)/%.pdf: %.png
100         convert -depth 8 $< $@
101
102 $(outdir)/%.pdf: %.eps
103         gs -dAutoRotatePages=/None -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $<
104
105
106 DEEP_HTML_FILES =\
107  $(outdir)/lilypond/index.html\
108  $(outdir)/lilypond-internals/index.html\
109  $(outdir)/music-glossary/index.html\
110  $(outdir)/lilypond-program/index.html\
111  $(outdir)/lilypond-learning/index.html
112
113 # Symlinks to refer to external source documents from split and non-split HTML
114 source-links = $(outdir)/source $(outdir)/lilypond/source $(outdir)/music-glossary/source \
115  $(outdir)/lilypond-program/source $(outdir)/lilypond-learning/source $(outdir)/lilypond-internals/source
116
117 $(outdir)/source:
118         @rm -f $(@)
119         ln -sf $(depth) $(@)
120
121 $(outdir)/%/source:
122         @rm -f $(@)
123         mkdir -p $(dir $@)
124         ln -sf $(depth)/.. $(@)
125
126 local-WWW-1: $(MASTER_TEXI_FILES) $(PDF_FILES) info
127
128 local-WWW-2: $(HTML_FILES) $(DEEP_HTML_FILES) $(source-links)
129
130 $(outdir)/%.bib: %.bib
131         ln -f $< $@
132
133 # lilypond.texi deps
134 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
135         $(MAKE) -C $(top-src-dir)/mf
136
137 $(outdir)/lilypond.texi $(outdir)/lilypond-program.texi $(outdir)/lilypond-learning.texi $(outdir)/music-glossary.texi: $(ITELY_FILES) $(ITEXI_FILES)
138
139
140 # Rules for the automatically generated documentation
141
142 # There used to be a dependency on a dummy target, to force a rebuild
143 # of lilypond-internals every time.  however, this triggers
144 # compilation during install, which is a bad thing (tm).
145
146 $(outdir)/lilypond-internals.texi: $(LILYPOND_BINARY)
147         cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
148
149 .SECONDARY: