1 # DCP-o-matic manual makefile
3 INKSCAPE = ~/Applications/inkscape
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 \
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
25 # For the HTML: convert PDF screenshots to PNG and copy into html/screenshots, scaling some.
27 html/screenshots/%.png: screenshots/%.pdf
28 mkdir -p html/screenshots
29 pdftoppm $< $(basename $@) -png -f 1 -singlefile -rx 80 -ry 80
32 # For LaTeX/PDF: crop some of the PDF screenshots; use others as-is
33 screenshots/%.pdf: raw-screenshots/%.pdf
36 screenshots/prefs-general.pdf: raw-screenshots/prefs-general.pdf
37 python3 pdf_crop_by.py $< $@ 0 400 0 0
39 screenshots/prefs-defaults.pdf: raw-screenshots/prefs-defaults.pdf
40 python3 pdf_crop_by.py $< $@ 0 400 0 0
42 screenshots/prefs-servers.pdf: raw-screenshots/prefs-servers.pdf
43 python3 pdf_crop_by.py $< $@ 0 700 0 0
45 screenshots/prefs-keys.pdf: raw-screenshots/prefs-keys.pdf
46 python3 pdf_crop_by.py $< $@ 0 600 0 0
48 screenshots/prefs-tms.pdf: raw-screenshots/prefs-tms.pdf
49 python3 pdf_crop_by.py $< $@ 0 600 0 0
51 screenshots/prefs-email.pdf: raw-screenshots/prefs-email.pdf
52 python3 pdf_crop_by.py $< $@ 0 700 0 0
54 screenshots/prefs-cover-sheet.pdf: raw-screenshots/prefs-cover-sheet.pdf
55 python3 pdf_crop_by.py $< $@ 0 600 0 0
57 screenshots/examine-content.pdf: raw-screenshots/examine-content.pdf
58 python3 pdf_crop_by.py $< $@ 460 270 200 580
60 screenshots/audio-tab.pdf: raw-screenshots/audio-tab.pdf
61 python3 pdf_crop_by.py $< $@ 0 0 1480 420
63 screenshots/timing-tab.pdf: raw-screenshots/timing-tab.pdf
64 python3 pdf_crop_by.py $< $@ 0 100 1475 420
66 screenshots/timed-text-tab.pdf: raw-screenshots/timed-text-tab.pdf
67 python3 pdf_crop_by.py $< $@ 0 50 1480 420
69 screenshots/video-tab.pdf: raw-screenshots/video-tab.pdf
70 python3 pdf_crop_by.py $< $@ 0 0 1480 365
72 screenshots/add-file.pdf: raw-screenshots/add-file.pdf
73 python3 pdf_crop_by.py $< $@ 0 600 1210 0
75 screenshots/making-dcp.pdf: raw-screenshots/making-dcp.pdf
76 python3 pdf_crop_by.py $< $@ 470 190 300 700
78 screenshots/audio-map-eg1.pdf: raw-screenshots/audio-map-eg1.pdf
79 python3 pdf_crop_by.py $< $@ 10 195 1350 630
81 screenshots/audio-map-eg2.pdf: raw-screenshots/audio-map-eg2.pdf
82 python3 pdf_crop_by.py $< $@ 10 195 1350 630
84 screenshots/audio-map-eg3.pdf: raw-screenshots/audio-map-eg3.pdf
85 python3 pdf_crop_by.py $< $@ 10 75 1350 630
87 screenshots/dcp-tab.pdf: raw-screenshots/dcp-tab.pdf
88 python3 pdf_crop_by.py $< $@ 0 250 1480 30
91 # For HTML: convert diagrams from SVG to PNG
92 diagrams/%.png: diagrams/%.svg
93 $(INKSCAPE) $< --export-type=png --export-filename=$@ --export-area-drawing
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
99 config.xml: ../../src/lib/config.cc config.py
100 python3 config.py ../../src/lib/config.cc > config.xml
102 SHORTCUTS := ../../src/tools/dcpomatic.cc
104 shortcuts.xml: $(SHORTCUTS) shortcuts.py
105 python3 shortcuts.py $(SHORTCUTS) > $@
111 html: $(XML) config.xml shortcuts.xml dcpomatic-html.xsl extensions-html.ent dcpomatic.css dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
112 $(subst .pdf,.png,$(addprefix html/screenshots/,$(SCREENSHOTS))) \
113 $(subst .svg,.png,$(addprefix diagrams/,$(DIAGRAMS))) \
115 # The DocBook needs to know what file extensions to look for
116 # for screenshots and diagrams; use the correct file to tell it.
117 cp extensions-html.ent extensions.ent
120 xmlto html -m dcpomatic-html.xsl dcpomatic.xml --skip-validation -o html
122 # Copy graphics and CSS in
123 mkdir -p html/diagrams
124 cp diagrams/*.png html/diagrams
125 cp dcpomatic.css html
131 pdf: $(XML) config.xml dcpomatic-pdf.xsl extensions-pdf.ent dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \
132 $(addprefix screenshots/,$(SCREENSHOTS)) \
133 $(subst .svg,.pdf,$(addprefix diagrams/,$(DIAGRAMS)))
135 # The DocBook needs to know what file extensions to look for
136 # for screenshots and diagrams; use the correct file to tell it.
137 cp extensions-pdf.ent extensions.ent
141 dblatex -p dcpomatic-pdf.xsl -s dcpomatic.sty -r pptex.py -T native dcpomatic.xml -t pdf -o pdf/dcpomatic.pdf
145 # LaTeX (handy for debugging)
148 tex: $(XML) config.xml dcpomatic-pdf.xsl extensions-pdf.ent
150 # The DocBook needs to know what file extensions to look for
151 # for screenshots and diagrams; use the correct file to tell it.
152 cp extensions-pdf.ent extensions.ent
156 # -P <foo> removes the revhistory table
157 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
160 clean:; rm -rf html pdf diagrams/*.pdf diagrams/*.png graphics/*.png *.aux dcpomatic.cb dcpomatic.cb2 dcpomatic.glo dcpomatic.idx dcpomatic.ilg
161 rm -rf dcpomatic.ind dcpomatic.lof dcpomatic.log dcpomatic.tex dcpomatic.toc extensions.ent dcpomatic.out