-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
335 lines (289 loc) · 12.7 KB
/
Makefile
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# organized generally from most to least composite
.SECONDARY:
.PRECIOUS:
.PRECIOUSSSSS:
all: \
build/tiles \
build/data.json \
build/map-latin-1024.png \
build/map-tengwar-1024.png
# build/regions XXX
dev: \
build/geography-4096.png \
build/map-latin-4096.png \
build/map-tengwar-4096.png \
build/labels
# the geography resize is used in labels-tengwar (and probably others soon)
# as a reference
# deployment cpio archive
build/deploy.cpio: build/www.cpio build/build.cpio
cat $< > $@
build/www.cpio: www
(cd www; find . | cpio -o) > $@
build/build.cpio: build/tiles build/labels build/regions build/data.json build/map-1024.png
(cd build; find tiles labels regions data.json map-1024.png | cpio -o) > $@
www:
touch $@
# 3.17 HOURS and
# 11.5 HOURS roughly
build/tiles: build/tiles/g build/tiles/t build/tiles/l
# generate resized and thumbnail labels from manually normalized labels
# 20 MINUTES
build/labels: labels.py locations.csv
python labels.py
# generate regional thumbnails
build/regions: \
regions_thumbnails.py \
regions.svg \
build/map-tengwar-16384.png
python regions_thumbnails.py build/map-tengwar-16384.png
build/data.json: regions.svg
python data.py
# LOCAL
# a cache of the regional information in CSV format
regions.csv: regions.svg
python regions.py
# prepare a cross reference of regional data and label data
# for local debugging
index.html: regions.svg labels.csv
python index.py
# ARCHIVES
# download archived images to set up
archive:
mkdir -p archive
archive/components.zip: archive
(cd archive; curl -O http://3rin.gs/components.zip)
archive/components: archive/components.zip
(cd archive; unzip components.zip)
archive/sources.zip: archive
(cd archive; curl -O http://3rin.gs/sources.zip)
archive/sources: archive/sources.zip
(cd archive; unzip sources.zip)
# prepare archived images for upload
archives: \
build/components.zip \
build/sources.zip
build/components.zip:
cat components.manifest | (cd archive; find `cat` | xargs zip -) > $*
build/sources.zip:
(cd archive; find sources | xargs zip -) > $*
# REGIONS
build/map-tengwar-16384.png:
exit -1 # cannot generate 16384 yet. need to do quadtree reduction
build/map-tengwar-%.png: build/geography-%.png build/labels-tengwar-%.png
python over.py build/geography-$*.png build/labels-tengwar-$*.png build/map-tengwar-$*.png
build/map-latin-%.png: build/geography-%.png build/labels-latin-%.png
python over.py build/geography-$*.png build/labels-latin-$*.png build/map-latin-$*.png
build/labels-tengwar-1024.png: build/labels-tengwar-export-1024.png
python darken.py $< $@ .5
build/labels-tengwar-export-1024.png: labels-tengwar.svg
inkscape -z -e $@ -w 1024 -h 1024 $<
build/labels-latin-1024.png: build/labels-latin-export-1024.png
python darken.py $< $@ .5
build/labels-latin-export-1024.png: labels-latin.svg
inkscape -z -e $@ -w 1024 -h 1024 $<
build/labels-tengwar-4096.png: build/labels-tengwar-export-4096.png
python darken.py $< $@ .5
build/labels-tengwar-export-4096.png: labels-tengwar.svg
inkscape -z -e $@ -w 4096 -h 4096 $<
build/labels-latin-4096.png: build/labels-latin-export-4096.png
python darken.py $< $@ .5
build/labels-latin-export-4096.png: labels-latin.svg
inkscape -z -e $@ -w 4096 -h 4096 $<
build/labels-tengwar-16384.png: build/labels-tengwar-export-16384.png
python darken.py $< $@ .5
build/labels-tengwar-export-16384.png: labels-tengwar.svg
inkscape -z -e $@ -w 16384 -h 16384 $<
build/labels-latin-16384.png: build/labels-latin-export-16384.png
python darken.py $< $@ .5
build/labels-latin-export-16384.png: labels-latin.svg
inkscape -z -e $@ -w 16384 -h 16384 $<
build/geography-%.png: build/geography-combined-%.png
python darken.py $< $@ .5
build/geography-combined-%.png: build/coast-translucent-%.png build/geography-translucent-%.png
python over.py build/coast-translucent-$*.png build/geography-translucent-$*.png build/geography-combined-$*.png
build/geography-translucent-%.png: build/geography-export-%.png
(echo $<; echo $@) | bash c2a.bash
build/geography-export-%.png: geography.svg
inkscape -z -e $@ -w $* -h $* $<
build/coast-translucent-%.png: build/coast-export-%.png
(echo $<; echo $@) | bash c2a.bash
build/coast-export-%.png: coast.svg
inkscape -z -e $@ -w $* -h $* $<
# LABELS
# SINDARIN TENGWAR
# tiles
# 1.81 HOURS
# 11.5 HOURS transitively
build/tiles/t: build/labels-tengwar-export-32768
mkdir -p build/tiles
python tiles_labels.py $< $@
touch build/tiles/t
# the master label level sources
# 4.72 HOURS
build/labels-tengwar-export-32768: \
build/labels-tengwar-export-32768/1 \
build/labels-tengwar-export-32768/2 \
build/labels-tengwar-export-32768/3 \
build/labels-tengwar-export-32768/4 \
build/labels-tengwar-export-32768/5 \
build/labels-tengwar-export-32768/6 \
build/labels-tengwar-export-32768/7 \
build/labels-tengwar-export-32768/8
# quadtrees based on the master quads
build/labels-tengwar-export-32768/%: \
build/labels \
build/labels-tengwar-export-16384/%-0.png \
build/labels-tengwar-export-16384/%-1.png \
build/labels-tengwar-export-16384/%-2.png \
build/labels-tengwar-export-16384/%-3.png
mkdir -p build/labels-tengwar-export-32768
inkscape -z -e build/labels-tengwar-export-32768/$*-.png -w 256 -h 256 -i layer$* -j build/labels-tengwar-opaque.svg
python tiles.py build/labels-tengwar-export-16384/$*-0.png build/labels-tengwar-export-32768/$*-0
python tiles.py build/labels-tengwar-export-16384/$*-1.png build/labels-tengwar-export-32768/$*-1
python tiles.py build/labels-tengwar-export-16384/$*-2.png build/labels-tengwar-export-32768/$*-2
python tiles.py build/labels-tengwar-export-16384/$*-3.png build/labels-tengwar-export-32768/$*-3
# export master quads
build/labels-tengwar-export-16384/%-0.png: build/labels build/labels-tengwar-opaque.svg build/labels-tengwar-export-16384
inkscape -z -e $@ -a 0000:3600:3600:7200 -w 16384 -h 16384 -i layer$* -j build/labels-tengwar-opaque.svg
build/labels-tengwar-export-16384/%-1.png: build/labels build/labels-tengwar-opaque.svg build/labels-tengwar-export-16384
inkscape -z -e $@ -a 3600:3600:7200:7200 -w 16384 -h 16384 -i layer$* -j build/labels-tengwar-opaque.svg
build/labels-tengwar-export-16384/%-2.png: build/labels build/labels-tengwar-opaque.svg build/labels-tengwar-export-16384
inkscape -z -e $@ -a 0000:0000:3600:3600 -w 16384 -h 16384 -i layer$* -j build/labels-tengwar-opaque.svg
build/labels-tengwar-export-16384/%-3.png: build/labels build/labels-tengwar-opaque.svg build/labels-tengwar-export-16384
inkscape -z -e $@ -a 3600:0000:7200:3600 -w 16384 -h 16384 -i layer$* -j build/labels-tengwar-opaque.svg
build/labels-tengwar-export-16384:
mkdir -p $@
# a version of labels-tengwar.svg wherein all of the labels are opaque
build/labels-tengwar-opaque.svg: labels-tengwar.svg opaque_svg.py
python opaque_svg.py labels-tengwar.svg $@
# ENGLISH LATIN LABELS
build/tiles/l: build/labels-latin-export-32768
mkdir -p build/tiles
python tiles_labels.py $< $@
touch build/tiles/l
# the master label level sources
# 4.72 HOURS
build/labels-latin-export-32768: \
build/labels-latin-export-32768/1 \
build/labels-latin-export-32768/2 \
build/labels-latin-export-32768/3 \
build/labels-latin-export-32768/4 \
build/labels-latin-export-32768/5 \
build/labels-latin-export-32768/6 \
build/labels-latin-export-32768/7 \
build/labels-latin-export-32768/8
# quadtrees based on the master quads
build/labels-latin-export-32768/%: \
build/labels \
build/labels-latin-export-16384/%-0.png \
build/labels-latin-export-16384/%-1.png \
build/labels-latin-export-16384/%-2.png \
build/labels-latin-export-16384/%-3.png
mkdir -p build/labels-latin-export-32768
inkscape -z -e build/labels-latin-export-32768/$*-.png -w 256 -h 256 -i layer$* -j build/labels-latin-opaque.svg
python tiles.py build/labels-latin-export-16384/$*-0.png build/labels-latin-export-32768/$*-0
python tiles.py build/labels-latin-export-16384/$*-1.png build/labels-latin-export-32768/$*-1
python tiles.py build/labels-latin-export-16384/$*-2.png build/labels-latin-export-32768/$*-2
python tiles.py build/labels-latin-export-16384/$*-3.png build/labels-latin-export-32768/$*-3
# export master quads
build/labels-latin-export-16384/%-0.png: build/labels build/labels-latin-opaque.svg build/labels-latin-export-16384
inkscape -z -e $@ -a 0000:3600:3600:7200 -w 16384 -h 16384 -i layer$* -j build/labels-latin-opaque.svg
build/labels-latin-export-16384/%-1.png: build/labels build/labels-latin-opaque.svg build/labels-latin-export-16384
inkscape -z -e $@ -a 3600:3600:7200:7200 -w 16384 -h 16384 -i layer$* -j build/labels-latin-opaque.svg
build/labels-latin-export-16384/%-2.png: build/labels build/labels-latin-opaque.svg build/labels-latin-export-16384
inkscape -z -e $@ -a 0000:0000:3600:3600 -w 16384 -h 16384 -i layer$* -j build/labels-latin-opaque.svg
build/labels-latin-export-16384/%-3.png: build/labels build/labels-latin-opaque.svg build/labels-latin-export-16384
inkscape -z -e $@ -a 3600:0000:7200:3600 -w 16384 -h 16384 -i layer$* -j build/labels-latin-opaque.svg
build/labels-latin-export-16384:
mkdir -p $@
# a version of labels-latin.svg wherein all of the labels are opaque
build/labels-latin-opaque.svg: labels-latin.svg opaque_svg.py
python opaque_svg.py labels-latin.svg $@
# GEOGRAPHY
# 40 MINUTES
build/tiles/g: build/geography-combined-32768
mkdir -p build/tiles
python tiles_darken.py $</t $@ .5
touch build/tiles/g
build/geography-combined-32768: \
build/geography-translucent-32768 \
build/coast-translucent-32768
mkdir -p $@
python tiles_over.py \
build/coast-translucent-32768/t \
build/geography-translucent-32768/t \
$@/t
build/geography-translucent-32768: build/geography-export-32768
mkdir -p $@
bash tiles_c2a.bash build/geography-export-32768/t build/geography-translucent-32768/t
build/geography-export-32768: \
build/geography-export-16384/q0.png \
build/geography-export-16384/q1.png \
build/geography-export-16384/q2.png \
build/geography-export-16384/q3.png
mkdir -p build/geography-export-32768
inkscape -z -e build/geography-export-32768/t.png -w 256 -h 256 geography.svg
python tiles.py build/geography-export-16384/q0.png $@/t0
python tiles.py build/geography-export-16384/q1.png $@/t1
python tiles.py build/geography-export-16384/q2.png $@/t2
python tiles.py build/geography-export-16384/q3.png $@/t3
build/geography-export-%/q.png: geography.svg
inkscape -z -e $@ -w $* -h $* geography.svg
build/geography-export-16384/q0.png: geography.svg
mkdir -p build/geography-export-16384
inkscape -z -e $@ -a 0000:3600:3600:7200 -w 16384 -h 16384 geography.svg
build/geography-export-16384/q1.png: geography.svg
mkdir -p build/geography-export-16384
inkscape -z -e $@ -a 3600:3600:7200:7200 -w 16384 -h 16384 geography.svg
build/geography-export-16384/q2.png: geography.svg
mkdir -p build/geography-export-16384
inkscape -z -e $@ -a 0000:0000:3600:3600 -w 16384 -h 16384 geography.svg
build/geography-export-16384/q3.png: geography.svg
mkdir -p build/geography-export-16384
inkscape -z -e $@ -a 3600:0000:7200:3600 -w 16384 -h 16384 geography.svg
# COAST
# 1 HOUR
build/coast-translucent-32768: build/coast-export-32768
mkdir -p $@
bash tiles_c2a.bash build/coast-export-32768/t build/coast-translucent-32768/t
build/coast-export-32768: \
build/coast-export-16384/q0.png \
build/coast-export-16384/q1.png \
build/coast-export-16384/q2.png \
build/coast-export-16384/q3.png
mkdir -p build/coast-export-32768
inkscape -z -e build/coast-export-32768/t.png -w 256 -h 256 coast.svg
python tiles.py build/coast-export-16384/q0.png build/coast-export-32768/t0
python tiles.py build/coast-export-16384/q1.png build/coast-export-32768/t1
python tiles.py build/coast-export-16384/q2.png build/coast-export-32768/t2
python tiles.py build/coast-export-16384/q3.png build/coast-export-32768/t3
build/coast-export-%/q.png: coast.svg
mkdir -p build/coast-export-$*
inkscape -z -e $@ -w $* -h $* coast.svg
build/coast-export-16384/q0.png: coast.svg
mkdir -p build/coast-export-16384
inkscape -z -e $@ -a 0000:3600:3600:7200 -w 16384 -h 16384 coast.svg
build/coast-export-16384/q1.png: coast.svg
mkdir -p build/coast-export-16384
inkscape -z -e $@ -a 3600:3600:7200:7200 -w 16384 -h 16384 coast.svg
build/coast-export-16384/q2.png: coast.svg
mkdir -p build/coast-export-16384
inkscape -z -e $@ -a 0000:0000:3600:3600 -w 16384 -h 16384 coast.svg
build/coast-export-16384/q3.png: coast.svg
mkdir -p build/coast-export-16384
inkscape -z -e $@ -a 3600:0000:7200:3600 -w 16384 -h 16384 coast.svg
# Article Data
build/encarda: \
build/encarda/placland.html \
build/encarda/placciti.html \
build/encarda/placfiel.html \
build/encarda/placfore.html \
build/encarda/plachill.html \
build/encarda/placisla.html \
build/encarda/placrive.html \
build/encarda/placseas.html \
build/encarda/placothe.html
build/encarda/%.html:
mkdir -p build/encarda
curl http://www.glyphweb.com/ARDA/$*.html > $@