Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 | |
Bram Moolenaar | a3ffd9c | 2005-07-21 21:03:15 +0000 | [diff] [blame] | 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 \ |
Bram Moolenaar | 7862282 | 2005-08-23 21:00:13 +0000 | [diff] [blame] | 29 | zh_TW.UTF-8 |
Bram Moolenaar | a3ffd9c | 2005-07-21 21:03:15 +0000 | [diff] [blame] | 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 \ |
Bram Moolenaar | 7862282 | 2005-08-23 21:00:13 +0000 | [diff] [blame] | 53 | zh_TW.mo |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 54 | |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 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 \ |
Bram Moolenaar | 7862282 | 2005-08-23 21:00:13 +0000 | [diff] [blame] | 62 | zh_CN.cp936.mo |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 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 \ |
Bram Moolenaar | 7862282 | 2005-08-23 21:00:13 +0000 | [diff] [blame] | 93 | zh_CN.cp936.ck |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 94 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 95 | PACKAGE = vim |
| 96 | SHELL = /bin/sh |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 97 | VIM = ../vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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: |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 108 | .SUFFIXES: .po .mo .pot .ck |
| 109 | .PHONY: all install uninstall prefixcheck check clean distclean $(LANGUAGES) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 110 | |
| 111 | .po.mo: |
| 112 | $(MSGFMT) -o $@ $< |
| 113 | |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 114 | .po.ck: |
| 115 | $(VIM) -u NONE -e -S check.vim -c "if error == 0 | q | endif" -c cq $< |
| 116 | touch $@ |
| 117 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 118 | all: $(MOFILES) |
| 119 | |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 120 | check: $(CHECKFILES) |
| 121 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 122 | install: $(MOFILES) |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 123 | @$(MAKE) prefixcheck |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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: |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 140 | @$(MAKE) prefixcheck |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 | |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 147 | converted: $(CONVERTED) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 190 | |
Bram Moolenaar | 15d0a8c | 2004-09-06 17:44:46 +0000 | [diff] [blame] | 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 | |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 197 | prefixcheck: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 | |
Bram Moolenaar | 316059c | 2006-01-14 21:18:42 +0000 | [diff] [blame^] | 205 | clean: checkclean |
| 206 | rm -f core core.* *.old.po *.mo *.pot sjiscorr |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 207 | |
| 208 | distclean: clean |
| 209 | |
Bram Moolenaar | 316059c | 2006-01-14 21:18:42 +0000 | [diff] [blame^] | 210 | checkclean: |
| 211 | rm -f *.ck |
| 212 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |