summaryrefslogtreecommitdiffstats
path: root/37c3/Replicant_struggle/unfinished-latex-version/Makefile
blob: 557d109f8da5384d8cf371285e0bf542c8bcec9f (plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
TEXFLAGS ?= -halt-on-error -output-format pdf -output-directory output
TITLE = Struggle_for_independence

TOPDIR = ../../..

.PHONY: all clean medias archive

###############
# Phony rules #
###############
all: output/$(TITLE).pdf

archive:
	git archive --format=tar --prefix=LibrePlanet2022/ HEAD -o LibrePlanet2022.tar

clean:
	rm -rf output

################
# Main targets #
################
output:
	mkdir output

output/$(TITLE).pdf: \
	Struggle_for_independence.tex \
	output \
	output/4-freedoms.jpg \
	output/android.jpg \
	output/android_logo.jpg \
	output/anti_drm_protest.jpg \
	output/anti_smartphones.jpg \
	output/electronic_waste_small.jpg \
	output/framework.jpg \
	output/freedo.jpg \
	output/googlag_small.jpg \
	output/i9300_left.jpg \
	output/linux.jpg \
	output/motorola_a780_small.jpg \
	output/n900.jpg \
	output/phist.jpg \
	output/raised_fist_small.jpg \
	output/replicant_logo.jpg \
	output/smart_phones_shop_small.jpg \
	output/tablets.jpg \
	output/the_leader_of_the_luddites_small.jpg \
	output/we_can_do_it_small.jpg \
	output/wifi.jpg \
	output/worker.jpg
	pdflatex $(TEXFLAGS) '\providecommand\locale{en}\input{$(TITLE).tex}'
	pdflatex $(TEXFLAGS) '\providecommand\locale{en}\input{$(TITLE).tex}'
	du -hs $@

##############################
# Automatic depdencies rules #
##############################
output/%.jpg: dot/%.dot
	mkdir -p output
	dot -T jpg $< > $@

output/%.jpg: $(TOPDIR)/common/images/%.jpg output
	convert $< $@

output/%.jpg: $(TOPDIR)/common/images/%.png output
	convert $< $@

output/%.jpg: $(TOPDIR)/common/images/%.svg output
	convert $< $@

# Space saved:
# - we_can_do_it.jpg: from 61M to 456K
# - raised_fist.jpg: from 7.9M to 104K
# - the_leader_of_the_luddites.jpg: from 6.1M to 291K
# - smart_phones_shop.jpg: from 3.0M to 243K
# - electronic_waste.jpg: from 2.8M to 168K
# - googlag.jpg: from 2.4M to 101K
# - motorola_a780.jpg: from 1.8M to 64k
output/%_small.jpg: $(TOPDIR)/common/images/%.jpg
	convert -resize 25% -quality 80 $< $@

#################################
# Images with specific settings #
#################################
# -resize and -quality makes the image go from 1.1M to 48k
output/anti_drm_protest.jpg: $(TOPDIR)/common/images/anti_drm_protest.jpg output
	convert $< -crop 50%x0%+1440+0 -resize 25% -quality 80 $@

output/i9300_hardware.jpg: $(TOPDIR)/common/images/i9300_hardware.svg output
	convert $< $@

output/i9300_left.jpg: output/i9300_hardware.jpg output
	convert $< -crop 50%x0%+0+0 $@

# -resize and -quality makes the image go from 8.5M to 124k
output/n900.jpg: $(TOPDIR)/common/images/N900_xterm.JPG $(TOPDIR)/common/images/Nokia_N900-6.jpg
	mkdir -p output
	convert -append -gravity center -resize 25% -quality 80 $? $@

output/replicant_logo.jpg: $(TOPDIR)/external_resources/vendor_replicant_artwork/replicant_logo_white.png output
	convert $< $@

output/tablets.jpg: \
	$(TOPDIR)/external_resources/replicant_website/images/supported-devices/p3100.png \
	$(TOPDIR)/external_resources/replicant_website/images/supported-devices/p5100.png
	mkdir -p output
	convert -append $? $@

output/wifi.jpg: \
	$(TOPDIR)/common/images/tehnoetic-n150-mini-wifi-adapter-back-500x500.png \
	$(TOPDIR)/common/images/tet-otg-side-500x500.jpg \
	$(TOPDIR)/common/images/Wifi.png
	mkdir -p output
	convert -append -gravity center $? $@