Supporters update.
[dcpomatic.git] / doc / manual / Makefile
1 # DCP-o-matic manual makefile
2
3 INKSCAPE = ~/Applications/inkscape
4 LIBDCP = ~/src/libdcp
5
6
7 all:    html pdf
8
9 DIAGRAMS := file-structure.svg 3d-left-right.svg 3d-top-bottom.svg timecode.svg pipeline1.svg pipeline2.svg \
10             pipeline3.svg pipeline4.svg burn-in.svg discrete.svg dcp-copy.svg dcp-refer.svg reels-by-video.svg \
11             crypt.svg
12
13 SCREENSHOTS := file-new.pdf new-film.pdf video-select-content-file.pdf \
14                still-select-content-file.pdf examine-content.pdf timing-tab.pdf \
15                calculate-audio-gain.pdf add-file.pdf dcp-tab.pdf colour-conversion.pdf \
16                prefs-email.pdf prefs-kdm-email.pdf prefs-general.pdf prefs-tms.pdf prefs-cover-sheet.pdf \
17                prefs-advanced.pdf prefs-defaults.pdf prefs-servers.pdf prefs-keys.pdf \
18                prefs-notifications.pdf timeline1.pdf timed-text-tab.pdf \
19                making-dcp.pdf filters.pdf video-tab.pdf audio-tab.pdf \
20                audio-plot.pdf audio-map-eg1.pdf audio-map-eg2.pdf audio-map-eg3.pdf kdm.pdf \
21                kdm-creator.pdf export.pdf advanced-content.pdf disk-writer-notice.pdf disk-writer.pdf \
22                markers.pdf prefs-notifications.pdf prefs-cover-sheet.pdf add-screen.pdf \
23                advanced-player.pdf playlist-editor.pdf playlist-editor-prefs.pdf
24
25 XML := dcpomatic.xml
26
27 #
28 # For the HTML: convert PDF screenshots to PNG and copy into html/screenshots, scaling some.
29 #
30 html/screenshots/%.png: screenshots/%.pdf
31         mkdir -p html/screenshots
32         pdftoppm $< $(basename $@) -png -f 1 -singlefile -rx 80 -ry 80
33
34
35 # For LaTeX/PDF: crop some of the PDF screenshots; use others as-is
36 screenshots/%.pdf: raw-screenshots/%.pdf
37         cp $< $@
38
39 screenshots/prefs-general.pdf: raw-screenshots/prefs-general.pdf
40         python3 pdf_crop_by.py $< $@ 0 400 0 0
41
42 screenshots/prefs-defaults.pdf: raw-screenshots/prefs-defaults.pdf
43         python3 pdf_crop_by.py $< $@ 0 400 0 0
44
45 screenshots/prefs-servers.pdf: raw-screenshots/prefs-servers.pdf
46         python3 pdf_crop_by.py $< $@ 0 700 0 0
47
48 screenshots/prefs-keys.pdf: raw-screenshots/prefs-keys.pdf
49         python3 pdf_crop_by.py $< $@ 0 600 0 0
50
51 screenshots/prefs-tms.pdf: raw-screenshots/prefs-tms.pdf
52         python3 pdf_crop_by.py $< $@ 0 600 0 0
53
54 screenshots/prefs-email.pdf: raw-screenshots/prefs-email.pdf
55         python3 pdf_crop_by.py $< $@ 0 700 0 0
56
57 screenshots/prefs-cover-sheet.pdf: raw-screenshots/prefs-cover-sheet.pdf
58         python3 pdf_crop_by.py $< $@ 0 600 0 0
59
60 screenshots/examine-content.pdf: raw-screenshots/examine-content.pdf
61         python3 pdf_crop_by.py $< $@ 460 270 200 580
62
63 screenshots/audio-tab.pdf: raw-screenshots/audio-tab.pdf
64         python3 pdf_crop_by.py $< $@ 0 0 1480 420
65
66 screenshots/timing-tab.pdf: raw-screenshots/timing-tab.pdf
67         python3 pdf_crop_by.py $< $@ 0 100 1475 420
68
69 screenshots/timed-text-tab.pdf: raw-screenshots/timed-text-tab.pdf
70         python3 pdf_crop_by.py $< $@ 0 50 1480 420
71
72 screenshots/video-tab.pdf: raw-screenshots/video-tab.pdf
73         python3 pdf_crop_by.py $< $@ 0 0 1480 365
74
75 screenshots/add-file.pdf: raw-screenshots/add-file.pdf
76         python3 pdf_crop_by.py $< $@ 0 600 1210 0
77
78 screenshots/making-dcp.pdf: raw-screenshots/making-dcp.pdf
79         python3 pdf_crop_by.py $< $@ 470 190 300 700
80
81 screenshots/audio-map-eg1.pdf: raw-screenshots/audio-map-eg1.pdf
82         python3 pdf_crop_by.py $< $@ 10 195 1350 630
83
84 screenshots/audio-map-eg2.pdf: raw-screenshots/audio-map-eg2.pdf
85         python3 pdf_crop_by.py $< $@ 10 195 1350 630
86
87 screenshots/audio-map-eg3.pdf: raw-screenshots/audio-map-eg3.pdf
88         python3 pdf_crop_by.py $< $@ 10 75 1350 630
89
90 screenshots/dcp-tab.pdf: raw-screenshots/dcp-tab.pdf
91         python3 pdf_crop_by.py $< $@ 0 350 1240 30
92
93
94 # For HTML: convert diagrams from SVG to PNG
95 diagrams/%.png: diagrams/%.svg
96         $(INKSCAPE) $< --export-type=png --export-filename=$@ --export-area-drawing
97
98 # For LaTeX/PDF: convert diagrams from SVG to PDF
99 diagrams/%.pdf: diagrams/%.svg
100         $(INKSCAPE) $< --export-type=pdf --export-filename=$@ --export-area-drawing
101
102 config.xml:     ../../src/lib/config.cc config.py
103         python3 config.py ../../src/lib/config.cc > config.xml
104
105 SHORTCUTS :=    ../../src/tools/dcpomatic.cc
106
107 shortcuts.xml:  $(SHORTCUTS) shortcuts.py
108         python3 shortcuts.py $(SHORTCUTS) > $@
109
110 LIBDCP_DEPS = $(LIBDCP)/src/verify_j2k.cc $(LIBDCP)/src/dcp.cc $(LIBDCP)/src/verify.cc
111
112 verify_errors.xml:      verifier.py $(LIBDCP_DEPS)
113         python3 verifier.py $(LIBDCP) ERROR > $@
114
115 verify_bv21_errors.xml: verifier.py $(LIBDCP_DEPS)
116         python3 verifier.py $(LIBDCP) BV21_ERROR > $@
117
118 verify_warnings.xml:    verifier.py $(LIBDCP_DEPS)
119         python3 verifier.py $(LIBDCP) WARNING > $@
120
121
122 #
123 # HTML
124 #
125
126 html:   $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml verify_warnings.xml \
127         dcpomatic-html.xsl extensions-html.ent dcpomatic.css dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
128         $(subst .pdf,.png,$(addprefix html/screenshots/,$(SCREENSHOTS))) \
129         $(subst .svg,.png,$(addprefix diagrams/,$(DIAGRAMS))) \
130
131 #       The DocBook needs to know what file extensions to look for
132 #       for screenshots and diagrams; use the correct file to tell it.
133         cp extensions-html.ent extensions.ent
134
135 #       DocBoox -> html
136         xmlto html -m dcpomatic-html.xsl dcpomatic.xml --skip-validation -o html
137
138 #       Copy graphics and CSS in
139         mkdir -p html/diagrams
140         cp diagrams/*.png html/diagrams
141         cp dcpomatic.css html
142
143 #
144 # PDF
145 #
146
147 pdf:    $(XML) config.xml shortcuts.xml verify_errors.xml verify_bv21_errors.xml verify_warnings.xml \
148         dcpomatic-pdf.xsl extensions-pdf.ent dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
149         $(addprefix screenshots/,$(SCREENSHOTS)) \
150         $(subst .svg,.pdf,$(addprefix diagrams/,$(DIAGRAMS)))
151
152 #       The DocBook needs to know what file extensions to look for
153 #       for screenshots and diagrams; use the correct file to tell it.
154         cp extensions-pdf.ent extensions.ent
155
156         mkdir -p pdf
157
158         dblatex -p dcpomatic-pdf.xsl -s dcpomatic.sty -r pptex.py -T native dcpomatic.xml -t pdf -o pdf/dcpomatic.pdf
159
160
161 #
162 # LaTeX (handy for debugging)
163 #
164
165 tex:    $(XML) config.xml dcpomatic-pdf.xsl extensions-pdf.ent
166
167 #       The DocBook needs to know what file extensions to look for
168 #       for screenshots and diagrams; use the correct file to tell it.
169         cp extensions-pdf.ent extensions.ent
170
171         mkdir -p tex
172
173 #       -P <foo> removes the revhistory table
174         dblatex -P doc.collab.show=0 -P latex.output.revhistory=0 -p dcpomatic-pdf.xsl -s dcpomatic.sty -r pptex.py -T native dcpomatic.xml -t tex -o tex/dcpomatic.tex
175
176
177 clean:; rm -rf html pdf diagrams/*.pdf diagrams/*.png graphics/*.png *.aux dcpomatic.cb dcpomatic.cb2 dcpomatic.glo dcpomatic.idx dcpomatic.ilg
178         rm -rf dcpomatic.ind dcpomatic.lof dcpomatic.log dcpomatic.tex dcpomatic.toc extensions.ent dcpomatic.out