7
|
1 # Makefile for the Vim message translations.
|
|
2
|
|
3 # TODO make this configurable
|
|
4 # Note: ja.sjis, *.cp1250 and zh_CN.cp936 are only for MS-Windows, they are
|
|
5 # not installed on Unix
|
|
6
|
434
|
7 LANGUAGES = \
|
|
8 af \
|
|
9 ca \
|
|
10 cs \
|
|
11 de \
|
|
12 en_GB \
|
1620
|
13 eo \
|
434
|
14 es \
|
1620
|
15 fi \
|
434
|
16 fr \
|
|
17 ga \
|
|
18 it \
|
|
19 ja \
|
|
20 ko \
|
|
21 no \
|
|
22 pl \
|
|
23 ru \
|
|
24 sk \
|
|
25 sv \
|
|
26 uk \
|
|
27 vi \
|
|
28 zh_CN \
|
|
29 zh_CN.UTF-8 \
|
|
30 zh_TW \
|
492
|
31 zh_TW.UTF-8
|
434
|
32
|
|
33 MOFILES = \
|
|
34 af.mo \
|
|
35 ca.mo \
|
|
36 cs.mo \
|
|
37 de.mo \
|
|
38 en_GB.mo \
|
1620
|
39 eo.mo \
|
434
|
40 es.mo \
|
1620
|
41 fi.mo \
|
434
|
42 fr.mo \
|
|
43 ga.mo \
|
|
44 it.mo \
|
|
45 ja.mo \
|
|
46 ko.mo \
|
|
47 no.mo \
|
|
48 pl.mo \
|
|
49 ru.mo \
|
|
50 sk.mo \
|
|
51 sv.mo \
|
|
52 uk.mo \
|
|
53 vi.mo \
|
|
54 zh_CN.UTF-8.mo \
|
|
55 zh_CN.mo \
|
|
56 zh_TW.UTF-8.mo \
|
492
|
57 zh_TW.mo
|
7
|
58
|
440
|
59 CONVERTED = \
|
|
60 cs.cp1250.mo \
|
|
61 ja.sjis.mo \
|
|
62 pl.cp1250.mo \
|
819
|
63 pl.UTF-8.mo \
|
440
|
64 ru.cp1251.mo \
|
|
65 sk.cp1250.mo \
|
|
66 uk.cp1251.mo \
|
492
|
67 zh_CN.cp936.mo
|
440
|
68
|
|
69 CHECKFILES = \
|
|
70 af.ck \
|
|
71 ca.ck \
|
|
72 cs.ck \
|
|
73 de.ck \
|
|
74 en_GB.ck \
|
1620
|
75 eo.ck \
|
440
|
76 es.ck \
|
1620
|
77 fi.ck \
|
440
|
78 fr.ck \
|
|
79 ga.ck \
|
|
80 it.ck \
|
|
81 ja.ck \
|
|
82 ko.ck \
|
|
83 no.ck \
|
|
84 pl.ck \
|
|
85 ru.ck \
|
|
86 sk.ck \
|
|
87 sv.ck \
|
|
88 uk.ck \
|
|
89 vi.ck \
|
|
90 zh_CN.UTF-8.ck \
|
|
91 zh_CN.ck \
|
|
92 zh_TW.UTF-8.ck \
|
|
93 zh_TW.ck \
|
|
94 cs.cp1250.ck \
|
|
95 ja.sjis.ck \
|
|
96 pl.cp1250.ck \
|
819
|
97 pl.UTF-8.ck \
|
440
|
98 ru.cp1251.ck \
|
|
99 sk.cp1250.ck \
|
|
100 uk.cp1251.ck \
|
492
|
101 zh_CN.cp936.ck
|
440
|
102
|
7
|
103 PACKAGE = vim
|
|
104 SHELL = /bin/sh
|
440
|
105 VIM = ../vim
|
7
|
106
|
|
107 # The OLD_PO_FILE_INPUT and OLD_PO_FILE_OUTPUT are for the new GNU gettext
|
|
108 # tools 0.10.37, which use a slightly different .po file format that is not
|
|
109 # compatible with Solaris (and old gettext implementations) unless these are
|
|
110 # set. gettext 0.10.36 will not work!
|
|
111 MSGFMT = OLD_PO_FILE_INPUT=yes msgfmt -v
|
|
112 XGETTEXT = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes xgettext
|
|
113 MSGMERGE = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes msgmerge
|
|
114
|
|
115 .SUFFIXES:
|
440
|
116 .SUFFIXES: .po .mo .pot .ck
|
|
117 .PHONY: all install uninstall prefixcheck check clean distclean $(LANGUAGES)
|
7
|
118
|
|
119 .po.mo:
|
|
120 $(MSGFMT) -o $@ $<
|
|
121
|
440
|
122 .po.ck:
|
|
123 $(VIM) -u NONE -e -S check.vim -c "if error == 0 | q | endif" -c cq $<
|
|
124 touch $@
|
|
125
|
7
|
126 all: $(MOFILES)
|
|
127
|
440
|
128 check: $(CHECKFILES)
|
|
129
|
7
|
130 install: $(MOFILES)
|
440
|
131 @$(MAKE) prefixcheck
|
7
|
132 for lang in $(LANGUAGES); do \
|
|
133 dir=$(LOCALEDIR)/$$lang/; \
|
|
134 if test ! -x "$$dir"; then \
|
|
135 mkdir $$dir; chmod 755 $$dir; \
|
|
136 fi; \
|
|
137 dir=$(LOCALEDIR)/$$lang/LC_MESSAGES; \
|
|
138 if test ! -x "$$dir"; then \
|
|
139 mkdir $$dir; chmod 755 $$dir; \
|
|
140 fi; \
|
|
141 if test -r $$lang.mo; then \
|
|
142 $(INSTALL_DATA) $$lang.mo $$dir/$(PACKAGE).mo; \
|
|
143 chmod $(FILEMOD) $$dir/$(PACKAGE).mo; \
|
|
144 fi; \
|
|
145 done
|
|
146
|
|
147 uninstall:
|
440
|
148 @$(MAKE) prefixcheck
|
7
|
149 for cat in $(MOFILES); do \
|
|
150 cat=`basename $$cat`; \
|
|
151 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
|
152 rm -f $(LOCALEDIR)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
|
|
153 done
|
|
154
|
440
|
155 converted: $(CONVERTED)
|
7
|
156
|
|
157 # Convert ja.po to create ja.sjis.po. Requires doubling backslashes in the
|
|
158 # second byte. Don't depend on sjiscorr, it should only be compiled when
|
|
159 # ja.sjis.po is outdated.
|
|
160 ja.sjis.po: ja.po
|
|
161 @$(MAKE) sjiscorr
|
|
162 rm -f ja.sjis.po
|
|
163 iconv -f euc-jp -t cp932 ja.po | ./sjiscorr > ja.sjis.po
|
|
164
|
|
165 sjiscorr: sjiscorr.c
|
|
166 $(CC) -o sjiscorr sjiscorr.c
|
|
167
|
|
168 # Convert cs.po to create cs.cp1250.po.
|
|
169 cs.cp1250.po: cs.po
|
|
170 rm -f cs.cp1250.po
|
|
171 iconv -f iso-8859-2 -t cp1250 cs.po | \
|
|
172 sed -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from cs.po, DO NOT EDIT/' > cs.cp1250.po
|
|
173
|
|
174 # Convert pl.po to create pl.cp1250.po.
|
|
175 pl.cp1250.po: pl.po
|
|
176 rm -f pl.cp1250.po
|
|
177 iconv -f iso-8859-2 -t cp1250 pl.po | \
|
|
178 sed -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from pl.po, DO NOT EDIT/' > pl.cp1250.po
|
|
179
|
819
|
180 # Convert pl.po to create pl.UTF-8.po.
|
|
181 pl.UTF-8.po: pl.po
|
|
182 rm -f pl.UTF-8.po
|
|
183 iconv -f iso-8859-2 -t utf-8 pl.po | \
|
|
184 sed -e 's/charset=ISO-8859-2/charset=utf-8/' -e 's/# Original translations/# Generated from pl.po, DO NOT EDIT/' > pl.UTF-8.po
|
|
185
|
7
|
186 # Convert sk.po to create sk.cp1250.po.
|
|
187 sk.cp1250.po: sk.po
|
|
188 rm -f sk.cp1250.po
|
|
189 iconv -f iso-8859-2 -t cp1250 sk.po | \
|
|
190 sed -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from sk.po, DO NOT EDIT/' > sk.cp1250.po
|
|
191
|
|
192 # Convert zh_CN.po to create zh_CN.cp936.po.
|
|
193 # set 'charset' to gbk to avoid that msfmt generates a warning
|
|
194 zh_CN.cp936.po: zh_CN.po
|
|
195 rm -f zh_CN.cp936.po
|
|
196 iconv -f gb2312 -t cp936 zh_CN.po | \
|
|
197 sed -e 's/charset=gb2312/charset=gbk/' -e 's/# Original translations/# Generated from zh_CN.po, DO NOT EDIT/' > zh_CN.cp936.po
|
|
198
|
|
199 # Convert ru.po to create ru.cp1251.po.
|
|
200 ru.cp1251.po: ru.po
|
|
201 rm -f ru.cp1251.po
|
9
|
202 iconv -f utf-8 -t cp1251 ru.po | \
|
|
203 sed -e 's/charset=utf-8/charset=cp1251/' -e 's/# Original translations/# Generated from ru.po, DO NOT EDIT/' > ru.cp1251.po
|
7
|
204
|
23
|
205 # Convert uk.po to create uk.cp1251.po.
|
|
206 uk.cp1251.po: uk.po
|
|
207 rm -f uk.cp1251.po
|
1620
|
208 iconv -f utf-8 -t cp1251 uk.po | \
|
|
209 sed -e 's/charset=utf-8/charset=cp1251/' -e 's/# Original translations/# Generated from uk.po, DO NOT EDIT/' > uk.cp1251.po
|
23
|
210
|
440
|
211 prefixcheck:
|
7
|
212 @if test "x" = "x$(prefix)"; then \
|
|
213 echo "******************************************"; \
|
|
214 echo " please use make from the src directory "; \
|
|
215 echo "******************************************"; \
|
|
216 exit 1; \
|
|
217 fi
|
|
218
|
628
|
219 clean: checkclean
|
|
220 rm -f core core.* *.old.po *.mo *.pot sjiscorr
|
7
|
221
|
|
222 distclean: clean
|
|
223
|
628
|
224 checkclean:
|
|
225 rm -f *.ck
|
|
226
|
7
|
227 #
|
|
228 # NOTE: If you get an error for gvimext.cpp not found, you need to unpack the
|
|
229 # extra archive.
|
|
230 #
|
|
231 $(PACKAGE).pot: ../*.c ../if_perl.xs ../GvimExt/gvimext.cpp ../globals.h
|
|
232 cd ..; $(XGETTEXT) --default-domain=$(PACKAGE) \
|
|
233 --add-comments --keyword=_ --keyword=N_ \
|
|
234 *.c if_perl.xs GvimExt/gvimext.cpp globals.h
|
|
235 mv -f ../$(PACKAGE).po $(PACKAGE).pot
|
|
236
|
|
237 # Don't add a dependency here, we only want to update the .po files manually
|
|
238 $(LANGUAGES):
|
|
239 @$(MAKE) $(PACKAGE).pot
|
|
240 if test ! -f $@.po.orig; then cp $@.po $@.po.orig; fi
|
|
241 mv $@.po $@.po.old
|
|
242 if $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po; then \
|
|
243 rm -f $@.po.old; \
|
|
244 else \
|
|
245 echo "msgmerge for $@.po failed!"; mv $@.po.old $@.po; \
|
|
246 fi
|