blob: b168af76456ba9225792a871c12e197bd9e07a98 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001# Makefile for the Vim message translations for MSVC
2# (based on make_ming.mak)
3#
4# Mike Williams <mrw@eandem.co.uk>
5#
6# Please read README_mvc.txt before using this file.
7#
8
RestorerZe2146922023-11-23 20:58:32 +01009!IF [powershell -nologo -noprofile "exit $$psversiontable.psversion.major"] == 2
10!ERROR The program "PowerShell" version 3.0 or higher is required to work
11!ENDIF
12
13!IFNDEF LANGUAGE
14!ERROR Set the environment variable %LANGUAGE%. See README_mvc.txt
15!ENDIF
Bram Moolenaar01380622015-12-29 16:04:42 +010016
Bram Moolenaar167fb6d2023-05-23 15:27:51 +010017# get LANGUAGES, MOFILES, MOCONVERTED and others
RestorerZe2146922023-11-23 20:58:32 +010018!INCLUDE Make_all.mak
19
20!IFNDEF VIMRUNTIME
21VIMRUNTIME = ..\..\runtime
22!ENDIF
Bram Moolenaar071d4272004-06-13 20:20:40 +000023
24PACKAGE = vim
RestorerZe2146922023-11-23 20:58:32 +010025# Correct the following line for the where executeable file vim is installed
Bram Moolenaarfa573352020-09-04 13:53:00 +020026VIM = ..\vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000027
Bram Moolenaar41317732010-08-02 21:43:29 +020028# Correct the following line for the directory where gettext et al is installed
RestorerZe2146922023-11-23 20:58:32 +010029GETTEXT_PATH = D:\Programs\GetText\bin
Bram Moolenaar071d4272004-06-13 20:20:40 +000030
Bram Moolenaar01380622015-12-29 16:04:42 +010031MSGFMT = $(GETTEXT_PATH)\msgfmt -v
Bram Moolenaar071d4272004-06-13 20:20:40 +000032XGETTEXT = $(GETTEXT_PATH)\xgettext
33MSGMERGE = $(GETTEXT_PATH)\msgmerge
34
RestorerZe2146922023-11-23 20:58:32 +010035# In case some package like GnuWin32, UnixUtils, gettext
36# or something similar is installed on the system.
37# If the "iconv" program is installed on the system, but it is not registered
38# in the %PATH% environment variable, then specify the full path to this file.
39!IF EXIST ("iconv.exe")
40ICONV = "iconv.exe"
41!ELSEIF EXIST ("$(GETTEXT_PATH)\iconv.exe")
42ICONV="$(GETTEXT_PATH)\iconv.exe"
43!ENDIF
44
45# In case some package like GnuWin32, UnixUtils
46# or something similar is installed on the system.
47# If the "touch" program is installed on the system, but it is not registered
48# in the %PATH% environment variable, then specify the full path to this file.
49!IF EXIST ("touch.exe")
50TOUCH = touch.exe $@
51!ELSE
52TOUCH = @if exist $@ ( copy /b $@+,, ) else ( type nul >$@ )
53!ENDIF
54
55MV = move /y
56CP = copy /y
57RM = del /q
Bram Moolenaar071d4272004-06-13 20:20:40 +000058MKD = mkdir
59LS = dir
60
61LSFLAGS = /b /on /l /s
62
63INSTALLDIR = $(VIMRUNTIME)\lang\$(LANGUAGE)\LC_MESSAGES
64
65.SUFFIXES:
RestorerZe2146922023-11-23 20:58:32 +010066.SUFFIXES: .po .mo .pot .ck
67
68all: $(MOFILES) $(MOCONVERTED)
69
70.po.ck:
71 $(VIM) -u NONE -e -X -S check.vim -c "if error == 0 | q | endif" -c cq $<
72 $(TOUCH)
73
74check: $(CHECKFILES)
75
76checkclean:
77 $(RM) *.ck
78
79converted: $(MOCONVERTED)
80
81nl.po:
82 @( echo \# > nl.po )
83
84# Norwegian/Bokmal: "nb" is an alias for "no".
85nb.po: no.po
86 $(CP) no.po nb.po
87
88# Convert ja.po to create ja.sjis.po.
89ja.sjis.po: ja.po
90 @$(MAKE) -nologo -f Make_mvc.mak sjiscorr
91 -$(RM) $@
92!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
93 "$(GETTEXT_PATH)\msgconv.exe" -t CP932 $? | .\sjiscorr.exe > $@
94!ELSEIF DEFINED (ICONV)
95 $(ICONV) -f UTF-8 -t CP932 $? | .\sjiscorr.exe > $@
96!ELSE
97 powershell -nologo -noprofile -Command \
98 [System.IO.File]::WriteAllText(\"$@\", \
99 [System.IO.File]::ReadAllText(\"$?\", \
100 [System.Text.Encoding]::GetEncoding(65001)), \
101 [System.Text.Encoding]::GetEncoding(932))
102 type $@ | .\sjiscorr.exe > tmp.$@
103 @$(MV) tmp.$@ $@
104!ENDIF
105 powershell -nologo -noprofile -Command \
106 $$out = [System.IO.File]::ReadAllText(\"$@\", \
107 [System.Text.Encoding]::GetEncoding(932)) \
108 -replace \"`r`n\", \"`n\"; \
109 [System.IO.File]::WriteAllText(\"$@\", $$out, \
110 [System.Text.Encoding]::GetEncoding(932))
111
112sjiscorr: sjiscorr.c
113 $(CC) sjiscorr.c
114
115# Convert ja.po to create ja.euc-jp.po
116ja.euc-jp.po: ja.po
117 -$(RM) $@
118!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
119 "$(GETTEXT_PATH)\msgconv.exe" -t EUC-JP -o $@ $?
120!ELSE
121! IF DEFINED (ICONV)
122 $(ICONV) -f UTF-8 -t EUC-JP $? > $@
123! ELSE
124 powershell -nologo -noprofile -Command \
125 [System.IO.File]::WriteAllText(\"$@\", \
126 [System.IO.File]::ReadAllText(\"$?\", \
127 [System.Text.Encoding]::GetEncoding(65001)), \
128 [System.Text.Encoding]::GetEncoding(20932))
129! ENDIF
130 powershell -nologo -noprofile -Command \
131 $$out = [System.IO.File]::ReadAllText(\"$@\", \
132 [System.Text.Encoding]::GetEncoding(20932)) -replace \
133 'charset=utf-8', 'charset=EUC-JP'; \
134 [System.IO.File]::WriteAllText(\"$@\", $$out, \
135 [System.Text.Encoding]::GetEncoding(20932))
136!ENDIF
137 powershell -nologo -noprofile -Command \
138 $$out = [System.IO.File]::ReadAllText(\"$@\", \
139 [System.Text.Encoding]::GetEncoding(20932)) -replace \
140 '# Original translations', \
141 '# Generated from ja.po, DO NOT EDIT'; \
142 [System.IO.File]::WriteAllText(\"$@\", $$out, \
143 [System.Text.Encoding]::GetEncoding(20932))
144
145# Convert cs.po to create cs.cp1250.po.
146cs.cp1250.po: cs.po
147 -$(RM) $@
148!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
149 "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $?
150!ELSE
151! IF DEFINED (ICONV)
152 $(ICONV) -f ISO-8859-2 -t CP1250 $? > $@
153! ELSE
154 powershell -nologo -noprofile -Command \
155 [System.IO.File]::WriteAllText(\"$@\", \
156 [System.IO.File]::ReadAllText(\"$?\", \
157 [System.Text.Encoding]::GetEncoding(28592)), \
158 [System.Text.Encoding]::GetEncoding(1250))
159! ENDIF
160 powershell -nologo -noprofile -Command \
161 $$out = [System.IO.File]::ReadAllText(\"$@\", \
162 [System.Text.Encoding]::GetEncoding(1250)) -replace \
163 'charset=iso-8859-2', 'charset=CP1250'; \
164 [System.IO.File]::WriteAllText(\"$@\", $$out, \
165 [System.Text.Encoding]::GetEncoding(1250))
166!ENDIF
167 powershell -nologo -noprofile -Command \
168 $$out = [System.IO.File]::ReadAllText(\"$@\", \
169 [System.Text.Encoding]::GetEncoding(1250)) -replace \
170 '# Original translations', \
171 '# Generated from cs.po, DO NOT EDIT'; \
172 [System.IO.File]::WriteAllText(\"$@\", $$out, \
173 [System.Text.Encoding]::GetEncoding(1250))
174
175# Convert pl.po to create pl.cp1250.po.
176pl.cp1250.po: pl.po
177 -$(RM) $@
178!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
179 "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $?
180!ELSE
181! IF DEFINED (ICONV)
182 $(ICONV) -f ISO-8859-2 -t CP1250 $? > $@
183! ELSE
184 powershell -nologo -noprofile -Command \
185 [System.IO.File]::WriteAllText(\"$@\", \
186 [System.IO.File]::ReadAllText(\"$?\", \
187 [System.Text.Encoding]::GetEncoding(28592)), \
188 [System.Text.Encoding]::GetEncoding(1250))
189! ENDIF
190 powershell -nologo -noprofile -Command \
191 $$out = [System.IO.File]::ReadAllText(\"$@\", \
192 [System.Text.Encoding]::GetEncoding(1250)) -replace \
193 'charset=iso-8859-2', 'charset=CP1250'; \
194 [System.IO.File]::WriteAllText(\"$@\", $$out, \
195 [System.Text.Encoding]::GetEncoding(1250))
196!ENDIF
197 powershell -nologo -noprofile -Command \
198 $$out = [System.IO.File]::ReadAllText(\"$@\", \
199 [System.Text.Encoding]::GetEncoding(1250)) -replace \
200 '# Original translations', \
201 '# Generated from pl.po, DO NOT EDIT'; \
202 [System.IO.File]::WriteAllText(\"$@\", $$out, \
203 [System.Text.Encoding]::GetEncoding(1250))
204
205# Convert pl.po to create pl.UTF-8.po.
206pl.UTF-8.po: pl.po
207 -$(RM) $@
208!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
209 "$(GETTEXT_PATH)\msgconv.exe" -t UTF-8 -o $@ $?
210!ELSE
211! IF DEFINED (ICONV)
212 $(ICONV) -f ISO-8859-2 -t UTF-8 $? > $@
213! ELSE
214 powershell -nologo -noprofile -Command \
215 [System.IO.File]::WriteAllText(\"$@\", \
216 [System.IO.File]::ReadAllText(\"$?\", \
217 [System.Text.Encoding]::GetEncoding(28592)))
218! ENDIF
219 powershell -nologo -noprofile -Command \
220 (Get-Content -Raw -Encoding UTF8 $@ \
221 ^| % {$$_-replace 'charset=iso-8859-2', 'charset=UTF-8'}) \
222 ^| 1>nul New-Item -Force -Path . -ItemType file -Name $@
223!ENDIF
224 powershell -nologo -noprofile -Command \
225 (Get-Content -Raw -Encoding UTF8 $@ \
226 ^| % {$$_-replace '# Original translations', \
227 '# Generated from pl.po, DO NOT EDIT'}) \
228 ^| 1>nul New-Item -Force -Path . -ItemType file -Name $@
229
230# Convert sk.po to create sk.cp1250.po.
231sk.cp1250.po: sk.po
232 -$(RM) $@
233!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
234 "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $?
235!ELSE
236! IF DEFINED (ICONV)
237 $(ICONV) -f ISO-8859-2 -t CP1250 $? > $@
238! ELSE
239 powershell -nologo -noprofile -Command \
240 [System.IO.File]::WriteAllText(\"$@\", \
241 [System.IO.File]::ReadAllText(\"$?\", \
242 [System.Text.Encoding]::GetEncoding(28592)), \
243 [System.Text.Encoding]::GetEncoding(1250))
244! ENDIF
245 powershell -nologo -noprofile -Command \
246 $$out = [System.IO.File]::ReadAllText(\"$@\", \
247 [System.Text.Encoding]::GetEncoding(1250)) -replace \
248 'charset=iso-8859-2', 'charset=CP1250'; \
249 [System.IO.File]::WriteAllText(\"$@\", $$out, \
250 [System.Text.Encoding]::GetEncoding(1250))
251!ENDIF
252 powershell -nologo -noprofile -Command \
253 $$out = [System.IO.File]::ReadAllText(\"$@\", \
254 [System.Text.Encoding]::GetEncoding(1250)) -replace \
255 '# Original translations', \
256 '# Generated from sk.po, DO NOT EDIT'; \
257 [System.IO.File]::WriteAllText(\"$@\", $$out, \
258 [System.Text.Encoding]::GetEncoding(1250))
259
260# Convert zh_CN.UTF-8.po to create zh_CN.po.
261zh_CN.po: zh_CN.UTF-8.po
262 -$(RM) $@
263!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
264 "$(GETTEXT_PATH)\msgconv.exe" -t GB2312 -o $@ $?
265!ELSE
266! IF DEFINED (ICONV)
267 $(ICONV) -f UTF-8 -t GB2312 $? > $@
268! ELSE
269 powershell -nologo -noprofile -Command \
270 [System.IO.File]::WriteAllText(\"$@\", \
271 [System.IO.File]::ReadAllText(\"$?\", \
272 [System.Text.Encoding]::GetEncoding(65001)), \
273 [System.Text.Encoding]::GetEncoding(936))
274
275! ENDIF
276 powershell -nologo -noprofile -Command \
277 $$out = [System.IO.File]::ReadAllText(\"$@\", \
278 [System.Text.Encoding]::GetEncoding(936)) -replace \
279 'charset=UTF-8', 'charset=GB2312'; \
280 [System.IO.File]::WriteAllText(\"$@\", $$out, \
281 [System.Text.Encoding]::GetEncoding(936))
282!ENDIF
283 powershell -nologo -noprofile -Command \
284 $$out = [System.IO.File]::ReadAllText(\"$@\", \
285 [System.Text.Encoding]::GetEncoding(936)) -replace \
286 '# Original translations', \
287 '# Generated from zh_CN.UTF-8.po, DO NOT EDIT'; \
288 [System.IO.File]::WriteAllText(\"$@\", $$out, \
289 [System.Text.Encoding]::GetEncoding(936))
290
291# Convert zh_CN.UTF-8.po to create zh_CN.cp936.po.
292# Set 'charset' to gbk to avoid that msfmt generates a warning.
293# This used to convert from zh_CN.po, but that results in a conversion error.
294zh_CN.cp936.po: zh_CN.UTF-8.po
295 -$(RM) $@
296!IF DEFINED (ICONV)
297 $(ICONV) -f UTF-8 -t CP936 $? > $@
298!ELSE
299 powershell -nologo -noprofile -Command \
300 [System.IO.File]::WriteAllText(\"$@\", \
301 [System.IO.File]::ReadAllText(\"$?\", \
302 [System.Text.Encoding]::GetEncoding(65001)), \
303 [System.Text.Encoding]::GetEncoding(20936))
304
305!ENDIF
306 powershell -nologo -noprofile -Command \
307 $$out = [System.IO.File]::ReadAllText(\"$@\", \
308 [System.Text.Encoding]::GetEncoding(20936)) \
309 -replace 'charset=UTF-8', 'charset=GBK'\
310 -replace '# Original translations', \
311 '# Generated from zh_CN.UTF-8.po, DO NOT EDIT'; \
312 [System.IO.File]::WriteAllText(\"$@\", $$out, \
313 [System.Text.Encoding]::GetEncoding(20936))
314
315# Convert zh_TW.UTF-8.po to create zh_TW.po
316zh_TW.po: zh_TW.UTF-8.po
317 -$(RM) $@
318!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
319 "$(GETTEXT_PATH)\msgconv.exe" -t BIG5 -o $@ $?
320!ELSE
321! IF DEFINED (ICONV)
322 $(ICONV) -f UTF-8 -t BIG5 $? > $@
323! ELSE
324 powershell -nologo -noprofile -Command \
325 [System.IO.File]::WriteAllText(\"$@\", \
326 [System.IO.File]::ReadAllText(\"$?\", \
327 [System.Text.Encoding]::GetEncoding(65001)), \
328 [System.Text.Encoding]::GetEncoding(950))
329
330! ENDIF
331 powershell -nologo -noprofile -Command \
332 $$out = [System.IO.File]::ReadAllText(\"$@\", \
333 [System.Text.Encoding]::GetEncoding(950)) -replace \
334 'charset=UTF-8', 'charset=BIG5'; \
335 [System.IO.File]::WriteAllText(\"$@\", $$out, \
336 [System.Text.Encoding]::GetEncoding(950))
337!ENDIF
338 powershell -nologo -noprofile -Command \
339 $$out = [System.IO.File]::ReadAllText(\"$@\", \
340 [System.Text.Encoding]::GetEncoding(950)) -replace \
341 '# Original translations', \
342 '# Generated from zh_TW.UTF-8.po, DO NOT EDIT'; \
343 [System.IO.File]::WriteAllText(\"$@\", $$out, \
344 [System.Text.Encoding]::GetEncoding(950))
345
346# Convert zh_TW.UTF-8.po to create zh_TW.po with backslash characters
347# Requires doubling backslashes in the second byte. Don't depend on big5corr,
348# it should only be compiled when zh_TW.po is outdated.
349#
350# 06.11.23, added by Restorer:
351# For more details, see:
352# https://github.com/vim/vim/pull/3261
353# https://github.com/vim/vim/pull/3476
354# https://github.com/vim/vim/pull/12153
355# (read all comments)
356#
357# I checked the workability on the list of backslash characters
358# specified in zh_TW.UTF-8.po. It works.
359# But it is better to have someone native speaker check it.
360#
361
362#zh_TW.po: zh_TW.UTF-8.po
363# @$(MAKE) -nologo -f Make_mvc.mak big5corr
364# -$(RM) $@
365#!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
366# "$(GETTEXT_PATH)\msgconv.exe" -t BIG5 $? | .\big5corr.exe > $@
367#!ELSEIF DEFINED (ICONV)
368# $(ICONV) -f UTF-8 -t BIG5 $? | .\big5corr.exe > $@
369#!ELSE
370# powershell -nologo -noprofile -Command \
371# [System.IO.File]::WriteAllText(\"$@\", \
372# [System.IO.File]::ReadAllText(\"$?\", \
373# [System.Text.Encoding]::GetEncoding(65001)), \
374# [System.Text.Encoding]::GetEncoding(950))
375# type $@ | .\big5corr.exe > tmp.$@
376# @$(MV) tmp.$@ $@
377#!ENDIF
378# powershell -nologo -noprofile -Command \
379# $$out = [System.IO.File]::ReadAllText(\"$@\", \
380# [System.Text.Encoding]::GetEncoding(950)) \
381# -replace \"`r`n\", \"`n\"; \
382# [System.IO.File]::WriteAllText(\"$@\", $$out, \
383# [System.Text.Encoding]::GetEncoding(950))
384
385# see above in the zh_TW.po conversion section for backslashes.
386#big5corr: big5corr.c
387# $(CC) big5corr.c
388
389# Convert ko.UTF-8.po to create ko.po.
390ko.po: ko.UTF-8.po
391 -$(RM) $@
392!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
393 "$(GETTEXT_PATH)\msgconv.exe" -t EUC-KR -o $@ $?
394!ELSE
395! IF DEFINED (ICONV)
396 $(ICONV) -f UTF-8 -t EUC-KR $? > $@
397! ELSE
398 powershell -nologo -noprofile -Command \
399 [System.IO.File]::WriteAllText(\"$@\", \
400 [System.IO.File]::ReadAllText(\"$?\", \
401 [System.Text.Encoding]::GetEncoding(65001)), \
402 [System.Text.Encoding]::GetEncoding(51949))
403
404! ENDIF
405 powershell -nologo -noprofile -Command \
406 $$out = [System.IO.File]::ReadAllText(\"$@\", \
407 [System.Text.Encoding]::GetEncoding(51949)) -replace \
408 'charset=UTF-8', 'charset=EUC-KR'; \
409 [System.IO.File]::WriteAllText(\"$@\", $$out, \
410 [System.Text.Encoding]::GetEncoding(51949))
411!ENDIF
412 powershell -nologo -noprofile -Command \
413 $$out = [System.IO.File]::ReadAllText(\"$@\", \
414 [System.Text.Encoding]::GetEncoding(51949)) -replace \
415 '# Original translations', \
416 '# Generated from ko.UTF-8.po, DO NOT EDIT'; \
417 [System.IO.File]::WriteAllText(\"$@\", $$out, \
418 [System.Text.Encoding]::GetEncoding(51949))
419
420# Convert ru.po to create ru.cp1251.po.
421ru.cp1251.po: ru.po
422 -$(RM) $@
423!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
424 "$(GETTEXT_PATH)\msgconv.exe" -t CP1251 -o $@ $?
425!ELSE
426! IF DEFINED (ICONV)
427 $(ICONV) -f UTF-8 -t CP1251 $? > $@
428! ELSE
429 powershell -nologo -noprofile -Command \
430 [System.IO.File]::WriteAllText(\"$@\", \
431 [System.IO.File]::ReadAllText(\"$?\", \
432 [System.Text.Encoding]::GetEncoding(65001)), \
433 [System.Text.Encoding]::GetEncoding(1251))
434
435! ENDIF
436 powershell -nologo -noprofile -Command \
437 $$out = [System.IO.File]::ReadAllText(\"$@\", \
438 [System.Text.Encoding]::GetEncoding(1251)) -replace \
439 'charset=UTF-8', 'charset=CP1251'; \
440 [System.IO.File]::WriteAllText(\"$@\", $$out, \
441 [System.Text.Encoding]::GetEncoding(1251))
442!ENDIF
443 powershell -nologo -noprofile -Command \
444 $$out = [System.IO.File]::ReadAllText(\"$@\", \
445 [System.Text.Encoding]::GetEncoding(1251)) -replace \
446 '# Original translations', \
447 '# Generated from ru.po, DO NOT EDIT'; \
448 [System.IO.File]::WriteAllText(\"$@\", $$out, \
449 [System.Text.Encoding]::GetEncoding(1251))
450
451# Convert uk.po to create uk.cp1251.po.
452uk.cp1251.po: uk.po
453 -$(RM) $@
454!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
455 "$(GETTEXT_PATH)\msgconv.exe" -t CP1251 -o $@ $?
456!ELSE
457! IF DEFINED (ICONV)
458 $(ICONV) -f UTF-8 -t CP1251 $? > $@
459! ELSE
460 powershell -nologo -noprofile -Command \
461 [System.IO.File]::WriteAllText(\"$@\", \
462 [System.IO.File]::ReadAllText(\"$?\", \
463 [System.Text.Encoding]::GetEncoding(65001)), \
464 [System.Text.Encoding]::GetEncoding(1251))
465
466! ENDIF
467 powershell -nologo -noprofile -Command \
468 $$out = [System.IO.File]::ReadAllText(\"$@\", \
469 [System.Text.Encoding]::GetEncoding(1251)) -replace \
470 'charset=UTF-8', 'charset=CP1251'; \
471 [System.IO.File]::WriteAllText(\"$@\", $$out, \
472 [System.Text.Encoding]::GetEncoding(1251))
473!ENDIF
474 powershell -nologo -noprofile -Command \
475 $$out = [System.IO.File]::ReadAllText(\"$@\", \
476 [System.Text.Encoding]::GetEncoding(1251)) -replace \
477 '# Original translations', \
478 '# Generated from uk.po, DO NOT EDIT'; \
479 [System.IO.File]::WriteAllText(\"$@\", $$out, \
480 [System.Text.Encoding]::GetEncoding(1251))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000481
482.po.mo:
Bram Moolenaar01380622015-12-29 16:04:42 +0100483 set OLD_PO_FILE_INPUT=yes
Bram Moolenaar071d4272004-06-13 20:20:40 +0000484 $(MSGFMT) -o $@ $<
485
Bram Moolenaarfa573352020-09-04 13:53:00 +0200486PO_INPUTLIST = \
487 ..\*.c \
488 ..\if_perl.xs \
489 ..\GvimExt\gvimext.cpp \
490 ..\errors.h \
491 ..\globals.h \
492 ..\if_py_both.h \
493 ..\vim.h \
494 gvim.desktop.in \
495 vim.desktop.in
496
Bram Moolenaar167fb6d2023-05-23 15:27:51 +0100497files: $(PO_INPUTLIST)
Bram Moolenaarfa573352020-09-04 13:53:00 +0200498 $(LS) $(LSFLAGS) $(PO_INPUTLIST) > .\files
Bram Moolenaar071d4272004-06-13 20:20:40 +0000499
500first_time: files
RestorerZe2146922023-11-23 20:58:32 +0100501 $(VIM) -u NONE --not-a-term -S tojavascript.vim $(LANGUAGE).po \
502 $(PO_VIM_INPUTLIST)
Bram Moolenaar01380622015-12-29 16:04:42 +0100503 set OLD_PO_FILE_INPUT=yes
504 set OLD_PO_FILE_OUTPUT=yes
RestorerZe2146922023-11-23 20:58:32 +0100505 $(XGETTEXT) --default-domain=$(LANGUAGE) --add-comments $(XGETTEXT_KEYWORDS) \
506 --files-from=.\files $(PO_VIM_JSLIST)
507 $(VIM) -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).po \
508 $(PO_VIM_INPUTLIST)
Bram Moolenaarfa573352020-09-04 13:53:00 +0200509 $(RM) *.js
Bram Moolenaar071d4272004-06-13 20:20:40 +0000510
Bram Moolenaarfa573352020-09-04 13:53:00 +0200511$(PACKAGE).pot: files
RestorerZe2146922023-11-23 20:58:32 +0100512 $(VIM) -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot \
513 $(PO_VIM_INPUTLIST)
Bram Moolenaar01380622015-12-29 16:04:42 +0100514 set OLD_PO_FILE_INPUT=yes
515 set OLD_PO_FILE_OUTPUT=yes
RestorerZe2146922023-11-23 20:58:32 +0100516 $(XGETTEXT) --default-domain=$(PACKAGE) --add-comments $(XGETTEXT_KEYWORDS) \
517 --files-from=.\files $(PO_VIM_JSLIST)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000518 $(MV) $(PACKAGE).po $(PACKAGE).pot
RestorerZe2146922023-11-23 20:58:32 +0100519 $(VIM) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot \
520 $(PO_VIM_INPUTLIST)
Bram Moolenaarfa573352020-09-04 13:53:00 +0200521 $(RM) *.js
522
RestorerZe2146922023-11-23 20:58:32 +0100523# When updating ja.sjis.po there are a bunch of errors and a crash.
524# The files that are converted to a different encoding clearly state "DO NOT EDIT".
525update-po: $(MOFILES:.mo=)
526
Bram Moolenaarfa573352020-09-04 13:53:00 +0200527# Don't add a dependency here, we only want to update the .po files manually
528$(LANGUAGES):
529 @$(MAKE) -nologo -f Make_mvc.mak $(PACKAGE).pot GETTEXT_PATH=$(GETTEXT_PATH)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000530 $(CP) $@.po $@.po.orig
531 $(MV) $@.po $@.po.old
532 $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
533 $(RM) $@.po.old
534
RestorerZe2146922023-11-23 20:58:32 +0100535install: $(LANGUAGE).mo
Bram Moolenaar071d4272004-06-13 20:20:40 +0000536 if not exist $(INSTALLDIR) $(MKD) $(INSTALLDIR)
537 $(CP) $(LANGUAGE).mo $(INSTALLDIR)\$(PACKAGE).mo
538
Bram Moolenaar01380622015-12-29 16:04:42 +0100539install-all: all
RestorerZe2146922023-11-23 20:58:32 +0100540 for %%l in ($(LANGUAGES)) do @if not exist $(VIMRUNTIME)\lang\%%l\LC_MESSAGES \
541 $(MKD) $(VIMRUNTIME)\lang\%%l\LC_MESSAGES
542 for %%l in ($(LANGUAGES)) do @$(CP) %%l.mo \
543 $(VIMRUNTIME)\lang\%%l\LC_MESSAGES\$(PACKAGE).mo
Bram Moolenaar01380622015-12-29 16:04:42 +0100544
RestorerZe2146922023-11-23 20:58:32 +0100545cleanup-po: $(LANGUAGE).po
546 $(VIM) -u NONE -e -X -S cleanup.vim -c wq $**
547
548cleanup-po-all: $(POFILES)
549 !$(VIM) -u NONE -e -X -S cleanup.vim -c wq $**
550
551clean: checkclean
Bram Moolenaar071d4272004-06-13 20:20:40 +0000552 $(RM) *.mo
553 $(RM) *.pot
Bram Moolenaarfa573352020-09-04 13:53:00 +0200554 $(RM) files
RestorerZe2146922023-11-23 20:58:32 +0100555 $(RM) sjiscorr.obj sjiscorr.exe
556# $(RM) big5corr.obj big5corr.exe
557
558# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: