-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.am
211 lines (147 loc) · 5.5 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
###############################################################################
## Makefile for Finnish--German
###############################################################################
SUBDIRS=docs
LANG1=fin
LANG2=deu
PREFIX1=$(LANG1)-$(LANG2)
PREFIX2=$(LANG2)-$(LANG1)
BASENAME=apertium-$(PREFIX1)
TARGETS_COMMON = \
$(PREFIX1).automorf.hfst \
$(PREFIX1).rlx.bin \
$(PREFIX1).autobil.bin \
$(PREFIX1).autolex.bin \
$(PREFIX1).autogen.bin \
$(PREFIX1).rtx.bin \
$(PREFIX2).automorf.bin \
$(PREFIX2).prob \
$(PREFIX2).rlx.bin \
$(PREFIX2).autobil.bin \
$(PREFIX2).autolex.bin \
$(PREFIX2).autogen.hfst \
$(PREFIX2).rtx.bin
# This include defines goals for install-modes, .deps/.d, autobil.prefixes and .mode files:
@ap_include@
###############################################################################
## Monolingual transducers
###############################################################################
# -------------------
# Finnish analysis:
# -------------------
$(PREFIX).automorf.hfst: $(AP_SRC1)/$(LANG1).automorf.hfst
cp -v $< $@
# -------------------
# Finnish generation:
# ---------------------
$(PREFIX2).autogen.hfst: $(AP_SRC1)/$(LANG1).autogen.hfst
cp -v $< $@
$(PREFIX2).autogen.bin: $(AP_SRC1)/$(LANG1).autogen.bin
cp -v $< $@
# -------------------
# German analysis:
# -------------------
.deps/$(LANG2).automorf.bin: $(AP_SRC2)/$(LANG2).automorf.bin .deps/.d
cp $< $@
$(PREFIX2).automorf.bin: .deps/$(LANG2).automorf.bin $(PREFIX2).autobil.bin
lt-trim $^ $@
$(PREFIX2).automorf-untrimmed.bin: .deps/$(LANG2).automorf.bin $(PREFIX2).autobil.bin
cp -v $^ $@
# -------------------
# German generation:
# ---------------------
$(PREFIX1).autogen.bin: $(AP_SRC2)/$(LANG2).autogen.bin
cp $< $@
###############################################################################
## Tagger models
###############################################################################
$(PREFIX1).prob: $(AP_SRC1)/$(LANG1).prob
cp $< $@
$(PREFIX2).prob: $(AP_SRC2)/$(LANG2).prob
cp $< $@
###############################################################################
## Disambiguation rules
###############################################################################
$(PREFIX1).rlx.bin: $(AP_SRC1)/$(LANG1).rlx.bin
cp -v $< $@
$(PREFIX2).rlx.bin: $(AP_SRC2)/apertium-$(LANG2).$(LANG2).rlx
cg-comp $< $@
$(PREFIX2).prep.rlx.bin: apertium-$(LANG2)-$(LANG1).$(LANG2)-$(LANG1)-prep.cg3
cg-comp $< $@
###############################################################################
## 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 $< $@
###############################################################################
## Lexical selection rules
###############################################################################
$(PREFIX1).autolex.bin: $(BASENAME).$(PREFIX1).lrx
lrx-comp $< $@
$(PREFIX2).autolex.bin: $(BASENAME).$(PREFIX2).lrx
lrx-comp $< $@
###
## Separable!
###
$(PREFIX2).autosep.bin: $(BASENAME).$(PREFIX2).lsx
$(LSCXOMP) lr $< $@
###############################################################################
## Structural transfer rules
###############################################################################
$(PREFIX1).rtx.bin: $(BASENAME).$(PREFIX1).rtx
rtx-comp $< $@
$(PREFIX2).rtx.bin: $(BASENAME).$(PREFIX2).rtx
rtx-comp $< $@
###############################################################################
## Postgeneration dictionaries
###############################################################################
$(PREFIX1).autopgen.bin: $(AP_SRC2)/$(LANG2).autopgen.bin
cp $< $@
$(PREFIX2).autopgen.bin: $(AP_SRC1)/$(LANG1).autopgen.bin
cp $< $@
###############################################################################
## Distribution
###############################################################################
EXTRA_DIST= \
$(BASENAME).$(PREFIX1).lrx \
$(BASENAME).$(PREFIX1).dix \
$(BASENAME).$(PREFIX2).lsx \
$(BASENAME).$(PREFIX2).lrx \
$(BASENAME).$(PREFIX1).rtx \
$(BASENAME).$(PREFIX2).rtx \
$(BASENAME).$(PREFIX2).prep.cg3 \
t/config.sh.in \
modes.xml
###############################################################################
## Installation
###############################################################################
apertium_fin_deudir=$(prefix)/share/apertium/$(BASENAME)/
# Files which should be installed to $(prefix)/share/apertium/$(BASENAME)/:
apertium_fin_deu_DATA= \
$(TARGETS_COMMON)
# 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
uninstall-local: uninstall-modes
###############################################################################
## Cleanup
###############################################################################
CLEANFILES = $(TARGETS_COMMON)
clean-local:
-rm -rf .deps modes
###############################################################################
## Test
###############################################################################
test: all
apertium-regtest test
# Slow but near-complete test of dictionary consistency:
test-gen-fin-deu: all
! dev/testvoc/generation.sh --hfst fin-deu
test-gen-deu-fin: all
! dev/testvoc/generation.sh deu-fin
test-voc: test-gen-fin-deu \
test-gen-deu-fin