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