File: Makefile.am

package info (click to toggle)
apertium-swe-nor 0.2.0~r69544-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,952 kB
  • sloc: xml: 1,026; sh: 534; makefile: 188; awk: 160; python: 78
file content (256 lines) | stat: -rw-r--r-- 7,529 bytes parent folder | download
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
###############################################################################
## Makefile for Swedish--Norwegian
###############################################################################

VERSION=0.2.0
LANG1=swe
LANG2=nor
LANG2n=nno
LANG2b=nob

# swe-nor
PREFIX1=$(LANG1)-$(LANG2)
# swe-nob
PREFIX1b=$(LANG1)-$(LANG2b)
# swe-nno
PREFIX1n=$(LANG1)-$(LANG2n)
# nor-swe
PREFIX2=$(LANG2)-$(LANG1)
# nob-swe
PREFIX2b=$(LANG2b)-$(LANG1)
# nno-swe
PREFIX2n=$(LANG2n)-$(LANG1)

BASENAME=apertium-$(PREFIX1)

TARGETS_COMMON = \
      $(PREFIX1).prob \
      $(PREFIX1b).automorf.bin \
      $(PREFIX1n).automorf.bin \
      $(PREFIX1).rlx.bin \
      $(PREFIX1b).autobil.bin \
      $(PREFIX1n).autobil.bin \
      $(PREFIX1b).autolex.bin \
      $(PREFIX1n).autolex.bin \
      $(PREFIX1b).t1x.bin $(PREFIX1b).t2x.bin $(PREFIX1b).t3x.bin \
      $(PREFIX1n).t1x.bin $(PREFIX1n).t2x.bin $(PREFIX1n).t3x.bin \
      $(PREFIX1b).autogen.bin \
      $(PREFIX1n).autogen.bin \
      $(PREFIX2n).prob \
      $(PREFIX2b).prob \
      $(PREFIX2b).automorf.bin \
      $(PREFIX2n).automorf.bin \
      $(PREFIX2b).rlx.bin \
      $(PREFIX2n).rlx.bin \
      $(PREFIX2).autobil.bin \
      $(PREFIX2b).autolex.bin \
      $(PREFIX2n).autolex.bin \
      $(PREFIX2).autogen.bin \
      $(PREFIX2).t1x.bin \
      $(PREFIX2).t2x.bin \
      $(PREFIX2).t3x.bin


# This include defines goals for install-modes, .deps/.d and .mode files:
@ap_include@

###############################################################################
## Monolingual dictionaries
###############################################################################

# Swedish

$(PREFIX1b).automorf.bin: $(AP_SRC1)/$(LANG1).automorf.bin $(PREFIX1b).autobil.bin
	lt-trim $^ $@

$(PREFIX1n).automorf.bin: $(AP_SRC1)/$(LANG1).automorf.bin $(PREFIX1n).autobil.bin
	lt-trim $^ $@

$(PREFIX2).autogen.bin: $(AP_SRC1)/$(LANG1).autogen.bin
	cp $< $@


# Norwegian

$(PREFIX2b).automorf.bin: $(AP_SRC2b)/$(LANG2b).automorf.bin $(PREFIX2).autobil.bin
	lt-trim $(AP_SRC2b)/$(LANG2b).automorf.bin $(PREFIX2).autobil.bin $@

$(PREFIX2n).automorf.bin: $(AP_SRC2n)/$(LANG2n).automorf.bin $(PREFIX2).autobil.bin
	lt-trim $(AP_SRC2n)/$(LANG2n).automorf.bin $(PREFIX2).autobil.bin $@


$(PREFIX1b).autogen.bin: $(AP_SRC2b)/$(LANG2b).autogen.bin
	cp $< $@

$(PREFIX1n).autogen.bin: $(AP_SRC2n)/$(LANG2n).autogen.bin
	cp $< $@



###############################################################################
## Disambiguation models
###############################################################################

$(PREFIX1).prob: $(AP_SRC1)/$(LANG1).prob
	cp $< $@

$(PREFIX2b).prob: $(AP_SRC2b)/$(LANG2b).prob
	cp $< $@

$(PREFIX2n).prob: $(AP_SRC2n)/$(LANG2n).prob
	cp $< $@

###############################################################################
## Disambiguation rules
###############################################################################

$(PREFIX1).rlx.bin: $(AP_SRC1)/apertium-$(LANG1).$(LANG1).rlx
	cg-comp $< $@

$(PREFIX2b).rlx.bin: $(AP_SRC2b)/apertium-$(LANG2b).$(LANG2b).rlx
	cg-comp $< $@

$(PREFIX2n).rlx.bin: $(AP_SRC2n)/apertium-$(LANG2n).$(LANG2n).rlx
	cg-comp $< $@


###############################################################################
## Lexical selection rules
###############################################################################

%.autolex.bin: $(BASENAME).%.lrx
	lrx-comp $< $@

###############################################################################
## Bilingual dictionaries
###############################################################################

$(PREFIX1b).autobil.bin: $(BASENAME).$(PREFIX1).dix
	apertium-validate-dictionary $<
	lt-comp --var-right=nob lr $< $@

$(PREFIX1n).autobil.bin: $(BASENAME).$(PREFIX1).dix
	apertium-validate-dictionary $<
	lt-comp --var-right=nno lr $< $@

$(PREFIX2).autobil.bin: $(BASENAME).$(PREFIX1).dix
	apertium-validate-dictionary $<
	lt-comp rl $< $@


###############################################################################
## Structural transfer rules
###############################################################################

$(PREFIX1b).t1x.bin: $(BASENAME).$(PREFIX1b).t1x
	apertium-validate-transfer $<
	apertium-preprocess-transfer $< $@

$(PREFIX1b).t2x.bin: $(BASENAME).$(PREFIX1b).t2x
	apertium-validate-interchunk $<
	apertium-preprocess-transfer $< $@

$(PREFIX1b).t3x.bin: $(BASENAME).$(PREFIX1b).t3x
	apertium-validate-postchunk $<
	apertium-preprocess-transfer $< $@


$(PREFIX1n).t1x.bin: $(BASENAME).$(PREFIX1n).t1x
	apertium-validate-transfer $<
	apertium-preprocess-transfer $< $@

$(PREFIX1n).t2x.bin: $(BASENAME).$(PREFIX1n).t2x
	apertium-validate-interchunk $<
	apertium-preprocess-transfer $< $@

$(PREFIX1n).t3x.bin: $(BASENAME).$(PREFIX1n).t3x
	apertium-validate-postchunk $<
	apertium-preprocess-transfer $< $@



$(PREFIX2).t1x.bin: $(BASENAME).$(PREFIX2).t1x
	apertium-validate-transfer $<
	apertium-preprocess-transfer $< $@

$(PREFIX2).t2x.bin: $(BASENAME).$(PREFIX2).t2x
	apertium-validate-interchunk $<
	apertium-preprocess-transfer $< $@

$(PREFIX2).t3x.bin: $(BASENAME).$(PREFIX2).t3x
	apertium-validate-postchunk $<
	apertium-preprocess-transfer $< $@


###############################################################################
## Distribution
###############################################################################

EXTRA_DIST=$(BASENAME).$(PREFIX1).dix \
	   $(BASENAME).$(PREFIX1b).lrx \
	   $(BASENAME).$(PREFIX1n).lrx \
	   $(BASENAME).$(PREFIX2b).lrx \
	   $(BASENAME).$(PREFIX2n).lrx \
	   $(BASENAME).$(PREFIX1n).t1x \
	   $(BASENAME).$(PREFIX1b).t1x \
	   $(BASENAME).$(PREFIX1n).t2x \
	   $(BASENAME).$(PREFIX1b).t2x \
	   $(BASENAME).$(PREFIX1n).t3x \
	   $(BASENAME).$(PREFIX1b).t3x \
	   $(BASENAME).$(PREFIX2).t1x \
	   $(BASENAME).$(PREFIX2).t2x \
	   $(BASENAME).$(PREFIX2).t3x \
	   modes.xml

###############################################################################
## Installation
###############################################################################

apertium_swe_nordir=$(prefix)/share/apertium/apertium-$(PREFIX1)/

apertium_swe_nor_DATA=$(TARGETS_COMMON) \
	$(BASENAME).$(PREFIX1n).t1x \
	$(BASENAME).$(PREFIX1b).t1x \
	$(BASENAME).$(PREFIX1n).t2x \
	$(BASENAME).$(PREFIX1b).t2x \
	$(BASENAME).$(PREFIX1n).t3x \
	$(BASENAME).$(PREFIX1b).t3x \
	$(BASENAME).$(PREFIX2).t1x \
	$(BASENAME).$(PREFIX2).t2x \
	$(BASENAME).$(PREFIX2).t3x

# All modes are created by the same goal, listing several will just give problems with make -j2
noinst_DATA=modes/$(PREFIX1b).mode


install-data-local: install-modes

###############################################################################
## Cleanup
###############################################################################

CLEANFILES = $(TARGETS_COMMON)
clean-local:
	-rm -rf .deps modes

###############################################################################
## Test
###############################################################################

test: all
	echo "Såg hon inte orden?" | apertium -d . swe-nno | tee .test-mt
	@echo "Såg ho ikkje orda?" > .test-ref
	@diff .test-ref .test-mt
	echo "Jag har ålar i min svävare" | apertium -d . swe-nob | tee .test-mt
	@echo "Jeg har åler i min luftputebåt" > .test-ref
	@diff .test-ref .test-mt
	@rm .test-ref .test-mt

# Slow but near-complete test of dictionary consistency:
test-gen-%: all
	! dev/testvoc/generation.sh --hfst $*

test-voc: test-gen-swe-nno \
          test-gen-swe-nob \
          test-gen-nno-swe \
          test-gen-nob-swe