-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (67 loc) · 2.73 KB
/
Makefile
File metadata and controls
88 lines (67 loc) · 2.73 KB
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
PREFIX ?= /usr
DATADIR ?= $(PREFIX)/share
MODEL_VERSION ?= v2026.218.0
build:
cargo build --release -p ibus-akaza -p akaza-conf -p akaza-dict -p akaza-data
# 開発用ビルド: release より高速(opt-level=2, codegen-units=16, lto=false)
dev:
cargo build --profile dev-install -p ibus-akaza -p akaza-conf -p akaza-dict -p akaza-data
all: build
$(MAKE) -C ibus-akaza all
# install はビルド済みバイナリのコピーのみ行う。
# ビルドは事前に `make` で実行しておくこと。
# make && sudo make install
# sudo で cargo build が走って target/ が root 所有になるのを防ぐ。
install: install-resources install-model
install -m 0755 target/release/ibus-akaza $(PREFIX)/bin/
install -m 0755 target/release/akaza-conf $(PREFIX)/bin/
install -m 0755 target/release/akaza-dict $(PREFIX)/bin/
install -m 0755 target/release/akaza-data $(PREFIX)/bin/
$(MAKE) -C ibus-akaza install
# 開発用: ビルド + ibus restart のみ(install 不要)
# 初回は make dev-setup で debug 用 xml をインストールしておくこと
dev-run: dev
ibus restart
# 開発環境の初期セットアップ: debug 用 xml をインストール
# ibus が target/ のバイナリを直接起動するようになる
dev-setup: install-resources
$(MAKE) -C ibus-akaza akaza-debug.xml
$(MAKE) -C ibus-akaza install-debug
install-model:
mkdir -p $(DATADIR)/akaza/model/default/
curl -L https://github.com/akaza-im/akaza/releases/download/$(MODEL_VERSION)/akaza-default-model.tar.gz | \
tar xzv --strip-components=1 -C $(DATADIR)/akaza/model/default/
install-resources:
install -m 0644 -v -D -t $(DATADIR)/akaza/romkan romkan/*
install -m 0644 -v -D -t $(DATADIR)/akaza/keymap keymap/*
# default-model convenience targets
model:
$(MAKE) -C default-model
evaluate:
$(MAKE) -C default-model evaluate
corpus-stats:
$(MAKE) -C corpus-stats
clean:
cargo clean
$(MAKE) -C ibus-akaza clean
# Docker test targets
docker-test-build:
docker compose -f docker-compose.test.yml build
docker-test:
docker compose -f docker-compose.test.yml run --rm test test
docker-test-unit:
docker compose -f docker-compose.test.yml run --rm test test-unit
docker-test-integration:
docker compose -f docker-compose.test.yml run --rm test test-integration
docker-test-e2e:
docker compose -f docker-compose.test.yml run --rm test test-e2e
docker-test-shell:
docker compose -f docker-compose.test.yml run --rm test bash
docs-build:
cd docs && mdbook build
docs-serve:
cd docs && mdbook serve --open
.PHONY: all build dev dev-run dev-setup install install-model install-resources clean \
model evaluate corpus-stats \
docker-test-build docker-test docker-test-unit docker-test-integration docker-test-e2e docker-test-shell \
docs-build docs-serve