-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.am
165 lines (124 loc) · 5.86 KB
/
Makefile.am
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
###############################################################################
## Makefile for Tatar--Russian
###############################################################################
VERSION=0.2.0
LANG1=tat
LANG2=rus
PREFIX1=$(LANG1)-$(LANG2)
PREFIX2=$(LANG2)-$(LANG1)
BASENAME=apertium-$(PREFIX1)
TARGETS_COMMON = $(PREFIX1).autobil.bin \
$(PREFIX1).automorf.bin $(PREFIX1).autogen.bin $(PREFIX1).t1x.bin $(PREFIX1).t2x.bin $(PREFIX1).t3x.bin $(PREFIX1).t4x.bin \
$(PREFIX2).automorf.bin $(PREFIX1).autopgen.bin \
$(PREFIX1).lrx.bin \
$(PREFIX1).rlx.bin
# This include defines goals for install-modes, .deps/.d and .mode files:
@ap_include@
###############################################################################
## Tatar→Russian monolingual transducers
###############################################################################
.deps/$(PREFIX1).autobil.prefixes: $(PREFIX1).autobil.bin .deps/.d
lt-print $(PREFIX1).autobil.bin | sed 's/ /@_SPACE_@/g' > .deps/$(PREFIX1).autobil.att
hfst-txt2fst -e ε < .deps/$(PREFIX1).autobil.att > .deps/$(PREFIX1).autobil.hfst
hfst-project -p upper .deps/$(PREFIX1).autobil.hfst > .deps/$(PREFIX1).autobil.upper
echo " ?* " | hfst-regexp2fst > .deps/any-symbol.hfst
hfst-concatenate -1 .deps/$(PREFIX1).autobil.upper -2 .deps/any-symbol.hfst -o .deps/$(PREFIX1).autobil.prefixes
$(PREFIX1).automorf.bin: $(AP_SRC1)/$(LANG1).automorf.att.gz .deps/$(PREFIX1).autobil.prefixes .deps/.d
$(ZCAT) $< | hfst-txt2fst > .deps/$(LANG1).automorf.hfst
hfst-compose-intersect -1 .deps/$(LANG1).automorf.hfst -2 .deps/$(PREFIX1).autobil.prefixes -o .deps/$(PREFIX1).automorf.trimmed
hfst-fst2txt -i .deps/$(PREFIX1).automorf.trimmed -o .deps/$(PREFIX1).automorf.trimmed.att
lt-comp lr .deps/$(PREFIX1).automorf.trimmed.att $@
$(PREFIX1).autogen.hfst: $(AP_SRC2)/$(LANG2).autogen.hfst
cp $< $@
$(PREFIX1).autogen.bin: $(AP_SRC2)/$(LANG2).autogen.bin
cp $< $@
###############################################################################
## Russian→Tatar monolingual transducers
###############################################################################
$(PREFIX2).automorf.bin: $(AP_SRC2)/$(LANG2).autogen.bin
cp $< $@
$(PREFIX2).autogen.hfst: $(AP_SRC1)/$(LANG1).autogen.hfst
cp $< $@
$(PREFIX2).autogen.bin: $(AP_SRC1)/$(LANG1).autogen.bin
cp $< $@
###############################################################################
## Bilingual dictionaries
###############################################################################
$(PREFIX1).autobil.bin: $(BASENAME).$(PREFIX1).dix
apertium-validate-dictionary $<
lt-comp lr $< $@
#$(PREFIX2).autobil.bin: $(BASENAME).$(PREFIX1).dix
# apertium-validate-dictionary $<
# lt-comp rl $< $@
###############################################################################
## Prob files for tagger
###############################################################################
$(PREFIX1).prob: $(AP_SRC1)/$(LANG1).prob
cp $< $@
###############################################################################
## Disambiguation rules
###############################################################################
$(PREFIX1).rlx.bin: $(AP_SRC1)/apertium-$(LANG1).$(LANG1).rlx
cg-comp $< $@
###############################################################################
## Lexical selection rules
###############################################################################
$(PREFIX1).lrx.bin: $(BASENAME).$(PREFIX1).lrx
lrx-comp $< $@
###############################################################################
## Structural transfer rules
###############################################################################
$(PREFIX1).t1x.bin: $(BASENAME).$(PREFIX1).t1x
apertium-validate-transfer $<
apertium-preprocess-transfer $< $@
$(PREFIX1).t2x.bin: $(BASENAME).$(PREFIX1).t2x
apertium-validate-interchunk $<
apertium-preprocess-transfer $< $@
$(PREFIX1).t3x.bin: $(BASENAME).$(PREFIX1).t3x
apertium-validate-interchunk $<
apertium-preprocess-transfer $< $@
$(PREFIX1).t4x.bin: $(BASENAME).$(PREFIX1).t4x
apertium-validate-postchunk $<
apertium-preprocess-transfer $< $@
###############################################################################
## Postgeneration dictionaries
###############################################################################
$(PREFIX1).autopgen.bin: $(AP_SRC2)/apertium-$(LANG2).post-$(LANG2).dix
apertium-validate-dictionary $<
lt-comp lr $< $@
#$(PREFIX2).autopgen.bin: $(AP_SRC2)/apertium-$(LANG2).post-$(LANG2).dix
# apertium-validate-dictionary $<
# lt-comp lr $< $@
###############################################################################
## Distribution
###############################################################################
EXTRA_DIST= \
$(BASENAME).$(PREFIX1).dix \
$(BASENAME).$(PREFIX1).lrx \
$(BASENAME).$(PREFIX1).t1x \
$(BASENAME).$(PREFIX1).t2x \
$(BASENAME).$(PREFIX1).t3x \
$(BASENAME).$(PREFIX1).t4x \
modes.xml
###############################################################################
## Installation
###############################################################################
apertium_tat_rusdir=$(prefix)/share/apertium/$(BASENAME)/
# Files which should be installed to $(prefix)/share/apertium/$(BASENAME)/:
apertium_tat_rus_DATA=$(TARGETS_COMMON) \
$(BASENAME).$(PREFIX1).t1x \
$(BASENAME).$(PREFIX1).t2x \
$(BASENAME).$(PREFIX1).t3x \
$(BASENAME).$(PREFIX1).t4x \
$(PREFIX1).prob
# All modes are created by the same goal, listing several will just give problems with make -j2
noinst_DATA=modes/$(PREFIX1).mode
install-data-local: install-modes
###############################################################################
## Cleanup
###############################################################################
CLEANFILES = $(TARGETS_COMMON)
clean-local:
-rm -rf .deps modes
test: all
apertium-regtest test