Fix manual build.
[dcpomatic.git] / doc / manual / Makefile
1 # DCP-o-matic manual makefile
2
3 all:    html pdf
4
5 DIAGRAMS := file-structure.svg 3d-left-right.svg 3d-top-bottom.svg timecode.svg pipeline1.svg pipeline2.svg \
6             pipeline3.svg pipeline4.svg burn-in.svg discrete.svg dcp-copy.svg dcp-refer.svg reels-by-video.svg \
7             crypt.svg
8
9 SCREENSHOTS := file-new.png video-new-film.png still-new-film.png video-select-content-file.png \
10                still-select-content-file.png examine-thumbs.png examine-content.png timing-tab.png \
11                calculate-audio-gain.png add-file.png dcp-tab.png colour-conversion.png \
12                prefs-kdm-email.png prefs-general.png prefs-tms.png \
13                prefs-advanced.png prefs-defaults.png prefs-servers.png prefs-keys.png \
14                making-dcp.png filters.png video-tab.png audio-tab.png timing-tab.png \
15                audio-plot.png audio-map-eg1.png audio-map-eg2.png audio-map-eg3.png kdm.png \
16                kdm-creator.png
17
18 XML := dcpomatic.xml
19
20 #
21 # For the HTML: copy screenshots into html/screenshots, scaling some.
22 #
23 html/screenshots/%.png: screenshots/%.png
24         mkdir -p html/screenshots
25         cp $< $@
26 html/screenshots/editor.png: screenshots/editor.png
27         mkdir -p html/screenshots
28         convert -resize 50% $< $@
29 html/screenshots/mixer.png: screenshots/mixer.png
30         mkdir -p html/screenshots
31         convert -resize 50% $< $@
32 html/screenshots/default-folder-for-new-sessions.png: screenshots/default-folder-for-new-sessions.png
33         mkdir -p html/screenshots
34         convert -resize 75% $< $@
35 html/screenshots/welcome-to-ardour.png: screenshots/welcome-to-ardour.png
36         mkdir -p html/screenshots
37         convert -resize 75% $< $@
38 html/screenshots/monitoring-choices.png: screenshots/monitoring-choices.png
39         mkdir -p html/screenshots
40         convert -resize 75% $< $@
41 html/screenshots/monitor-section.png: screenshots/monitor-section.png
42         mkdir -p html/screenshots
43         convert -resize 75% $< $@
44 html/screenshots/audio-midi-setup-device.png: screenshots/audio-midi-setup-device.png
45         mkdir -p html/screenshots
46         convert -resize 75% $< $@
47 html/screenshots/new-session.png: screenshots/new-session.png
48         mkdir -p html/screenshots
49         convert -resize 75% $< $@
50 html/screenshots/export-dialogue.png: screenshots/export-dialogue.png
51         mkdir -p html/screenshots
52         convert -resize 75% $< $@
53 html/screenshots/making-dcp.png: screenshots/making-dcp.png
54         mkdir -p html/screenshots
55         convert -resize 75% $< $@
56 html/screenshots/kdm-creator.png: screenshots/kdm-creator.png
57         mkdir -p html/screenshots
58         convert -resize 75% $< $@
59
60 # For HTML: convert diagrams from SVG to PNG
61 diagrams/%.png: diagrams/%.svg
62         inkscape -z -f $< --export-png $@ --export-area-drawing
63
64 # For LaTeX/PDF: convert diagrams from SVG to PDF
65 diagrams/%.pdf: diagrams/%.svg
66         inkscape -z -f $< --export-pdf $@ --export-area-drawing
67
68 config.xml:     ../../src/lib/config.cc config.py
69         python3 config.py ../../src/lib/config.cc > config.xml
70
71 # These require the tools to be runnable, so make needs to be run
72 # in a built tree to update them.  The .xml files are committed
73 # to git to avoid this always being necessary.
74 dcpomatic_create.xml:   ../../src/tools/dcpomatic_create.cc cli.py
75         python3 cli.py dcpomatic_create > dcpomatic_create.xml
76
77 dcpomatic_cli.xml:      ../../src/tools/dcpomatic_cli.cc cli.py
78         python3 cli.py dcpomatic_cli > dcpomatic_cli.xml
79
80 dcpomatic_kdm_cli.xml:  ../../src/tools/dcpomatic_kdm_cli.cc cli.py
81         python3 cli.py dcpomatic_kdm_cli > dcpomatic_kdm_cli.xml
82
83 #
84 # HTML
85 #
86
87 html:   $(XML) config.xml dcpomatic-html.xsl extensions-html.ent dcpomatic.css dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
88         $(addprefix html/screenshots/,$(SCREENSHOTS)) \
89         $(subst .svg,.png,$(addprefix diagrams/,$(DIAGRAMS))) \
90
91 #       The DocBook needs to know what file extensions to look for
92 #       for screenshots and diagrams; use the correct file to tell it.
93         cp extensions-html.ent extensions.ent
94
95 #       DocBoox -> html
96         xmlto html -m dcpomatic-html.xsl dcpomatic.xml --skip-validation -o html
97
98 #       Copy graphics and CSS in
99         mkdir -p html/diagrams
100         cp diagrams/*.png html/diagrams
101         cp dcpomatic.css html
102
103 #
104 # PDF
105 #
106
107 pdf:    $(XML) config.xml dcpomatic-pdf.xsl extensions-pdf.ent dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
108         $(addprefix screenshots/,$(SCREENSHOTS)) \
109         $(subst .svg,.pdf,$(addprefix diagrams/,$(DIAGRAMS)))
110
111 #       The DocBook needs to know what file extensions to look for
112 #       for screenshots and diagrams; use the correct file to tell it.
113         cp extensions-pdf.ent extensions.ent
114
115         mkdir -p pdf
116
117         dblatex -p dcpomatic-pdf.xsl -s dcpomatic.sty -r pptex.py -T native dcpomatic.xml -t pdf -o pdf/dcpomatic.pdf
118
119
120 #
121 # LaTeX (handy for debugging)
122 #
123
124 tex:    $(XML) config.xml dcpomatic-pdf.xsl extensions-pdf.ent
125
126 #       The DocBook needs to know what file extensions to look for
127 #       for screenshots and diagrams; use the correct file to tell it.
128         cp extensions-pdf.ent extensions.ent
129
130         mkdir -p tex
131
132 #       -P <foo> removes the revhistory table
133         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
134
135
136 clean:; rm -rf html pdf diagrams/*.pdf diagrams/*.png graphics/*.png *.aux dcpomatic.cb dcpomatic.cb2 dcpomatic.glo dcpomatic.idx dcpomatic.ilg
137         rm -rf dcpomatic.ind dcpomatic.lof dcpomatic.log dcpomatic.tex dcpomatic.toc extensions.ent dcpomatic.out