postgresql: upgrade to release 13.8
[LibreOffice.git] / extras / CustomTarget_autocorr.mk
blob949541f73dd4fb18b3feb2b29ca4eb8ee567fee2
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 dsb:dsb \
20 el:el-GR \
21 en-AU:en-AU \
22 en-GB:en-GB \
23 en-US:en-US \
24 en-ZA:en-ZA \
25 es:es \
26 fa:fa-IR \
27 fi:fi-FI \
28 fr:fr \
29 ga-IE:ga-IE \
30 hr:hr-HR \
31 hsb:hsb \
32 hu:hu-HU \
33 is:is-IS \
34 it:it \
35 ja:ja-JP \
36 ko:ko-KR \
37 lb-LU:lb-LU \
38 lt:lt-LT \
39 mn:mn-MN \
40 nl:nl-NL \
41 nl-BE:nl-BE \
42 pl:pl-PL \
43 pt:pt-PT \
44 pt-BR:pt-BR \
45 ro:ro-RO \
46 ru:ru-RU \
47 sk:sk-SK \
48 sl:sl-SI \
49 sr-CS:sr-CS \
50 sr-Latn-CS:sr-Latn-CS \
51 sr-Latn-ME:sr-Latn-ME \
52 sr-Latn-RS:sr-Latn-RS \
53 sr-ME:sr-ME \
54 sr-RS:sr-RS \
55 sv:sv-SE \
56 tr:tr-TR \
57 vi:vi-VN \
58 vro:vro-EE \
59 zh-CN:zh-CN \
60 zh-TW:zh-TW \
62 extras_AUTOCORR_SHORTLANG = $(firstword $(subst :, ,$(filter %:$(1),$(extras_AUTOCORR_LANGS))))
64 extras_AUTOCORR_XMLFILES := \
65 af-ZA/DocumentList.xml \
66 af-ZA/META-INF/manifest.xml \
67 af-ZA/SentenceExceptList.xml \
68 af-ZA/WordExceptList.xml \
69 bg/DocumentList.xml \
70 bg/META-INF/manifest.xml \
71 bg/SentenceExceptList.xml \
72 bg/WordExceptList.xml \
73 ca/DocumentList.xml \
74 ca/META-INF/manifest.xml \
75 ca/SentenceExceptList.xml \
76 ca/WordExceptList.xml \
77 cs/DocumentList.xml \
78 cs/META-INF/manifest.xml \
79 da/DocumentList.xml \
80 da/META-INF/manifest.xml \
81 da/SentenceExceptList.xml \
82 da/WordExceptList.xml \
83 de/DocumentList.xml \
84 de/META-INF/manifest.xml \
85 de/SentenceExceptList.xml \
86 de/WordExceptList.xml \
87 dsb/DocumentList.xml \
88 dsb/META-INF/manifest.xml \
89 el/DocumentList.xml \
90 el/META-INF/manifest.xml \
91 el/SentenceExceptList.xml \
92 el/WordExceptList.xml \
93 en-AU/DocumentList.xml \
94 en-AU/META-INF/manifest.xml \
95 en-AU/SentenceExceptList.xml \
96 en-AU/WordExceptList.xml \
97 en-GB/DocumentList.xml \
98 en-GB/META-INF/manifest.xml \
99 en-GB/SentenceExceptList.xml \
100 en-GB/WordExceptList.xml \
101 en-US/DocumentList.xml \
102 en-US/META-INF/manifest.xml \
103 en-US/SentenceExceptList.xml \
104 en-US/WordExceptList.xml \
105 en-ZA/DocumentList.xml \
106 en-ZA/META-INF/manifest.xml \
107 en-ZA/SentenceExceptList.xml \
108 en-ZA/WordExceptList.xml \
109 es/DocumentList.xml \
110 es/META-INF/manifest.xml \
111 es/SentenceExceptList.xml \
112 es/WordExceptList.xml \
113 fa/DocumentList.xml \
114 fa/META-INF/manifest.xml \
115 fi/DocumentList.xml \
116 fi/META-INF/manifest.xml \
117 fi/SentenceExceptList.xml \
118 fi/WordExceptList.xml \
119 fr/DocumentList.xml \
120 fr/META-INF/manifest.xml \
121 fr/SentenceExceptList.xml \
122 fr/WordExceptList.xml \
123 ga-IE/DocumentList.xml \
124 ga-IE/META-INF/manifest.xml \
125 ga-IE/SentenceExceptList.xml \
126 ga-IE/WordExceptList.xml \
127 hr/DocumentList.xml \
128 hr/META-INF/manifest.xml \
129 hr/SentenceExceptList.xml \
130 hr/WordExceptList.xml \
131 hsb/DocumentList.xml \
132 hsb/META-INF/manifest.xml \
133 hu/DocumentList.xml \
134 hu/META-INF/manifest.xml \
135 hu/SentenceExceptList.xml \
136 hu/WordExceptList.xml \
137 is/META-INF/manifest.xml \
138 is/SentenceExceptList.xml \
139 it/DocumentList.xml \
140 it/META-INF/manifest.xml \
141 it/SentenceExceptList.xml \
142 it/WordExceptList.xml \
143 ja/DocumentList.xml \
144 ja/META-INF/manifest.xml \
145 ja/SentenceExceptList.xml \
146 ko/DocumentList.xml \
147 ko/META-INF/manifest.xml \
148 ko/SentenceExceptList.xml \
149 lb-LU/DocumentList.xml \
150 lb-LU/META-INF/manifest.xml \
151 lt/DocumentList.xml \
152 lt/META-INF/manifest.xml \
153 lt/SentenceExceptList.xml \
154 lt/WordExceptList.xml \
155 mn/DocumentList.xml \
156 mn/META-INF/manifest.xml \
157 mn/SentenceExceptList.xml \
158 mn/WordExceptList.xml \
159 nl-BE/DocumentList.xml \
160 nl-BE/META-INF/manifest.xml \
161 nl-BE/SentenceExceptList.xml \
162 nl-BE/WordExceptList.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/DocumentList.xml \
172 pt-BR/META-INF/manifest.xml \
173 pt-BR/SentenceExceptList.xml \
174 pt-BR/WordExceptList.xml \
175 pt/DocumentList.xml \
176 pt/META-INF/manifest.xml \
177 pt/SentenceExceptList.xml \
178 pt/WordExceptList.xml \
179 ro/DocumentList.xml \
180 ro/META-INF/manifest.xml \
181 ro/SentenceExceptList.xml \
182 ro/WordExceptList.xml \
183 ru/DocumentList.xml \
184 ru/META-INF/manifest.xml \
185 ru/SentenceExceptList.xml \
186 ru/WordExceptList.xml \
187 sk/DocumentList.xml \
188 sk/META-INF/manifest.xml \
189 sk/SentenceExceptList.xml \
190 sk/WordExceptList.xml \
191 sl/DocumentList.xml \
192 sl/META-INF/manifest.xml \
193 sl/SentenceExceptList.xml \
194 sl/WordExceptList.xml \
195 sr-CS/DocumentList.xml \
196 sr-CS/META-INF/manifest.xml \
197 sr-CS/SentenceExceptList.xml \
198 sr-CS/WordExceptList.xml \
199 sr-Latn-CS/DocumentList.xml \
200 sr-Latn-CS/META-INF/manifest.xml \
201 sr-Latn-CS/SentenceExceptList.xml \
202 sr-Latn-CS/WordExceptList.xml \
203 sr-Latn-ME/DocumentList.xml \
204 sr-Latn-ME/META-INF/manifest.xml \
205 sr-Latn-ME/SentenceExceptList.xml \
206 sr-Latn-ME/WordExceptList.xml \
207 sr-Latn-RS/DocumentList.xml \
208 sr-Latn-RS/META-INF/manifest.xml \
209 sr-Latn-RS/SentenceExceptList.xml \
210 sr-Latn-RS/WordExceptList.xml \
211 sr-ME/DocumentList.xml \
212 sr-ME/META-INF/manifest.xml \
213 sr-ME/SentenceExceptList.xml \
214 sr-ME/WordExceptList.xml \
215 sr-RS/DocumentList.xml \
216 sr-RS/META-INF/manifest.xml \
217 sr-RS/SentenceExceptList.xml \
218 sr-RS/WordExceptList.xml \
219 sv/DocumentList.xml \
220 sv/META-INF/manifest.xml \
221 sv/SentenceExceptList.xml \
222 sv/WordExceptList.xml \
223 tr/DocumentList.xml \
224 tr/META-INF/manifest.xml \
225 tr/SentenceExceptList.xml \
226 tr/WordExceptList.xml \
227 vi/DocumentList.xml \
228 vi/META-INF/manifest.xml \
229 vi/WordExceptList.xml \
230 vro/DocumentList.xml \
231 vro/META-INF/manifest.xml \
232 zh-CN/DocumentList.xml \
233 zh-CN/META-INF/manifest.xml \
234 zh-CN/SentenceExceptList.xml \
235 zh-TW/DocumentList.xml \
236 zh-TW/META-INF/manifest.xml \
237 zh-TW/SentenceExceptList.xml \
239 # param: shortlang
240 extras_AUTOCORR_XMLFILES_LANG = $(subst $(1)/,,$(filter $(1)/%,$(extras_AUTOCORR_XMLFILES)))
242 $(call gb_CustomTarget_get_workdir,extras/source/autocorr)/%/mimetype : \
243 | $(dir $(call gb_CustomTarget_get_workdir,extras/source/autocorr)/%/mimetype).dir
244 $(call gb_Output_announce,autocorr/$*/mimetype,$(true),TCH,1)
245 $(call gb_Trace_StartRange,autocorr/$*/mimetype,TCH)
246 touch $@
247 $(call gb_Trace_EndRange,autocorr/$*/mimetype,TCH)
249 .SECONDEXPANSION:
250 # secondexpansion since the pattern not just covers a file, but also a directory portion with
251 # different number of elements (just the lang or lang/META-INF) and thus the directory dependency
252 # needs the stem of the actual target to work as intended
253 $(call gb_CustomTarget_get_workdir,extras/source/autocorr)/%.xml : $(SRCDIR)/extras/source/autocorr/lang/%.xml \
254 | $(call gb_ExternalExecutable_get_dependencies,xsltproc) \
255 $$(dir $(call gb_CustomTarget_get_workdir,extras/source/autocorr)/$$*.xml).dir
256 $(call gb_Output_announce,autocorr/$*.xml,$(true),XSL,1)
257 $(call gb_Trace_StartRange,autocorr/$*.xml,XSL)
258 $(call gb_ExternalExecutable_get_command,xsltproc) --nonet -o $@ $(SRCDIR)/extras/util/compact.xsl $<
259 $(call gb_Trace_EndRange,autocorr/$*.xml,XSL)
261 # secondexpansion necessary since the .dat are created with longlang form, while the other files
262 # are created in the shortlang directory, and thus % cannot be used verbatim, the second expansion
263 # allows the actual stem from the target to be used in the macro calls
264 # there's no reason for the different directories though, so a janitorial cleanup would be
265 # TODO: get rid of the shortform:longform language names when assembling the autocorr files
266 $(call gb_CustomTarget_get_workdir,extras/source/autocorr)/acor_%.dat : \
267 $$(addprefix \
268 $(call gb_CustomTarget_get_workdir,extras/source/autocorr)/$$(call extras_AUTOCORR_SHORTLANG,$$*)/,\
269 mimetype \
270 $$(call extras_AUTOCORR_XMLFILES_LANG,$$(call extras_AUTOCORR_SHORTLANG,$$*)))
271 $(call gb_Output_announce,autocorr/acor_$*.dat,$(true),ZIP,2)
272 $(call gb_Trace_StartRange,autocorr/acor_$*.dat,ZIP)
273 $(call gb_Helper_abbreviate_dirs,\
274 cd $(dir $<) && \
275 zip -q0X --filesync --must-match $@ mimetype && \
276 zip -qrX --must-match $@ $(call extras_AUTOCORR_XMLFILES_LANG,$(call extras_AUTOCORR_SHORTLANG,$*)) \
278 $(call gb_Trace_EndRange,autocorr/acor_$*.dat,ZIP)
280 # vim: set noet sw=4 ts=4: