-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathimages.mk
66 lines (56 loc) · 2.19 KB
/
images.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Convert images
#
# Targets generated by this Makefile are committed to Git LFS. This is due to
# image conversion tools not being available in the readthedocs.org build
# environment.
image_dir = source/_static/images
symbol_pdfs := $(patsubst %.svg,%.pdf,$(wildcard $(image_dir)/symbols/*.svg))
targets := $(image_dir)/cc-by-4.0.pdf \
$(image_dir)/nissan-leaf-diagnostic-connector-pins.pdf \
$(image_dir)/nissan-leaf-diagnostic-connector.jpeg \
$(image_dir)/nissan-leaf-diagnostic-connector.pdf \
$(symbol_pdfs)
cc_by_4 = "This work is licensed under a Creative Commons Attribution 4.0 \
International License https://creativecommons.org/licenses/by/4.0/"
project_title = "Nissan Leaf OBD manual"
.PHONY: all
all: $(targets)
$(image_dir)/cc-by-4.0.pdf : $(image_dir)/cc-by-4.0.eps
ghostscript -dEPSCrop -sDEVICE=pdfwrite -o $@ $<
$(image_dir)/nissan-leaf-diagnostic-connector-pins.pdf : $(image_dir)/nissan-leaf-diagnostic-connector-pins.svg
rsvg-convert -f pdf -o $@ $<
exiftool \
-overwrite_original \
-Author="Seth Fischer" \
-Producer=$(project_title) \
-Title="Nissan Leaf OBD-II diagnostic connector pin assignment" \
-Subject="Nissan Leaf OBD-II diagnostic connector pin assignment" \
$@
$(image_dir)/nissan-leaf-diagnostic-connector.jpeg : $(image_dir)/nissan-leaf-diagnostic-connector-high-quality.jpeg
convert -strip -interlace Plane -gaussian-blur 0.05 -quality 75% $< $@
exiftool \
-overwrite_original \
-Artist="Seth Fischer" \
-AttributionName="Seth Fischer" \
-AttributionURL="https://seth.fischer.nz/" \
-Comment=$(project_title) \
-DateTimeOriginal="2020:09:27 17:43:49" \
-Description="2013 Nissan Leaf diagnostic connector" \
-License="https://creativecommons.org/licenses/by/4.0/" \
-Rights=$(cc_by_4) \
-UsageTerms=$(cc_by_4) \
$@
$(image_dir)/nissan-leaf-diagnostic-connector.pdf : $(image_dir)/nissan-leaf-diagnostic-connector-high-quality.jpeg
convert $< $@
exiftool \
-overwrite_original \
-Author="Seth Fischer" \
-Producer=$(project_title) \
-Title="2013 Nissan Leaf diagnostic connector" \
-Subject="2013 Nissan Leaf diagnostic connector" \
$@
$(image_dir)/symbols/%.pdf : $(image_dir)/symbols/%.svg
rsvg-convert -f pdf -o $@ $<
.PHONY : clean
clean :
-rm $(targets)