forked from jmdict-kindle/jmdict-kindle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (23 loc) · 841 Bytes
/
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
PYTHON3 ?= python3
default: jmdict.mobi
JMdict_e.gz:
wget -nv -N http://ftp.monash.edu.au/pub/nihongo/$@
KINDLEGEN_PKG ?= kindlegen_linux_2.6_i386_v2_9.tar.gz
$(KINDLEGEN_PKG):
wget -nv -N https://kindlegen.s3.amazonaws.com/$@
kindlegen: $(KINDLEGEN_PKG)
tar -xzf $(KINDLEGEN_PKG) kindlegen
touch $@
jmdict.opf: jmdict.py dictionary.py inflections.py kana.py JMdict_e.gz
$(PYTHON3) jmdict.py
cover.jpg: cover.py
$(PYTHON3) cover.py
# XXX: The Kindle Publishing Guidelines recommend -c2 (huffdic compression),
# but it is excruciatingly slow.
COMPRESSION ?= 1
# See also https://wiki.mobileread.com/wiki/KindleGen
jmdict.mobi: jmdict.opf cover.jpg style.css frontmatter.html kindlegen
./kindlegen $< -c$(COMPRESSION) -verbose -dont_append_source -o $@
clean:
rm -f *.mobi *.opf entry-*.html cover.jpg
.PHONE: default clean