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