Bump version to 4.3-4
[LibreOffice.git] / extras / CustomTarget_autocorr.mk
blob4c0cf3c96d2dbd6254a955407f58641db8248787
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval $(call gb_CustomTarget_CustomTarget,extras/source/autotext))
12 extras_AUTOCORR_LANGS := \
13 af-ZA:af-ZA \
14 bg:bg-BG \
15 ca:ca-ES \
16 cs:cs-CZ \
17 da:da-DK \
18 de:de \
19 en-AU:en-AU \
20 en-GB:en-GB \
21 en-US:en-US \
22 en-ZA:en-ZA \
23 es:es \
24 fa:fa-IR \
25 fi:fi-FI \
26 fr:fr \
27 ga-IE:ga-IE \
28 hr:hr-HR \
29 hu:hu-HU \
30 is:is-IS \
31 it:it \
32 ja:ja-JP \
33 ko:ko-KR \
34 lb-LU:lb-LU \
35 lt:lt-LT \
36 mn:mn-MN \
37 nl:nl-NL \
38 nl-BE:nl-BE \
39 pl:pl-PL \
40 pt:pt-PT \
41 pt-BR:pt-BR \
42 ro:ro-RO \
43 ru:ru-RU \
44 sk:sk-SK \
45 sl:sl-SI \
46 sr-CS:sr-CS \
47 sr-Latn-CS:sr-Latn-CS \
48 sr-Latn-ME:sr-Latn-ME \
49 sr-Latn-RS:sr-Latn-RS \
50 sr-ME:sr-ME \
51 sr-RS:sr-RS \
52 sv:sv-SE \
53 tr:tr-TR \
54 vi:vi-VN \
55 zh-CN:zh-CN \
56 zh-TW:zh-TW \
58 extras_AUTOCORR_XMLFILES := \
59 af-ZA/acor/DocumentList.xml \
60 af-ZA/acor/META-INF/manifest.xml \
61 af-ZA/acor/SentenceExceptList.xml \
62 af-ZA/acor/WordExceptList.xml \
63 bg/acor/DocumentList.xml \
64 bg/acor/META-INF/manifest.xml \
65 bg/acor/SentenceExceptList.xml \
66 bg/acor/WordExceptList.xml \
67 ca/acor/BlockList.xml \
68 ca/acor/DocumentList.xml \
69 ca/acor/META-INF/manifest.xml \
70 ca/acor/SentenceExceptList.xml \
71 ca/acor/WordExceptList.xml \
72 cs/acor/BlockList.xml \
73 cs/acor/DocumentList.xml \
74 cs/acor/META-INF/manifest.xml \
75 da/acor/BlockList.xml \
76 da/acor/DocumentList.xml \
77 da/acor/META-INF/manifest.xml \
78 da/acor/SentenceExceptList.xml \
79 da/acor/WordExceptList.xml \
80 de/acor/BlockList.xml \
81 de/acor/DocumentList.xml \
82 de/acor/META-INF/manifest.xml \
83 de/acor/SentenceExceptList.xml \
84 de/acor/WordExceptList.xml \
85 en-AU/acor/BlockList.xml \
86 en-AU/acor/DocumentList.xml \
87 en-AU/acor/META-INF/manifest.xml \
88 en-AU/acor/SentenceExceptList.xml \
89 en-AU/acor/WordExceptList.xml \
90 en-GB/acor/BlockList.xml \
91 en-GB/acor/DocumentList.xml \
92 en-GB/acor/META-INF/manifest.xml \
93 en-GB/acor/SentenceExceptList.xml \
94 en-GB/acor/WordExceptList.xml \
95 en-US/acor/BlockList.xml \
96 en-US/acor/DocumentList.xml \
97 en-US/acor/META-INF/manifest.xml \
98 en-US/acor/SentenceExceptList.xml \
99 en-US/acor/WordExceptList.xml \
100 en-ZA/acor/DocumentList.xml \
101 en-ZA/acor/META-INF/manifest.xml \
102 en-ZA/acor/SentenceExceptList.xml \
103 en-ZA/acor/WordExceptList.xml \
104 es/acor/BlockList.xml \
105 es/acor/DocumentList.xml \
106 es/acor/META-INF/manifest.xml \
107 es/acor/SentenceExceptList.xml \
108 es/acor/WordExceptList.xml \
109 fa/acor/DocumentList.xml \
110 fa/acor/META-INF/manifest.xml \
111 fi/acor/BlockList.xml \
112 fi/acor/DocumentList.xml \
113 fi/acor/META-INF/manifest.xml \
114 fi/acor/SentenceExceptList.xml \
115 fi/acor/WordExceptList.xml \
116 fr/acor/DocumentList.xml \
117 fr/acor/META-INF/manifest.xml \
118 fr/acor/SentenceExceptList.xml \
119 fr/acor/WordExceptList.xml \
120 ga-IE/acor/DocumentList.xml \
121 ga-IE/acor/META-INF/manifest.xml \
122 ga-IE/acor/SentenceExceptList.xml \
123 ga-IE/acor/WordExceptList.xml \
124 hr/acor/DocumentList.xml \
125 hr/acor/META-INF/manifest.xml \
126 hr/acor/SentenceExceptList.xml \
127 hr/acor/WordExceptList.xml \
128 hu/acor/BlockList.xml \
129 hu/acor/DocumentList.xml \
130 hu/acor/META-INF/manifest.xml \
131 hu/acor/SentenceExceptList.xml \
132 hu/acor/WordExceptList.xml \
133 is/acor/META-INF/manifest.xml \
134 is/acor/SentenceExceptList.xml \
135 it/acor/BlockList.xml \
136 it/acor/DocumentList.xml \
137 it/acor/META-INF/manifest.xml \
138 it/acor/SentenceExceptList.xml \
139 it/acor/WordExceptList.xml \
140 ja/acor/DocumentList.xml \
141 ja/acor/META-INF/manifest.xml \
142 ja/acor/SentenceExceptList.xml \
143 ko/acor/DocumentList.xml \
144 ko/acor/META-INF/manifest.xml \
145 ko/acor/SentenceExceptList.xml \
146 lb-LU/acor/DocumentList.xml \
147 lb-LU/acor/META-INF/manifest.xml \
148 lt/acor/BlockList.xml \
149 lt/acor/DocumentList.xml \
150 lt/acor/META-INF/manifest.xml \
151 lt/acor/SentenceExceptList.xml \
152 lt/acor/WordExceptList.xml \
153 mn/acor/DocumentList.xml \
154 mn/acor/META-INF/manifest.xml \
155 mn/acor/SentenceExceptList.xml \
156 mn/acor/WordExceptList.xml \
157 nl-BE/acor/BlockList.xml \
158 nl-BE/acor/DocumentList.xml \
159 nl-BE/acor/META-INF/manifest.xml \
160 nl-BE/acor/SentenceExceptList.xml \
161 nl-BE/acor/WordExceptList.xml \
162 nl/acor/BlockList.xml \
163 nl/acor/DocumentList.xml \
164 nl/acor/META-INF/manifest.xml \
165 nl/acor/SentenceExceptList.xml \
166 nl/acor/WordExceptList.xml \
167 pl/acor/DocumentList.xml \
168 pl/acor/META-INF/manifest.xml \
169 pl/acor/SentenceExceptList.xml \
170 pl/acor/WordExceptList.xml \
171 pt-BR/acor/BlockList.xml \
172 pt-BR/acor/DocumentList.xml \
173 pt-BR/acor/META-INF/manifest.xml \
174 pt-BR/acor/SentenceExceptList.xml \
175 pt-BR/acor/WordExceptList.xml \
176 pt/acor/BlockList.xml \
177 pt/acor/DocumentList.xml \
178 pt/acor/META-INF/manifest.xml \
179 pt/acor/SentenceExceptList.xml \
180 pt/acor/WordExceptList.xml \
181 ro/acor/BlockList.xml \
182 ro/acor/DocumentList.xml \
183 ro/acor/META-INF/manifest.xml \
184 ro/acor/SentenceExceptList.xml \
185 ro/acor/WordExceptList.xml \
186 ru/acor/BlockList.xml \
187 ru/acor/DocumentList.xml \
188 ru/acor/META-INF/manifest.xml \
189 ru/acor/SentenceExceptList.xml \
190 ru/acor/WordExceptList.xml \
191 sk/acor/DocumentList.xml \
192 sk/acor/META-INF/manifest.xml \
193 sk/acor/SentenceExceptList.xml \
194 sk/acor/WordExceptList.xml \
195 sl/acor/DocumentList.xml \
196 sl/acor/META-INF/manifest.xml \
197 sl/acor/SentenceExceptList.xml \
198 sl/acor/WordExceptList.xml \
199 sr-CS/acor/DocumentList.xml \
200 sr-CS/acor/META-INF/manifest.xml \
201 sr-CS/acor/SentenceExceptList.xml \
202 sr-CS/acor/WordExceptList.xml \
203 sr-Latn-CS/acor/DocumentList.xml \
204 sr-Latn-CS/acor/META-INF/manifest.xml \
205 sr-Latn-CS/acor/SentenceExceptList.xml \
206 sr-Latn-CS/acor/WordExceptList.xml \
207 sr-Latn-ME/acor/DocumentList.xml \
208 sr-Latn-ME/acor/META-INF/manifest.xml \
209 sr-Latn-ME/acor/SentenceExceptList.xml \
210 sr-Latn-ME/acor/WordExceptList.xml \
211 sr-Latn-RS/acor/DocumentList.xml \
212 sr-Latn-RS/acor/META-INF/manifest.xml \
213 sr-Latn-RS/acor/SentenceExceptList.xml \
214 sr-Latn-RS/acor/WordExceptList.xml \
215 sr-ME/acor/DocumentList.xml \
216 sr-ME/acor/META-INF/manifest.xml \
217 sr-ME/acor/SentenceExceptList.xml \
218 sr-ME/acor/WordExceptList.xml \
219 sr-RS/acor/DocumentList.xml \
220 sr-RS/acor/META-INF/manifest.xml \
221 sr-RS/acor/SentenceExceptList.xml \
222 sr-RS/acor/WordExceptList.xml \
223 sv/acor/BlockList.xml \
224 sv/acor/DocumentList.xml \
225 sv/acor/META-INF/manifest.xml \
226 sv/acor/SentenceExceptList.xml \
227 sv/acor/WordExceptList.xml \
228 tr/acor/DocumentList.xml \
229 tr/acor/META-INF/manifest.xml \
230 tr/acor/SentenceExceptList.xml \
231 tr/acor/WordExceptList.xml \
232 vi/acor/DocumentList.xml \
233 vi/acor/META-INF/manifest.xml \
234 vi/acor/WordExceptList.xml \
235 zh-CN/acor/DocumentList.xml \
236 zh-CN/acor/META-INF/manifest.xml \
237 zh-CN/acor/SentenceExceptList.xml \
238 zh-TW/acor/DocumentList.xml \
239 zh-TW/acor/META-INF/manifest.xml \
240 zh-TW/acor/SentenceExceptList.xml \
243 extras_AUTOCORR_MIMETYPEFILES := \
244 af-ZA/acor/mimetype \
245 bg/acor/mimetype \
246 ca/acor/mimetype \
247 cs/acor/mimetype \
248 da/acor/mimetype \
249 de/acor/mimetype \
250 en-AU/acor/mimetype \
251 en-GB/acor/mimetype \
252 en-US/acor/mimetype \
253 en-ZA/acor/mimetype \
254 es/acor/mimetype \
255 fa/acor/mimetype \
256 fi/acor/mimetype \
257 fr/acor/mimetype \
258 ga-IE/acor/mimetype \
259 hu/acor/mimetype \
260 is/acor/mimetype \
261 it/acor/mimetype \
262 lb-LU/acor/mimetype \
263 lt/acor/mimetype \
264 mn/acor/mimetype \
265 nl-BE/acor/mimetype \
266 nl/acor/mimetype \
267 pl/acor/mimetype \
268 pt-BR/acor/mimetype \
269 pt/acor/mimetype \
270 ro/acor/mimetype \
271 ru/acor/mimetype \
272 sk/acor/mimetype \
273 sl/acor/mimetype \
274 sr-CS/acor/mimetype \
275 sr-Latn-CS/acor/mimetype \
276 sr-Latn-ME/acor/mimetype \
277 sr-Latn-RS/acor/mimetype \
278 sr-ME/acor/mimetype \
279 sr-RS/acor/mimetype \
280 sv/acor/mimetype \
281 tr/acor/mimetype \
282 vi/acor/mimetype \
285 ifneq ($(sort $(foreach file,$(extras_AUTOCORR_XMLFILES),$(firstword $(subst /, ,$(file))))),$(sort $(foreach lang,$(extras_AUTOCORR_LANGS),$(firstword $(subst :, ,$(lang))))))
286 $(call gb_Output_error,defined autocorrection languages do not match existing directories)
287 endif
289 $(call gb_CustomTarget_get_target,extras/source/autotext) : \
290 $(foreach lang,$(extras_AUTOCORR_LANGS),$(call gb_CustomTarget_get_workdir,extras/source/autotext)/acor_$(lastword $(subst :, ,$(lang))).dat)
292 $(call gb_CustomTarget_get_workdir,extras/source/autotext)/%/mimetype : $(SRCDIR)/extras/source/autotext/lang/%/mimetype
293 $(call gb_Output_announce,$*/mimetype,$(true),CPY,1)
294 cp $< $@
296 $(call gb_CustomTarget_get_workdir,extras/source/autotext)/%.xml : $(SRCDIR)/extras/source/autotext/lang/%.xml \
297 | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
298 $(call gb_Output_announce,$*.xml,$(true),XSL,1)
299 $(call gb_ExternalExecutable_get_command,xsltproc) -o $@ $(SRCDIR)/extras/util/compact.xsl $<
301 $(call gb_CustomTarget_get_workdir,extras/source/autotext)/%.dat :
302 $(call gb_Output_announce,$*.dat,$(true),ZIP,2)
303 $(call gb_Helper_abbreviate_dirs,\
304 cd $(EXTRAS_AUTOCORR_DIR) && \
305 zip -qrX --filesync --must-match $@ $(EXTRAS_AUTOCORR_FILES) \
308 define extras_Autocorr_make_file_deps
309 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : $(SRCDIR)/$(1)/lang/$(2) \
310 | $(dir $(call gb_CustomTarget_get_workdir,$(1))/$(2)).dir
312 endef
314 define extras_Autocorr_make_zip_deps
315 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
316 $(addprefix $(call gb_CustomTarget_get_workdir,$(1))/,$(filter $(3)/%,$(extras_AUTOCORR_MIMETYPEFILES) $(extras_AUTOCORR_XMLFILES))) \
317 | $(dir $(call gb_CustomTarget_get_workdir,$(1))/$(2)).dir
319 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
320 EXTRAS_AUTOCORR_FILES := $(foreach file,$(filter $(3)/%,$(extras_AUTOCORR_MIMETYPEFILES) $(extras_AUTOCORR_XMLFILES)),$(subst $(3)/acor/,,$(file)))
321 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
322 EXTRAS_AUTOCORR_DIR := $(call gb_CustomTarget_get_workdir,$(1))/$(3)/acor
324 endef
326 $(eval $(foreach file,$(extras_AUTOCORR_MIMETYPEFILES) $(extras_AUTOCORR_XMLFILES),\
327 $(call extras_Autocorr_make_file_deps,extras/source/autotext,$(file)) \
330 $(eval $(foreach lang,$(extras_AUTOCORR_LANGS),\
331 $(call extras_Autocorr_make_zip_deps,extras/source/autotext,acor_$(lastword $(subst :, ,$(lang))).dat,$(firstword $(subst :, ,$(lang)))) \
334 # vim: set noet sw=4 ts=4: