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 autocorr_PYTHONCOMMAND
:= $(call gb_ExternalExecutable_get_command
,python
)
14 extras_AUTOCORR_LANGS
:= \
52 sr-Latn-CS
:sr-Latn-CS \
53 sr-Latn-ME
:sr-Latn-ME \
54 sr-Latn-RS
:sr-Latn-RS \
65 extras_AUTOCORR_SHORTLANG
= $(firstword $(subst :, ,$(filter %:$(1),$(extras_AUTOCORR_LANGS
))))
67 extras_AUTOCORR_XMLFILES
:= \
68 af-ZA
/DocumentList.xml \
69 af-ZA
/META-INF
/manifest.xml \
70 af-ZA
/SentenceExceptList.xml \
71 af-ZA
/WordExceptList.xml \
73 bg
/META-INF
/manifest.xml \
74 bg
/SentenceExceptList.xml \
75 bg
/WordExceptList.xml \
77 ca
/META-INF
/manifest.xml \
78 ca
/SentenceExceptList.xml \
79 ca
/WordExceptList.xml \
81 cs
/META-INF
/manifest.xml \
83 da
/META-INF
/manifest.xml \
84 da
/SentenceExceptList.xml \
85 da
/WordExceptList.xml \
87 de
/META-INF
/manifest.xml \
88 de
/SentenceExceptList.xml \
89 de
/WordExceptList.xml \
90 dsb
/DocumentList.xml \
91 dsb
/META-INF
/manifest.xml \
93 el
/META-INF
/manifest.xml \
94 el
/SentenceExceptList.xml \
95 el
/WordExceptList.xml \
96 en-AU
/DocumentList.xml \
97 en-AU
/META-INF
/manifest.xml \
98 en-AU
/SentenceExceptList.xml \
99 en-AU
/WordExceptList.xml \
100 en-GB
/DocumentList.xml \
101 en-GB
/META-INF
/manifest.xml \
102 en-GB
/SentenceExceptList.xml \
103 en-GB
/WordExceptList.xml \
104 en-US
/DocumentList.xml \
105 en-US
/META-INF
/manifest.xml \
106 en-US
/SentenceExceptList.xml \
107 en-US
/WordExceptList.xml \
108 en-ZA
/DocumentList.xml \
109 en-ZA
/META-INF
/manifest.xml \
110 en-ZA
/SentenceExceptList.xml \
111 en-ZA
/WordExceptList.xml \
112 es
/DocumentList.xml \
113 es
/META-INF
/manifest.xml \
114 es
/SentenceExceptList.xml \
115 es
/WordExceptList.xml \
116 fa
/DocumentList.xml \
117 fa
/META-INF
/manifest.xml \
118 fi
/DocumentList.xml \
119 fi
/META-INF
/manifest.xml \
120 fi
/SentenceExceptList.xml \
121 fi
/WordExceptList.xml \
122 fr
/DocumentList.xml \
123 fr
/META-INF
/manifest.xml \
124 fr
/SentenceExceptList.xml \
125 fr
/WordExceptList.xml \
126 ga-IE
/DocumentList.xml \
127 ga-IE
/META-INF
/manifest.xml \
128 ga-IE
/SentenceExceptList.xml \
129 ga-IE
/WordExceptList.xml \
130 hr
/DocumentList.xml \
131 hr
/META-INF
/manifest.xml \
132 hr
/SentenceExceptList.xml \
133 hr
/WordExceptList.xml \
134 hsb
/DocumentList.xml \
135 hsb
/META-INF
/manifest.xml \
136 hu
/DocumentList.xml \
137 hu
/META-INF
/manifest.xml \
138 hu
/SentenceExceptList.xml \
139 hu
/WordExceptList.xml \
140 is
/DocumentList.xml \
141 is
/META-INF
/manifest.xml \
142 is
/SentenceExceptList.xml \
143 it
/DocumentList.xml \
144 it
/META-INF
/manifest.xml \
145 it
/SentenceExceptList.xml \
146 it
/WordExceptList.xml \
147 ja
/DocumentList.xml \
148 ja
/META-INF
/manifest.xml \
149 ja
/SentenceExceptList.xml \
150 ko
/DocumentList.xml \
151 ko
/META-INF
/manifest.xml \
152 ko
/SentenceExceptList.xml \
153 lb-LU
/DocumentList.xml \
154 lb-LU
/META-INF
/manifest.xml \
155 lt
/DocumentList.xml \
156 lt
/META-INF
/manifest.xml \
157 lt
/SentenceExceptList.xml \
158 lt
/WordExceptList.xml \
159 mn
/DocumentList.xml \
160 mn
/META-INF
/manifest.xml \
161 mn
/SentenceExceptList.xml \
162 mn
/WordExceptList.xml \
163 nl-BE
/DocumentList.xml \
164 nl-BE
/META-INF
/manifest.xml \
165 nl-BE
/SentenceExceptList.xml \
166 nl-BE
/WordExceptList.xml \
167 nl
/DocumentList.xml \
168 nl
/META-INF
/manifest.xml \
169 nl
/SentenceExceptList.xml \
170 nl
/WordExceptList.xml \
171 pl
/DocumentList.xml \
172 pl
/META-INF
/manifest.xml \
173 pl
/SentenceExceptList.xml \
174 pl
/WordExceptList.xml \
175 pt-BR
/DocumentList.xml \
176 pt-BR
/META-INF
/manifest.xml \
177 pt-BR
/SentenceExceptList.xml \
178 pt-BR
/WordExceptList.xml \
179 pt
/DocumentList.xml \
180 pt
/META-INF
/manifest.xml \
181 pt
/SentenceExceptList.xml \
182 pt
/WordExceptList.xml \
183 ro
/DocumentList.xml \
184 ro
/META-INF
/manifest.xml \
185 ro
/SentenceExceptList.xml \
186 ro
/WordExceptList.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
/DocumentList.xml \
224 sv
/META-INF
/manifest.xml \
225 sv
/SentenceExceptList.xml \
226 sv
/WordExceptList.xml \
227 th
/DocumentList.xml \
228 th
/META-INF
/manifest.xml \
229 tr
/DocumentList.xml \
230 tr
/META-INF
/manifest.xml \
231 tr
/SentenceExceptList.xml \
232 tr
/WordExceptList.xml \
233 vi
/DocumentList.xml \
234 vi
/META-INF
/manifest.xml \
235 vi
/WordExceptList.xml \
236 vro
/DocumentList.xml \
237 vro
/META-INF
/manifest.xml \
238 zh-CN
/DocumentList.xml \
239 zh-CN
/META-INF
/manifest.xml \
240 zh-CN
/SentenceExceptList.xml \
241 zh-TW
/DocumentList.xml \
242 zh-TW
/META-INF
/manifest.xml \
243 zh-TW
/SentenceExceptList.xml \
246 extras_AUTOCORR_XMLFILES_LANG
= $(subst $(1)/,,$(filter $(1)/%,$(extras_AUTOCORR_XMLFILES
)))
248 $(call gb_CustomTarget_get_workdir
,extras
/source
/autocorr
)/%/mimetype
: \
249 |
$(dir $(call gb_CustomTarget_get_workdir
,extras
/source
/autocorr
)/%/mimetype
).
dir
250 $(call gb_Output_announce
,autocorr
/$*/mimetype
,$(true
),TCH
,1)
251 $(call gb_Trace_StartRange
,autocorr
/$*/mimetype
,TCH
)
253 $(call gb_Trace_EndRange
,autocorr
/$*/mimetype
,TCH
)
256 # secondexpansion since the pattern not just covers a file, but also a directory portion with
257 # different number of elements (just the lang or lang/META-INF) and thus the directory dependency
258 # needs the stem of the actual target to work as intended
259 $(call gb_CustomTarget_get_workdir
,extras
/source
/autocorr
)/%.xml
: $(SRCDIR
)/extras
/source
/autocorr
/lang
/%.xml \
260 |
$(call gb_ExternalExecutable_get_dependencies
,xsltproc
) \
261 $$(dir $(call gb_CustomTarget_get_workdir
,extras
/source
/autocorr
)/$$*.xml
).
dir
262 $(call gb_Output_announce
,autocorr
/$*.xml
,$(true
),XSL
,1)
263 $(call gb_Trace_StartRange
,autocorr
/$*.xml
,XSL
)
264 $(call gb_ExternalExecutable_get_command
,xsltproc
) --nonet
-o
$@
$(SRCDIR
)/extras
/util
/compact.xsl
$<
265 $(call gb_Trace_EndRange
,autocorr
/$*.xml
,XSL
)
267 # secondexpansion necessary since the .dat are created with longlang form, while the other files
268 # are created in the shortlang directory, and thus % cannot be used verbatim, the second expansion
269 # allows the actual stem from the target to be used in the macro calls
270 # there's no reason for the different directories though, so a janitorial cleanup would be
271 # TODO: get rid of the shortform:longform language names when assembling the autocorr files
272 $(call gb_CustomTarget_get_workdir
,extras
/source
/autocorr
)/acor_
%.dat
: \
274 $(call gb_CustomTarget_get_workdir
,extras
/source
/autocorr
)/$$(call extras_AUTOCORR_SHORTLANG
,$$*)/,\
276 $$(call extras_AUTOCORR_XMLFILES_LANG
,$$(call extras_AUTOCORR_SHORTLANG
,$$*))) \
277 |
$(call gb_ExternalExecutable_get_dependencies
,python
)
278 $(call gb_Output_announce
,autocorr
/acor_
$*.dat
,$(true
),ZIP
,2)
279 $(call gb_Trace_StartRange
,autocorr
/acor_
$*.dat
,ZIP
)
280 $(call gb_Helper_abbreviate_dirs
,\
282 $(autocorr_PYTHONCOMMAND
) $(SRCDIR
)/bin
/check-autocorr.py DocumentList.xml
&& \
283 zip
-q0X
--filesync
--must-match
$@ mimetype
&& \
284 zip
-qrX
--must-match
$@
$(call extras_AUTOCORR_XMLFILES_LANG
,$(call extras_AUTOCORR_SHORTLANG
,$*)) \
286 $(call gb_Trace_EndRange
,autocorr
/acor_
$*.dat
,ZIP
)
288 # vim: set noet sw=4 ts=4: