| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
include ../auto/config.mk |
| 5 |
|
| 6 |
|
| 7 |
include Make_all.mak |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
PACKAGE = vim |
| 13 |
SHELL = /bin/sh |
| 14 |
VIMPROG = ../vim |
| 15 |
|
| 16 |
|
| 17 |
SED = LANG=C sed |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
XGETTEXT = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes xgettext |
| 26 |
MSGMERGE = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes msgmerge |
| 27 |
|
| 28 |
.SUFFIXES: |
| 29 |
.SUFFIXES: .po .mo .pot .ck |
| 30 |
.PHONY: all install uninstall prefixcheck originals converted check clean \ |
| 31 |
checkclean distclean update-po $(LANGUAGES) |
| 32 |
|
| 33 |
all: $(MOFILES) $(MOCONVERTED) $(MSGFMT_DESKTOP) |
| 34 |
|
| 35 |
originals: $(MOFILES) |
| 36 |
|
| 37 |
converted: $(MOCONVERTED) |
| 38 |
|
| 39 |
.po.mo: |
| 40 |
$(MSGFMTCMD) -o $@ $< |
| 41 |
|
| 42 |
.po.ck: |
| 43 |
$(VIMPROG) -u NONE --noplugins -e -s -X --cmd "set enc=utf-8" \ |
| 44 |
-S check.vim -c "if error == 0 | q | else | num 2 | cq | endif" \ |
| 45 |
$< |
| 46 |
touch $@ |
| 47 |
|
| 48 |
check: $(CHECKFILES) |
| 49 |
|
| 50 |
|
| 51 |
install: $(MOFILES) $(MOCONVERTED) |
| 52 |
@$(MAKE) prefixcheck |
| 53 |
for lang in $(LANGUAGES); do \ |
| 54 |
dir=$(LOCALEDIR)/$$lang/; \ |
| 55 |
if test ! -x "$$dir"; then \ |
| 56 |
mkdir $$dir; chmod 755 $$dir; \ |
| 57 |
fi; \ |
| 58 |
dir=$(LOCALEDIR)/$$lang/LC_MESSAGES; \ |
| 59 |
if test ! -x "$$dir"; then \ |
| 60 |
mkdir $$dir; chmod 755 $$dir; \ |
| 61 |
fi; \ |
| 62 |
if test -r $$lang.mo; then \ |
| 63 |
$(INSTALL_DATA) $$lang.mo $$dir/$(PACKAGE).mo; \ |
| 64 |
chmod $(FILEMOD) $$dir/$(PACKAGE).mo; \ |
| 65 |
fi; \ |
| 66 |
done |
| 67 |
|
| 68 |
uninstall: |
| 69 |
@$(MAKE) prefixcheck |
| 70 |
for cat in $(MOFILES) $(MOCONVERTED); do \ |
| 71 |
cat=`basename $$cat`; \ |
| 72 |
lang=`echo $$cat | $(SED) 's/\$(CATOBJEXT)$$//'`; \ |
| 73 |
rm -f $(LOCALEDIR)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \ |
| 74 |
done |
| 75 |
|
| 76 |
|
| 77 |
tryoutinstall: $(MOFILES) $(MOCONVERTED) |
| 78 |
@$(MAKE) prefixcheck |
| 79 |
for lang in $(LANGUAGES); do \ |
| 80 |
dir=../../runtime/lang/$$lang/; \ |
| 81 |
if test ! -x "$$dir"; then \ |
| 82 |
mkdir $$dir; chmod 755 $$dir; \ |
| 83 |
fi; \ |
| 84 |
dir=../../runtime/lang/$$lang/LC_MESSAGES; \ |
| 85 |
if test ! -x "$$dir"; then \ |
| 86 |
mkdir $$dir; chmod 755 $$dir; \ |
| 87 |
fi; \ |
| 88 |
if test -r $$lang.mo; then \ |
| 89 |
cp $$lang.mo $$dir/$(PACKAGE).mo; \ |
| 90 |
chmod 644 $$dir/$(PACKAGE).mo; \ |
| 91 |
fi; \ |
| 92 |
done |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
nb.po: no.po |
| 98 |
cp no.po nb.po |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
ja.sjis.po: ja.po |
| 104 |
@$(MAKE) sjiscorr |
| 105 |
rm -f $@ |
| 106 |
iconv -f UTF-8 -t CP932 $? | ./sjiscorr > $@ |
| 107 |
|
| 108 |
sjiscorr: sjiscorr.c |
| 109 |
$(CC) -o sjiscorr sjiscorr.c |
| 110 |
|
| 111 |
ja.euc-jp.po: ja.po |
| 112 |
iconv -f UTF-8 -t EUC-JP $? | \ |
| 113 |
$(SED) -e 's/charset=[uU][tT][fF]-8/charset=EUC-JP/' \ |
| 114 |
-e 's/# Original translations/# Generated from $?, DO NOT EDIT/' \ |
| 115 |
> $@ |
| 116 |
|
| 117 |
|
| 118 |
cs.cp1250.po: cs.po |
| 119 |
rm -f $@ |
| 120 |
iconv -f ISO-8859-2 -t CP1250 $? | \ |
| 121 |
$(SED) -e 's/charset=[iI][sS][oO]-8859-2/charset=CP1250/' \ |
| 122 |
-e 's/# Original translations/# Generated from $?, DO NOT EDIT/' \ |
| 123 |
> $@ |
| 124 |
|
| 125 |
|
| 126 |
pl.cp1250.po: pl.po |
| 127 |
rm -f $@ |
| 128 |
iconv -f ISO-8859-2 -t CP1250 $? | \ |
| 129 |
$(SED) -e 's/charset=[iI][sS][oO]-8859-2/charset=CP1250/' \ |
| 130 |
-e 's/# Original translations/# Generated from $?, DO NOT EDIT/' \ |
| 131 |
> $@ |
| 132 |
|
| 133 |
|
| 134 |
pl.UTF-8.po: pl.po |
| 135 |
rm -f $@ |
| 136 |
iconv -f ISO-8859-2 -t UTF-8 $? | \ |
| 137 |
$(SED) -e 's/charset=[iI][sS][oO]-8859-2/charset=UTF-8/' \ |
| 138 |
-e 's/# Original translations/# Generated from $?, DO NOT EDIT/' \ |
| 139 |
> $@ |
| 140 |
|
| 141 |
|
| 142 |
sk.cp1250.po: sk.po |
| 143 |
rm -f $@ |
| 144 |
iconv -f ISO-8859-2 -t CP1250 $? | \ |
| 145 |
$(SED) -e 's/charset=[iI][sS][oO]-8859-2/charset=CP1250/' \ |
| 146 |
-e 's/# Original translations/# Generated from $?, DO NOT EDIT/' \ |
| 147 |
> $@ |
| 148 |
|
| 149 |
|
| 150 |
zh_CN.po: zh_CN.UTF-8.po |
| 151 |
rm -f $@ |
| 152 |
iconv -f UTF-8 -t GB2312 $? | \ |
| 153 |
$(SED) -e 's/charset=[uU][tT][fF]-8/charset=GB2312/' \ |
| 154 |
-e 's/# Original translations/# Generated from $?, DO NOT EDIT/' \ |
| 155 |
> $@ |
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
zh_CN.cp936.po: zh_CN.UTF-8.po |
| 161 |
rm -f $@ |
| 162 |
iconv -f UTF-8 -t CP936 $? | \ |
| 163 |
$(SED) -e 's/charset=[uU][tT][fF]-8/charset=GBK/' \ |
| 164 |
-e 's/# Original translations/# Generated from $?, DO NOT EDIT/' \ |
| 165 |
> $@ |
| 166 |
|
| 167 |
|
| 168 |
zh_TW.po: zh_TW.UTF-8.po |
| 169 |
rm -f $@ |
| 170 |
iconv -f UTF-8 -t BIG5 $? | \ |
| 171 |
$(SED) -e 's/charset=[uU][tT][fF]-8/charset=BIG5/' \ |
| 172 |
-e 's/# Original translations/# Generated from $?, DO NOT EDIT/' \ |
| 173 |
> $@ |
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
ko.po: ko.UTF-8.po |
| 207 |
rm -f $@ |
| 208 |
iconv -f UTF-8 -t EUC-KR $? | \ |
| 209 |
$(SED) -e 's/charset=[uU][tT][fF]-8/charset=EUC-KR/' \ |
| 210 |
-e 's/# Original translations/# Generated from $?, DO NOT EDIT/' \ |
| 211 |
> $@ |
| 212 |
|
| 213 |
|
| 214 |
ru.cp1251.po: ru.po |
| 215 |
rm -f $@ |
| 216 |
iconv -f UTF-8 -t CP1251 $? | \ |
| 217 |
$(SED) -e 's/charset=[uU][tT][fF]-8/charset=CP1251/' \ |
| 218 |
-e 's/# Original translations/# Generated from $?, DO NOT EDIT/' \ |
| 219 |
> $@ |
| 220 |
|
| 221 |
|
| 222 |
uk.cp1251.po: uk.po |
| 223 |
rm -f $@ |
| 224 |
iconv -f UTF-8 -t CP1251 $? | \ |
| 225 |
$(SED) -e 's/charset=[uU][tT][fF]-8/charset=CP1251/' \ |
| 226 |
-e 's/# Original translations/# Generated from $?, DO NOT EDIT/' \ |
| 227 |
> $@ |
| 228 |
|
| 229 |
prefixcheck: |
| 230 |
@if test "x" = "x$(prefix)"; then \ |
| 231 |
echo "******************************************"; \ |
| 232 |
echo " Please use make from the src directory "; \ |
| 233 |
echo "******************************************"; \ |
| 234 |
exit 1; \ |
| 235 |
fi |
| 236 |
|
| 237 |
clean: checkclean |
| 238 |
- rm -f core core.* *.old.po *.mo sjiscorr |
| 239 |
- rm -f LINGUAS vim.desktop gvim.desktop tmp_*desktop |
| 240 |
- rm -f ./allfiles |
| 241 |
|
| 242 |
|
| 243 |
distclean: clean |
| 244 |
|
| 245 |
checkclean: |
| 246 |
rm -f *.ck |
| 247 |
|
| 248 |
PO_INPUTLIST = \ |
| 249 |
../*.c \ |
| 250 |
../if_perl.xs \ |
| 251 |
../GvimExt/gvimext.cpp \ |
| 252 |
../errors.h \ |
| 253 |
../globals.h \ |
| 254 |
../if_py_both.h \ |
| 255 |
../vim.h \ |
| 256 |
gvim.desktop.in \ |
| 257 |
vim.desktop.in |
| 258 |
|
| 259 |
$(PACKAGE).pot: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST) |
| 260 |
# Convert the Vim scripts to (what looks like) Javascript. |
| 261 |
$(VIMPROG) -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot \ |
| 262 |
$(PO_VIM_INPUTLIST) |
| 263 |
@ echo ${PO_INPUTLIST} | tr ' ' '\n' > ./allfiles |
| 264 |
@ cat ./vim_to_js >> ./allfiles |
| 265 |
# Create vim.pot. |
| 266 |
$(XGETTEXT) --default-domain=$(PACKAGE) --output=$(PACKAGE).pot \ |
| 267 |
--add-comments $(XGETTEXT_KEYWORDS) --files-from=./allfiles \ |
| 268 |
--no-location --copyright-holder="$$(date +%Y), The Vim Project" \ |
| 269 |
--package-name=Vim --msgid-bugs-address="[email protected]" |
| 270 |
# Fix Vim scripts names, so that "gf" works. |
| 271 |
$(VIMPROG) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot \ |
| 272 |
$(PO_VIM_INPUTLIST) |
| 273 |
# Delete the temporary files. |
| 274 |
rm -f *.js ./vim_to_js allfiles |
| 275 |
|
| 276 |
vim.desktop: vim.desktop.in $(POFILES) |
| 277 |
echo $(LANGUAGES) | tr " " "\n" |$(SED) -e '/[.]/d' | sort > LINGUAS |
| 278 |
$(MSGFMT) --desktop -d . --template vim.desktop.in -o tmp_vim.desktop |
| 279 |
rm -f LINGUAS |
| 280 |
if command -v desktop-file-validate; \ |
| 281 |
then desktop-file-validate tmp_vim.desktop; fi |
| 282 |
mv tmp_vim.desktop vim.desktop |
| 283 |
cp vim.desktop ../../runtime/ |
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
gvim.desktop: gvim.desktop.in $(POFILES) vim.desktop |
| 288 |
echo $(LANGUAGES) | tr " " "\n" |$(SED) -e '/[.]/d' | sort > LINGUAS |
| 289 |
$(MSGFMT) --desktop -d . --template gvim.desktop.in -o tmp_gvim.desktop |
| 290 |
rm -f LINGUAS |
| 291 |
if command -v desktop-file-validate; \ |
| 292 |
then desktop-file-validate tmp_gvim.desktop; fi |
| 293 |
mv tmp_gvim.desktop gvim.desktop |
| 294 |
cp gvim.desktop ../../runtime/ |
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
update-po: $(MOFILES:.mo=) |
| 299 |
|
| 300 |
|
| 301 |
$(LANGUAGES): |
| 302 |
@$(MAKE) $(PACKAGE).pot |
| 303 |
if test ! -f [email protected]; then cp [email protected] [email protected]; fi |
| 304 |
mv [email protected] [email protected] |
| 305 |
if $(MSGMERGE) [email protected] $(PACKAGE).pot -o [email protected]; then \ |
| 306 |
rm -f [email protected]; \ |
| 307 |
else \ |
| 308 |
echo "msgmerge for [email protected] failed!"; mv [email protected] [email protected]; \ |
| 309 |
fi |
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
POT_PLUGPACKAGE_PATH = $(PWD) |
| 318 |
$(PLUGPACKAGE).pot: $(PO_PLUG_INPUTLIST) |
| 319 |
$(VIMPROG) -u NONE --not-a-term -S tojavascript.vim \ |
| 320 |
$(PLUGPACKAGE).pot $? |
| 321 |
$(XGETTEXT) --from-code=UTF-8 --default-domain=$(PLUGPACKAGE) \ |
| 322 |
--package-name=$(PLUGPACKAGE) \ |
| 323 |
--output-dir=$(POT_PLUGPACKAGE_PATH) \ |
| 324 |
--output=$(PLUGPACKAGE).pot --files-from=./vim_to_js |
| 325 |
$(VIMPROG) -u NONE --not-a-term -S fixfilenames.vim \ |
| 326 |
$(POT_PLUGPACKAGE_PATH)/$(PLUGPACKAGE).pot $? |
| 327 |
rm -f *.js ./vim_to_js |
| 328 |
|
| 329 |
|
| 330 |
MO_PLUGPACKAGE_PATH = $(PWD) |
| 331 |
$(PLUGPACKAGE).mo: $(PO_PLUGPACKAGE) |
| 332 |
$(MSGFMTCMD) -o $(MO_PLUGPACKAGE_PATH)/$@ $? |
| 333 |
|
| 334 |
|