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