1# Makefile for the Vim message translations. 2 3# Include stuff found by configure. 4include ../auto/config.mk 5 6# get LANGUAGES, MOFILES, MOCONVERTED and CHECKFILES 7include Make_all.mak 8 9# Note: ja.sjis, *.cp1250 and zh_CN.cp936 are only for MS-Windows, they are 10# not installed on Unix 11 12PACKAGE = vim 13SHELL = /bin/sh 14VIM = ../vim 15 16# The OLD_PO_FILE_INPUT and OLD_PO_FILE_OUTPUT are for the new GNU gettext 17# tools 0.10.37, which use a slightly different .po file format that is not 18# compatible with Solaris (and old gettext implementations) unless these are 19# set. gettext 0.10.36 will not work! 20MSGFMTCMD = OLD_PO_FILE_INPUT=yes $(MSGFMT) -v 21XGETTEXT = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes xgettext 22MSGMERGE = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes msgmerge 23 24.SUFFIXES: 25.SUFFIXES: .po .mo .pot .ck 26.PHONY: all install uninstall prefixcheck converted check clean checkclean distclean update-po $(LANGUAGES) 27 28LINGUAS: 29 @echo $(LANGUAGES) | tr " " "\n" |sed -e '/\./d' | sort > LINGUAS 30 31.po.mo: 32 $(MSGFMTCMD) -o $@ $< 33 34.po.ck: 35 $(VIM) -u NONE -e -X -S check.vim -c "if error == 0 | q | endif" -c cq $< 36 touch $@ 37 38all: $(MOFILES) $(MOCONVERTED) gvim.desktop vim.desktop 39 40check: $(CHECKFILES) 41 42install: $(MOFILES) $(MOCONVERTED) 43 @$(MAKE) prefixcheck 44 for lang in $(LANGUAGES); do \ 45 dir=$(LOCALEDIR)/$$lang/; \ 46 if test ! -x "$$dir"; then \ 47 mkdir $$dir; chmod 755 $$dir; \ 48 fi; \ 49 dir=$(LOCALEDIR)/$$lang/LC_MESSAGES; \ 50 if test ! -x "$$dir"; then \ 51 mkdir $$dir; chmod 755 $$dir; \ 52 fi; \ 53 if test -r $$lang.mo; then \ 54 $(INSTALL_DATA) $$lang.mo $$dir/$(PACKAGE).mo; \ 55 chmod $(FILEMOD) $$dir/$(PACKAGE).mo; \ 56 fi; \ 57 done 58 59uninstall: 60 @$(MAKE) prefixcheck 61 for cat in $(MOFILES) $(MOCONVERTED); do \ 62 cat=`basename $$cat`; \ 63 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ 64 rm -f $(LOCALEDIR)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \ 65 done 66 67converted: $(MOCONVERTED) 68 69# nl.po was added later, if it does not exist use a file with just a # in it 70# (an empty file doesn't work with old msgfmt). 71nl.po: 72 @( echo \# > nl.po ) 73 74# Norwegian/Bokmal: "nb" is an alias for "no". 75# Copying the file is not efficient, but I don't know of another way to make 76# this work. 77nb.po: no.po 78 cp no.po nb.po 79 80# Convert ja.po to create ja.sjis.po. Requires doubling backslashes in the 81# second byte. Don't depend on sjiscorr, it should only be compiled when 82# ja.sjis.po is outdated. 83ja.sjis.po: ja.po 84 @$(MAKE) sjiscorr 85 rm -f ja.sjis.po 86 iconv -f utf-8 -t cp932 ja.po | ./sjiscorr > ja.sjis.po 87 88sjiscorr: sjiscorr.c 89 $(CC) -o sjiscorr sjiscorr.c 90 91ja.euc-jp.po: ja.po 92 iconv -f utf-8 -t euc-jp ja.po | \ 93 sed -e 's/charset=[uU][tT][fF]-8/charset=euc-jp/' -e 's/# Original translations/# Generated from ja.po, DO NOT EDIT/' > ja.euc-jp.po 94 95# Convert cs.po to create cs.cp1250.po. 96cs.cp1250.po: cs.po 97 rm -f cs.cp1250.po 98 iconv -f iso-8859-2 -t cp1250 cs.po | \ 99 sed -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from cs.po, DO NOT EDIT/' > cs.cp1250.po 100 101# Convert pl.po to create pl.cp1250.po. 102pl.cp1250.po: pl.po 103 rm -f pl.cp1250.po 104 iconv -f iso-8859-2 -t cp1250 pl.po | \ 105 sed -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from pl.po, DO NOT EDIT/' > pl.cp1250.po 106 107# Convert pl.po to create pl.UTF-8.po. 108pl.UTF-8.po: pl.po 109 rm -f pl.UTF-8.po 110 iconv -f iso-8859-2 -t utf-8 pl.po | \ 111 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 112 113# Convert sk.po to create sk.cp1250.po. 114sk.cp1250.po: sk.po 115 rm -f sk.cp1250.po 116 iconv -f iso-8859-2 -t cp1250 sk.po | \ 117 sed -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from sk.po, DO NOT EDIT/' > sk.cp1250.po 118 119# Convert zh_CN.UTF-8.po to create zh_CN.cp936.po. 120# Set 'charset' to gbk to avoid that msfmt generates a warning. 121# This used to convert from zh_CN.po, but that results in a conversion error. 122zh_CN.cp936.po: zh_CN.UTF-8.po 123 rm -f zh_CN.cp936.po 124 iconv -f UTF-8 -t cp936 zh_CN.UTF-8.po | \ 125 sed -e 's/charset=[uU][tT][fF]-8/charset=gbk/' -e 's/# Original translations/# Generated from zh_CN.UTF-8.po, DO NOT EDIT/' > zh_CN.cp936.po 126 127# Convert ko.UTF-8.po to create ko.po. 128ko.po: ko.UTF-8.po 129 rm -f ko.po 130 iconv -f UTF-8 -t euc-kr ko.UTF-8.po | \ 131 sed -e 's/charset=UTF-8/charset=euc-kr/' \ 132 -e 's/# Korean translation for Vim/# Generated from ko.UTF-8.po, DO NOT EDIT/' \ 133 > ko.po 134 135# Convert ru.po to create ru.cp1251.po. 136ru.cp1251.po: ru.po 137 rm -f ru.cp1251.po 138 iconv -f utf-8 -t cp1251 ru.po | \ 139 sed -e 's/charset=[uU][tT][fF]-8/charset=cp1251/' -e 's/# Original translations/# Generated from ru.po, DO NOT EDIT/' > ru.cp1251.po 140 141# Convert uk.po to create uk.cp1251.po. 142uk.cp1251.po: uk.po 143 rm -f uk.cp1251.po 144 iconv -f utf-8 -t cp1251 uk.po | \ 145 sed -e 's/charset=[uU][tT][fF]-8/charset=cp1251/' -e 's/# Original translations/# Generated from uk.po, DO NOT EDIT/' > uk.cp1251.po 146 147prefixcheck: 148 @if test "x" = "x$(prefix)"; then \ 149 echo "******************************************"; \ 150 echo " please use make from the src directory "; \ 151 echo "******************************************"; \ 152 exit 1; \ 153 fi 154 155clean: checkclean 156 rm -f core core.* *.old.po *.mo *.pot sjiscorr 157 158distclean: clean 159 160checkclean: 161 rm -f *.ck 162 163$(PACKAGE).pot: ../*.c ../if_perl.xs ../GvimExt/gvimext.cpp ../globals.h ../if_py_both.h ../vim.h gvim.desktop.in vim.desktop.in 164 cd ..; $(XGETTEXT) --default-domain=$(PACKAGE) \ 165 --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 \ 166 *.c if_perl.xs GvimExt/gvimext.cpp globals.h if_py_both.h vim.h \ 167 po/gvim.desktop.in po/vim.desktop.in 168 mv -f ../$(PACKAGE).po $(PACKAGE).pot 169 170%.desktop: %.desktop.in $(PACKAGE).pot LINGUAS 171 $(MSGFMT) --desktop -d . --template $< -o $@ 172 cp -f $@ ../../runtime/$@ 173 174update-po: $(LANGUAGES) 175 176# Don't add a dependency here, we only want to update the .po files manually 177$(LANGUAGES): 178 @$(MAKE) $(PACKAGE).pot 179 if test ! -f $@.po.orig; then cp $@.po $@.po.orig; fi 180 mv $@.po $@.po.old 181 if $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po; then \ 182 rm -f $@.po.old; \ 183 else \ 184 echo "msgmerge for [email protected] failed!"; mv $@.po.old $@.po; \ 185 fi 186