-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
33 lines (24 loc) · 780 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
.PHONY: update_mozc build install clean
MECAB_LIBEXEC_DIR = $(shell mecab-config --libexecdir)
MECAB_DIC_DIR = $(shell mecab-config --dicdir)
MATRIX_DEF = matrix.def
LEX_CSV = lex.csv
all: install
update_mozc:
git submodule foreach git fetch origin
git submodule foreach git reset --hard origin/master
$(MATRIX_DEF):
./script/generate_matrix_def.py
$(LEX_CSV):
cat mozc/src/data/dictionary_oss/dictionary*.txt | tr "\\t" "," | grep -v "^," > mozcpy/dic/lex.csv
build: update_mozc $(MATRIX_DEF) $(LEX_CSV)
$(MECAB_LIBEXEC_DIR)/mecab-dict-index -d mozcpy/dic -o mozcpy/dic
$(RM) mozcpy/dic/lex.csv
$(RM) mozcpy/dic/matrix.def
install: build
pip install .
clean:
$(RM) mozcpy/dic/*.bin
$(RM) mozcpy/dic/*.dic
$(RM) mozcpy/dic/lex.csv
$(RM) mozcpy/dic/matrix.def