1 # Makefile for the Vim message translations.
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
101 # The OLD_PO_FILE_INPUT and OLD_PO_FILE_OUTPUT are for the new GNU gettext
102 # tools 0.10.37, which use a slightly different .po file format that is not
103 # compatible with Solaris (and old gettext implementations) unless these are
104 # set. gettext 0.10.36 will not work!
105 MSGFMT
= OLD_PO_FILE_INPUT
=yes msgfmt
-v
106 XGETTEXT
= OLD_PO_FILE_INPUT
=yes OLD_PO_FILE_OUTPUT
=yes xgettext
107 MSGMERGE
= OLD_PO_FILE_INPUT
=yes OLD_PO_FILE_OUTPUT
=yes msgmerge
110 .SUFFIXES
: .po .mo .pot .ck
111 .PHONY
: all install uninstall prefixcheck
check clean distclean $(LANGUAGES
)
117 $(VIM
) -u NONE
-e
-S
check.vim
-c
"if error == 0 | q | endif" -c cq
$<
126 for lang in
$(LANGUAGES
); do \
127 dir=$(LOCALEDIR
)/$$lang/; \
128 if
test ! -x
"$$dir"; then \
129 mkdir
$$dir; chmod
755 $$dir; \
131 dir=$(LOCALEDIR
)/$$lang/LC_MESSAGES
; \
132 if
test ! -x
"$$dir"; then \
133 mkdir
$$dir; chmod
755 $$dir; \
135 if
test -r
$$lang.mo
; then \
136 $(INSTALL_DATA
) $$lang.mo
$$dir/$(PACKAGE
).mo
; \
137 chmod
$(FILEMOD
) $$dir/$(PACKAGE
).mo
; \
143 for cat in
$(MOFILES
); do \
144 cat
=`basename $$cat`; \
145 lang
=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
146 rm -f
$(LOCALEDIR
)/$$lang/LC_MESSAGES
/$(PACKAGE
).mo
; \
149 converted
: $(CONVERTED
)
151 # Convert ja.po to create ja.sjis.po. Requires doubling backslashes in the
152 # second byte. Don't depend on sjiscorr, it should only be compiled when
153 # ja.sjis.po is outdated.
157 iconv
-f euc-jp
-t cp932 ja.po | .
/sjiscorr
> ja.sjis.po
160 $(CC
) -o sjiscorr sjiscorr.c
162 # Convert cs.po to create cs.cp1250.po.
165 iconv
-f iso-8859-2
-t cp1250 cs.po | \
166 sed
-e
's/charset=ISO-8859-2/charset=cp1250/' -e
's/# Original translations/# Generated from cs.po, DO NOT EDIT/' > cs.cp1250.po
168 # Convert pl.po to create pl.cp1250.po.
171 iconv
-f iso-8859-2
-t cp1250 pl.po | \
172 sed
-e
's/charset=ISO-8859-2/charset=cp1250/' -e
's/# Original translations/# Generated from pl.po, DO NOT EDIT/' > pl.cp1250.po
174 # Convert pl.po to create pl.UTF-8.po.
177 iconv
-f iso-8859-2
-t utf-8 pl.po | \
178 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
180 # Convert sk.po to create sk.cp1250.po.
183 iconv
-f iso-8859-2
-t cp1250 sk.po | \
184 sed
-e
's/charset=ISO-8859-2/charset=cp1250/' -e
's/# Original translations/# Generated from sk.po, DO NOT EDIT/' > sk.cp1250.po
186 # Convert zh_CN.po to create zh_CN.cp936.po.
187 # set 'charset' to gbk to avoid that msfmt generates a warning
188 zh_CN.cp936.po
: zh_CN.po
190 iconv
-f gb2312
-t cp936 zh_CN.po | \
191 sed
-e
's/charset=gb2312/charset=gbk/' -e
's/# Original translations/# Generated from zh_CN.po, DO NOT EDIT/' > zh_CN.cp936.po
193 # Convert ru.po to create ru.cp1251.po.
196 iconv
-f utf-8
-t cp1251 ru.po | \
197 sed
-e
's/charset=utf-8/charset=cp1251/' -e
's/# Original translations/# Generated from ru.po, DO NOT EDIT/' > ru.cp1251.po
199 # Convert uk.po to create uk.cp1251.po.
202 iconv
-f koi8-u
-t cp1251 uk.po | \
203 sed
-e
's/charset=koi8-u/charset=cp1251/' -e
's/# Original translations/# Generated from uk.po, DO NOT EDIT/' > uk.cp1251.po
206 @if
test "x" = "x$(prefix)"; then \
207 echo
"******************************************"; \
208 echo
" please use make from the src directory "; \
209 echo
"******************************************"; \
214 rm -f core core.
* *.old.po
*.mo
*.pot sjiscorr
222 # NOTE: If you get an error for gvimext.cpp not found, you need to unpack the
225 $(PACKAGE
).pot
: ..
/*.c ..
/if_perl.xs ..
/GvimExt
/gvimext.
cpp ..
/globals.h
226 cd ..
; $(XGETTEXT
) --default-domain
=$(PACKAGE
) \
227 --add-comments
--keyword
=_
--keyword
=N_ \
228 *.c if_perl.xs GvimExt
/gvimext.
cpp globals.h
229 mv
-f ..
/$(PACKAGE
).po
$(PACKAGE
).pot
231 # Don't add a dependency here, we only want to update the .po files manually
233 @
$(MAKE
) $(PACKAGE
).pot
234 if
test ! -f
$@.po.orig
; then cp
$@.po
$@.po.orig
; fi
236 if
$(MSGMERGE
) $@.po.old
$(PACKAGE
).pot
-o
$@.po
; then \
239 echo
"msgmerge for $@.po failed!"; mv
$@.po.old
$@.po
; \