Bump version to 5.0-14
[LibreOffice.git] / extras / CustomTarget_autocorr.mk
blobb3c1ba50ca0d1a60604c97df869811b17a869467
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/autocorr))
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/DocumentList.xml \
60 af-ZA/META-INF/manifest.xml \
61 af-ZA/SentenceExceptList.xml \
62 af-ZA/WordExceptList.xml \
63 bg/DocumentList.xml \
64 bg/META-INF/manifest.xml \
65 bg/SentenceExceptList.xml \
66 bg/WordExceptList.xml \
67 ca/BlockList.xml \
68 ca/DocumentList.xml \
69 ca/META-INF/manifest.xml \
70 ca/SentenceExceptList.xml \
71 ca/WordExceptList.xml \
72 cs/BlockList.xml \
73 cs/DocumentList.xml \
74 cs/META-INF/manifest.xml \
75 da/BlockList.xml \
76 da/DocumentList.xml \
77 da/META-INF/manifest.xml \
78 da/SentenceExceptList.xml \
79 da/WordExceptList.xml \
80 de/BlockList.xml \
81 de/DocumentList.xml \
82 de/META-INF/manifest.xml \
83 de/SentenceExceptList.xml \
84 de/WordExceptList.xml \
85 en-AU/BlockList.xml \
86 en-AU/DocumentList.xml \
87 en-AU/META-INF/manifest.xml \
88 en-AU/SentenceExceptList.xml \
89 en-AU/WordExceptList.xml \
90 en-GB/BlockList.xml \
91 en-GB/DocumentList.xml \
92 en-GB/META-INF/manifest.xml \
93 en-GB/SentenceExceptList.xml \
94 en-GB/WordExceptList.xml \
95 en-US/BlockList.xml \
96 en-US/DocumentList.xml \
97 en-US/META-INF/manifest.xml \
98 en-US/SentenceExceptList.xml \
99 en-US/WordExceptList.xml \
100 en-ZA/DocumentList.xml \
101 en-ZA/META-INF/manifest.xml \
102 en-ZA/SentenceExceptList.xml \
103 en-ZA/WordExceptList.xml \
104 es/BlockList.xml \
105 es/DocumentList.xml \
106 es/META-INF/manifest.xml \
107 es/SentenceExceptList.xml \
108 es/WordExceptList.xml \
109 fa/DocumentList.xml \
110 fa/META-INF/manifest.xml \
111 fi/BlockList.xml \
112 fi/DocumentList.xml \
113 fi/META-INF/manifest.xml \
114 fi/SentenceExceptList.xml \
115 fi/WordExceptList.xml \
116 fr/DocumentList.xml \
117 fr/META-INF/manifest.xml \
118 fr/SentenceExceptList.xml \
119 fr/WordExceptList.xml \
120 ga-IE/DocumentList.xml \
121 ga-IE/META-INF/manifest.xml \
122 ga-IE/SentenceExceptList.xml \
123 ga-IE/WordExceptList.xml \
124 hr/DocumentList.xml \
125 hr/META-INF/manifest.xml \
126 hr/SentenceExceptList.xml \
127 hr/WordExceptList.xml \
128 hu/BlockList.xml \
129 hu/DocumentList.xml \
130 hu/META-INF/manifest.xml \
131 hu/SentenceExceptList.xml \
132 hu/WordExceptList.xml \
133 is/META-INF/manifest.xml \
134 is/SentenceExceptList.xml \
135 it/BlockList.xml \
136 it/DocumentList.xml \
137 it/META-INF/manifest.xml \
138 it/SentenceExceptList.xml \
139 it/WordExceptList.xml \
140 ja/DocumentList.xml \
141 ja/META-INF/manifest.xml \
142 ja/SentenceExceptList.xml \
143 ko/DocumentList.xml \
144 ko/META-INF/manifest.xml \
145 ko/SentenceExceptList.xml \
146 lb-LU/DocumentList.xml \
147 lb-LU/META-INF/manifest.xml \
148 lt/BlockList.xml \
149 lt/DocumentList.xml \
150 lt/META-INF/manifest.xml \
151 lt/SentenceExceptList.xml \
152 lt/WordExceptList.xml \
153 mn/DocumentList.xml \
154 mn/META-INF/manifest.xml \
155 mn/SentenceExceptList.xml \
156 mn/WordExceptList.xml \
157 nl-BE/BlockList.xml \
158 nl-BE/DocumentList.xml \
159 nl-BE/META-INF/manifest.xml \
160 nl-BE/SentenceExceptList.xml \
161 nl-BE/WordExceptList.xml \
162 nl/BlockList.xml \
163 nl/DocumentList.xml \
164 nl/META-INF/manifest.xml \
165 nl/SentenceExceptList.xml \
166 nl/WordExceptList.xml \
167 pl/DocumentList.xml \
168 pl/META-INF/manifest.xml \
169 pl/SentenceExceptList.xml \
170 pl/WordExceptList.xml \
171 pt-BR/BlockList.xml \
172 pt-BR/DocumentList.xml \
173 pt-BR/META-INF/manifest.xml \
174 pt-BR/SentenceExceptList.xml \
175 pt-BR/WordExceptList.xml \
176 pt/BlockList.xml \
177 pt/DocumentList.xml \
178 pt/META-INF/manifest.xml \
179 pt/SentenceExceptList.xml \
180 pt/WordExceptList.xml \
181 ro/BlockList.xml \
182 ro/DocumentList.xml \
183 ro/META-INF/manifest.xml \
184 ro/SentenceExceptList.xml \
185 ro/WordExceptList.xml \
186 ru/BlockList.xml \
187 ru/DocumentList.xml \
188 ru/META-INF/manifest.xml \
189 ru/SentenceExceptList.xml \
190 ru/WordExceptList.xml \
191 sk/DocumentList.xml \
192 sk/META-INF/manifest.xml \
193 sk/SentenceExceptList.xml \
194 sk/WordExceptList.xml \
195 sl/DocumentList.xml \
196 sl/META-INF/manifest.xml \
197 sl/SentenceExceptList.xml \
198 sl/WordExceptList.xml \
199 sr-CS/DocumentList.xml \
200 sr-CS/META-INF/manifest.xml \
201 sr-CS/SentenceExceptList.xml \
202 sr-CS/WordExceptList.xml \
203 sr-Latn-CS/DocumentList.xml \
204 sr-Latn-CS/META-INF/manifest.xml \
205 sr-Latn-CS/SentenceExceptList.xml \
206 sr-Latn-CS/WordExceptList.xml \
207 sr-Latn-ME/DocumentList.xml \
208 sr-Latn-ME/META-INF/manifest.xml \
209 sr-Latn-ME/SentenceExceptList.xml \
210 sr-Latn-ME/WordExceptList.xml \
211 sr-Latn-RS/DocumentList.xml \
212 sr-Latn-RS/META-INF/manifest.xml \
213 sr-Latn-RS/SentenceExceptList.xml \
214 sr-Latn-RS/WordExceptList.xml \
215 sr-ME/DocumentList.xml \
216 sr-ME/META-INF/manifest.xml \
217 sr-ME/SentenceExceptList.xml \
218 sr-ME/WordExceptList.xml \
219 sr-RS/DocumentList.xml \
220 sr-RS/META-INF/manifest.xml \
221 sr-RS/SentenceExceptList.xml \
222 sr-RS/WordExceptList.xml \
223 sv/BlockList.xml \
224 sv/DocumentList.xml \
225 sv/META-INF/manifest.xml \
226 sv/SentenceExceptList.xml \
227 sv/WordExceptList.xml \
228 tr/DocumentList.xml \
229 tr/META-INF/manifest.xml \
230 tr/SentenceExceptList.xml \
231 tr/WordExceptList.xml \
232 vi/DocumentList.xml \
233 vi/META-INF/manifest.xml \
234 vi/WordExceptList.xml \
235 zh-CN/DocumentList.xml \
236 zh-CN/META-INF/manifest.xml \
237 zh-CN/SentenceExceptList.xml \
238 zh-TW/DocumentList.xml \
239 zh-TW/META-INF/manifest.xml \
240 zh-TW/SentenceExceptList.xml \
243 extras_AUTOCORR_MIMETYPEFILES := $(foreach lang,$(extras_AUTOCORR_LANGS),$(firstword $(subst :, ,$(lang)))/mimetype)
246 ifneq ($(sort $(foreach file,$(extras_AUTOCORR_XMLFILES),$(firstword $(subst /, ,$(file))))),$(sort $(foreach lang,$(extras_AUTOCORR_LANGS),$(firstword $(subst :, ,$(lang))))))
247 $(call gb_Output_error,defined autocorrection languages do not match existing directories)
248 endif
250 $(call gb_CustomTarget_get_target,extras/source/autocorr) : \
251 $(foreach lang,$(extras_AUTOCORR_LANGS),$(call gb_CustomTarget_get_workdir,extras/source/autocorr)/acor_$(lastword $(subst :, ,$(lang))).dat)
253 $(call gb_CustomTarget_get_workdir,extras/source/autocorr)/%/mimetype : $(SRCDIR)/extras/source/autocorr/lang/%/mimetype
254 $(call gb_Output_announce,$*/mimetype,$(true),CPY,1)
255 cp $< $@
257 $(call gb_CustomTarget_get_workdir,extras/source/autocorr)/%.xml : $(SRCDIR)/extras/source/autocorr/lang/%.xml \
258 | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
259 $(call gb_Output_announce,$*.xml,$(true),XSL,1)
260 $(call gb_ExternalExecutable_get_command,xsltproc) -o $@ $(SRCDIR)/extras/util/compact.xsl $<
262 $(call gb_CustomTarget_get_workdir,extras/source/autocorr)/%.dat :
263 $(call gb_Output_announce,$*.dat,$(true),ZIP,2)
264 $(call gb_Helper_abbreviate_dirs,\
265 cd $(EXTRAS_AUTOCORR_DIR) && \
266 zip -qrX --filesync --must-match $@ $(EXTRAS_AUTOCORR_FILES) \
269 define extras_Autocorr_make_file_deps
270 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : $(SRCDIR)/$(1)/lang/$(2) \
271 | $(dir $(call gb_CustomTarget_get_workdir,$(1))/$(2)).dir
273 endef
275 define extras_Autocorr_make_zip_deps
276 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
277 $(addprefix $(call gb_CustomTarget_get_workdir,$(1))/,$(filter $(3)/%,$(extras_AUTOCORR_MIMETYPEFILES) $(extras_AUTOCORR_XMLFILES))) \
278 | $(dir $(call gb_CustomTarget_get_workdir,$(1))/$(2)).dir
280 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
281 EXTRAS_AUTOCORR_FILES := $(foreach file,$(filter $(3)/%,$(extras_AUTOCORR_MIMETYPEFILES) $(extras_AUTOCORR_XMLFILES)),$(subst $(3)/,,$(file)))
282 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
283 EXTRAS_AUTOCORR_DIR := $(call gb_CustomTarget_get_workdir,$(1))/$(3)
285 endef
287 $(eval $(foreach file,$(extras_AUTOCORR_MIMETYPEFILES) $(extras_AUTOCORR_XMLFILES),\
288 $(call extras_Autocorr_make_file_deps,extras/source/autocorr,$(file)) \
291 $(eval $(foreach lang,$(extras_AUTOCORR_LANGS),\
292 $(call extras_Autocorr_make_zip_deps,extras/source/autocorr,acor_$(lastword $(subst :, ,$(lang))).dat,$(firstword $(subst :, ,$(lang)))) \
295 # vim: set noet sw=4 ts=4: