-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (51 loc) · 1.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
.DELETE_ON_ERROR:
prefix ?= /usr/local
datadir ?= ${prefix}/share
dictdir ?= ${datadir}/hunspell
bdicdir ?= ${datadir}/qt/qtwebengine_dictionaries
dev: update data.json all
all: tok.dic
update: .gitmodules
git submodule update --init --remote sona
sona/raw/words.json: .gitmodules
git submodule sync sona
data.json: sona/raw/words.json filter_linku.jq
data.json: augment.json augment_languages.json augment_names.json augment_places.json augment_transliterations.json
jq -s '{ words: .[0] } * .[1] * .[2] * .[3] * .[4]' \
./sona/raw/words.json \
./augment.json \
./augment_languages.json \
./augment_names.json \
./augment_places.json \
./augment_transliterations.json \
| jq -cf ./filter_linku.jq > data.json
tok.dic: data.json generate_dic.jq
jq -rf ./generate_dic.jq < data.json > tok.dic
tok.bdic: tok.aff tok.dic
qwebengine_convert_dict tok.aff tok.bdic
dist: clean dev
tag=$$(git rev-list --count --since=yesterday --until=tomorrow HEAD | wc -l); \
[ "$$tag" -gt 1 ] && tag=".$$tag" || tag=; \
tag="$$(date +%Y%m%d)$$tag"; \
git tag -fs "$$tag"; \
git archive \
--format=tar \
--prefix="hunspell-tok-$$tag"/ \
--add-file=./tok.dic \
HEAD \
| gzip -9 > "hunspell-tok-$$tag".tar.gz
clean:
-git submodule deinit -f sona
rm -f tok.bdic tok.dic data.json
install: tok.aff tok.dic
install -d ${DESTDIR}${dictdir}
install -m 0644 ./tok.aff ${DESTDIR}${dictdir}
install -m 0644 ./tok.dic ${DESTDIR}${dictdir}
install-bdic: tok.bdic
install -d ${DESTDIR}${bdicdir}
install -m 0644 ./tok.bdic ${DESTDIR}${bdicdir}
uninstall:
rm -f ${DESTDIR}${dictdir}/tok.aff
rm -f ${DESTDIR}${dictdir}/tok.dic
uninstall-bdic:
rm -f ${DESTDIR}${bdicdir}/tok.bdic