remove Basque autotext files, they were in English
[LibreOffice.git] / extras / CustomTarget_autocorr.mk
blobbb40d739c3af522e723a7418ef38146586ad085b
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 cs:cs-CZ \
16 da:da-DK \
17 de:de-DE \
18 en-AU:en-AU \
19 en-GB:en-GB \
20 en-US:en-US \
21 en-ZA:en-ZA \
22 es:es-ES \
23 fa:fa-IR \
24 fi:fi-FI \
25 fr:fr-FR \
26 ga-IE:ga-IE \
27 hr:hr-HR \
28 hu:hu-HU \
29 it:it-IT \
30 ja:ja-JP \
31 ko:ko-KR \
32 lb-LU:lb-LU \
33 lt:lt-LT \
34 mn:mn-MN \
35 nl:nl-NL \
36 nl-BE:nl-BE \
37 pl:pl-PL \
38 pt:pt-PT \
39 pt-BR:pt-BR \
40 ru:ru-RU \
41 sh-ME:sh-ME \
42 sh-RS:sh-RS \
43 sh-YU:sh-YU \
44 sk:sk-SK \
45 sl:sl-SI \
46 sr-ME:sr-ME \
47 sr-RS:sr-RS \
48 sr-YU:sr-YU \
49 sv:sv-SE \
50 tr:tr-TR \
51 vi:vi-VN \
52 zh-CN:zh-CN \
53 zh-TW:zh-TW \
55 extras_AUTOCORR_XMLFILES := \
56 af-ZA/acor/DocumentList.xml \
57 af-ZA/acor/META-INF/manifest.xml \
58 af-ZA/acor/SentenceExceptList.xml \
59 af-ZA/acor/WordExceptList.xml \
60 bg/acor/DocumentList.xml \
61 bg/acor/META-INF/manifest.xml \
62 bg/acor/SentenceExceptList.xml \
63 bg/acor/WordExceptList.xml \
64 cs/acor/BlockList.xml \
65 cs/acor/DocumentList.xml \
66 cs/acor/META-INF/manifest.xml \
67 da/acor/BlockList.xml \
68 da/acor/DocumentList.xml \
69 da/acor/META-INF/manifest.xml \
70 da/acor/SentenceExceptList.xml \
71 da/acor/WordExceptList.xml \
72 de/acor/BlockList.xml \
73 de/acor/DocumentList.xml \
74 de/acor/META-INF/manifest.xml \
75 de/acor/SentenceExceptList.xml \
76 de/acor/WordExceptList.xml \
77 en-AU/acor/BlockList.xml \
78 en-AU/acor/DocumentList.xml \
79 en-AU/acor/META-INF/manifest.xml \
80 en-AU/acor/SentenceExceptList.xml \
81 en-AU/acor/WordExceptList.xml \
82 en-GB/acor/BlockList.xml \
83 en-GB/acor/DocumentList.xml \
84 en-GB/acor/META-INF/manifest.xml \
85 en-GB/acor/SentenceExceptList.xml \
86 en-GB/acor/WordExceptList.xml \
87 en-US/acor/BlockList.xml \
88 en-US/acor/DocumentList.xml \
89 en-US/acor/META-INF/manifest.xml \
90 en-US/acor/SentenceExceptList.xml \
91 en-US/acor/WordExceptList.xml \
92 en-ZA/acor/DocumentList.xml \
93 en-ZA/acor/META-INF/manifest.xml \
94 en-ZA/acor/SentenceExceptList.xml \
95 en-ZA/acor/WordExceptList.xml \
96 es/acor/BlockList.xml \
97 es/acor/DocumentList.xml \
98 es/acor/META-INF/manifest.xml \
99 es/acor/SentenceExceptList.xml \
100 es/acor/WordExceptList.xml \
101 fa/acor/DocumentList.xml \
102 fa/acor/META-INF/manifest.xml \
103 fi/acor/BlockList.xml \
104 fi/acor/DocumentList.xml \
105 fi/acor/META-INF/manifest.xml \
106 fi/acor/SentenceExceptList.xml \
107 fi/acor/WordExceptList.xml \
108 fr/acor/DocumentList.xml \
109 fr/acor/META-INF/manifest.xml \
110 fr/acor/SentenceExceptList.xml \
111 fr/acor/WordExceptList.xml \
112 ga-IE/acor/DocumentList.xml \
113 ga-IE/acor/META-INF/manifest.xml \
114 ga-IE/acor/SentenceExceptList.xml \
115 ga-IE/acor/WordExceptList.xml \
116 hr/acor/DocumentList.xml \
117 hr/acor/META-INF/manifest.xml \
118 hr/acor/SentenceExceptList.xml \
119 hr/acor/WordExceptList.xml \
120 hu/acor/BlockList.xml \
121 hu/acor/DocumentList.xml \
122 hu/acor/META-INF/manifest.xml \
123 hu/acor/SentenceExceptList.xml \
124 hu/acor/WordExceptList.xml \
125 it/acor/BlockList.xml \
126 it/acor/DocumentList.xml \
127 it/acor/META-INF/manifest.xml \
128 it/acor/SentenceExceptList.xml \
129 it/acor/WordExceptList.xml \
130 ja/acor/DocumentList.xml \
131 ja/acor/META-INF/manifest.xml \
132 ja/acor/SentenceExceptList.xml \
133 ko/acor/DocumentList.xml \
134 ko/acor/META-INF/manifest.xml \
135 ko/acor/SentenceExceptList.xml \
136 lb-LU/acor/DocumentList.xml \
137 lb-LU/acor/META-INF/manifest.xml \
138 lt/acor/BlockList.xml \
139 lt/acor/DocumentList.xml \
140 lt/acor/META-INF/manifest.xml \
141 lt/acor/SentenceExceptList.xml \
142 lt/acor/WordExceptList.xml \
143 mn/acor/DocumentList.xml \
144 mn/acor/META-INF/manifest.xml \
145 mn/acor/SentenceExceptList.xml \
146 mn/acor/WordExceptList.xml \
147 nl-BE/acor/BlockList.xml \
148 nl-BE/acor/DocumentList.xml \
149 nl-BE/acor/META-INF/manifest.xml \
150 nl-BE/acor/SentenceExceptList.xml \
151 nl-BE/acor/WordExceptList.xml \
152 nl/acor/BlockList.xml \
153 nl/acor/DocumentList.xml \
154 nl/acor/META-INF/manifest.xml \
155 nl/acor/SentenceExceptList.xml \
156 nl/acor/WordExceptList.xml \
157 pl/acor/DocumentList.xml \
158 pl/acor/META-INF/manifest.xml \
159 pl/acor/SentenceExceptList.xml \
160 pl/acor/WordExceptList.xml \
161 pt-BR/acor/BlockList.xml \
162 pt-BR/acor/DocumentList.xml \
163 pt-BR/acor/META-INF/manifest.xml \
164 pt-BR/acor/SentenceExceptList.xml \
165 pt-BR/acor/WordExceptList.xml \
166 pt/acor/BlockList.xml \
167 pt/acor/DocumentList.xml \
168 pt/acor/META-INF/manifest.xml \
169 pt/acor/SentenceExceptList.xml \
170 pt/acor/WordExceptList.xml \
171 ru/acor/BlockList.xml \
172 ru/acor/DocumentList.xml \
173 ru/acor/META-INF/manifest.xml \
174 ru/acor/SentenceExceptList.xml \
175 ru/acor/WordExceptList.xml \
176 sh-ME/acor/DocumentList.xml \
177 sh-ME/acor/META-INF/manifest.xml \
178 sh-ME/acor/SentenceExceptList.xml \
179 sh-ME/acor/WordExceptList.xml \
180 sh-RS/acor/DocumentList.xml \
181 sh-RS/acor/META-INF/manifest.xml \
182 sh-RS/acor/SentenceExceptList.xml \
183 sh-RS/acor/WordExceptList.xml \
184 sh-YU/acor/DocumentList.xml \
185 sh-YU/acor/META-INF/manifest.xml \
186 sh-YU/acor/SentenceExceptList.xml \
187 sh-YU/acor/WordExceptList.xml \
188 sk/acor/DocumentList.xml \
189 sk/acor/META-INF/manifest.xml \
190 sk/acor/SentenceExceptList.xml \
191 sk/acor/WordExceptList.xml \
192 sl/acor/DocumentList.xml \
193 sl/acor/META-INF/manifest.xml \
194 sl/acor/SentenceExceptList.xml \
195 sl/acor/WordExceptList.xml \
196 sr-ME/acor/DocumentList.xml \
197 sr-ME/acor/META-INF/manifest.xml \
198 sr-ME/acor/SentenceExceptList.xml \
199 sr-ME/acor/WordExceptList.xml \
200 sr-RS/acor/DocumentList.xml \
201 sr-RS/acor/META-INF/manifest.xml \
202 sr-RS/acor/SentenceExceptList.xml \
203 sr-RS/acor/WordExceptList.xml \
204 sr-YU/acor/DocumentList.xml \
205 sr-YU/acor/META-INF/manifest.xml \
206 sr-YU/acor/SentenceExceptList.xml \
207 sr-YU/acor/WordExceptList.xml \
208 sv/acor/BlockList.xml \
209 sv/acor/DocumentList.xml \
210 sv/acor/META-INF/manifest.xml \
211 sv/acor/SentenceExceptList.xml \
212 sv/acor/WordExceptList.xml \
213 tr/acor/DocumentList.xml \
214 tr/acor/META-INF/manifest.xml \
215 tr/acor/SentenceExceptList.xml \
216 tr/acor/WordExceptList.xml \
217 vi/acor/DocumentList.xml \
218 vi/acor/META-INF/manifest.xml \
219 vi/acor/WordExceptList.xml \
220 zh-CN/acor/DocumentList.xml \
221 zh-CN/acor/META-INF/manifest.xml \
222 zh-CN/acor/SentenceExceptList.xml \
223 zh-TW/acor/DocumentList.xml \
224 zh-TW/acor/META-INF/manifest.xml \
225 zh-TW/acor/SentenceExceptList.xml \
228 extras_AUTOCORR_MIMETYPEFILES := \
229 af-ZA/acor/mimetype \
230 bg/acor/mimetype \
231 cs/acor/mimetype \
232 da/acor/mimetype \
233 de/acor/mimetype \
234 en-AU/acor/mimetype \
235 en-GB/acor/mimetype \
236 en-US/acor/mimetype \
237 en-ZA/acor/mimetype \
238 es/acor/mimetype \
239 fa/acor/mimetype \
240 fi/acor/mimetype \
241 fr/acor/mimetype \
242 ga-IE/acor/mimetype \
243 hu/acor/mimetype \
244 it/acor/mimetype \
245 lb-LU/acor/mimetype \
246 lt/acor/mimetype \
247 mn/acor/mimetype \
248 nl-BE/acor/mimetype \
249 nl/acor/mimetype \
250 pl/acor/mimetype \
251 pt-BR/acor/mimetype \
252 pt/acor/mimetype \
253 ru/acor/mimetype \
254 sh-ME/acor/mimetype \
255 sh-RS/acor/mimetype \
256 sh-YU/acor/mimetype \
257 sk/acor/mimetype \
258 sl/acor/mimetype \
259 sr-ME/acor/mimetype \
260 sr-RS/acor/mimetype \
261 sr-YU/acor/mimetype \
262 sv/acor/mimetype \
263 tr/acor/mimetype \
264 vi/acor/mimetype \
267 ifneq ($(sort $(foreach file,$(extras_AUTOCORR_XMLFILES),$(firstword $(subst /, ,$(file))))),$(sort $(foreach lang,$(extras_AUTOCORR_LANGS),$(firstword $(subst :, ,$(lang))))))
268 $(call gb_Output_error,defined autocorrection languages do not match existing directories)
269 endif
271 $(call gb_CustomTarget_get_target,extras/source/autotext) : \
272 $(foreach lang,$(extras_AUTOCORR_LANGS),$(call gb_CustomTarget_get_workdir,extras/source/autotext)/acor_$(lastword $(subst :, ,$(lang))).dat)
274 $(call gb_CustomTarget_get_workdir,extras/source/autotext)/%/mimetype : $(SRCDIR)/extras/source/autotext/lang/%/mimetype
275 $(call gb_Output_announce,$*/mimetype,$(true),CPY,1)
276 cp $< $@
278 $(call gb_CustomTarget_get_workdir,extras/source/autotext)/%.xml : $(SRCDIR)/extras/source/autotext/lang/%.xml \
279 | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
280 $(call gb_Output_announce,$*.xml,$(true),XSL,1)
281 $(call gb_ExternalExecutable_get_command,xsltproc) -o $@ $(SRCDIR)/extras/util/compact.xsl $<
283 $(call gb_CustomTarget_get_workdir,extras/source/autotext)/%.dat :
284 $(call gb_Output_announce,$*.dat,$(true),ZIP,2)
285 $(call gb_Helper_abbreviate_dirs,\
286 cd $(EXTRAS_AUTOCORR_DIR) && \
287 zip -qrX --filesync $@ $(EXTRAS_AUTOCORR_FILES) \
290 define extras_Autocorr_make_file_deps
291 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : $(SRCDIR)/$(1)/lang/$(2) \
292 | $(dir $(call gb_CustomTarget_get_workdir,$(1))/$(2)).dir
294 endef
296 define extras_Autocorr_make_zip_deps
297 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
298 $(addprefix $(call gb_CustomTarget_get_workdir,$(1))/,$(filter $(3)/%,$(extras_AUTOCORR_MIMETYPEFILES) $(extras_AUTOCORR_XMLFILES))) \
299 | $(dir $(call gb_CustomTarget_get_workdir,$(1))/$(2)).dir
301 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
302 EXTRAS_AUTOCORR_FILES := $(foreach file,$(filter $(3)/%,$(extras_AUTOCORR_MIMETYPEFILES) $(extras_AUTOCORR_XMLFILES)),$(subst $(3)/acor/,,$(file)))
303 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
304 EXTRAS_AUTOCORR_DIR := $(call gb_CustomTarget_get_workdir,$(1))/$(3)/acor
306 endef
308 $(eval $(foreach file,$(extras_AUTOCORR_MIMETYPEFILES) $(extras_AUTOCORR_XMLFILES),\
309 $(call extras_Autocorr_make_file_deps,extras/source/autotext,$(file)) \
312 $(eval $(foreach lang,$(extras_AUTOCORR_LANGS),\
313 $(call extras_Autocorr_make_zip_deps,extras/source/autotext,acor_$(lastword $(subst :, ,$(lang))).dat,$(firstword $(subst :, ,$(lang)))) \
316 # vim: set noet sw=4 ts=4: