diff options
Diffstat (limited to 'src/po/Makefile')
-rw-r--r-- | src/po/Makefile | 58 |
1 files changed, 44 insertions, 14 deletions
diff --git a/src/po/Makefile b/src/po/Makefile index eebb7ed64e..0f7f85dd17 100644 --- a/src/po/Makefile +++ b/src/po/Makefile @@ -1,18 +1,17 @@ # Makefile for the Vim message translations. -PO_BASEDIR = . # Include stuff found by configure. -include $(PO_BASEDIR)/../auto/config.mk +include ../auto/config.mk # Get LANGUAGES, MOFILES, MOCONVERTED and others. -include $(PO_BASEDIR)/Make_all.mak +include Make_all.mak # Note: ja.sjis, *.cp1250 and zh_CN.cp936 are only for MS-Windows, they are # not installed on Unix. PACKAGE = vim SHELL = /bin/sh -VIMPROG = $(PO_BASEDIR)/../vim +VIMPROG = ../vim # MacOS sed is locale aware, set $LANG to avoid problems. SED = LANG=C sed @@ -41,8 +40,8 @@ converted: $(MOCONVERTED) $(MSGFMTCMD) -o $@ $< .po.ck: - $(VIMPROG) -u NONE --noplugins -e -s -X --cmd "set enc=utf-8" -S check.vim \ - -c "if error == 0 | q | else | num 2 | cq | endif" $< + $(VIMPROG) -u NONE --noplugins -e -s -X --cmd "set enc=utf-8" \ + -S check.vim -c "if error == 0 | q | else | num 2 | cq | endif" $< touch $@ check: $(CHECKFILES) @@ -242,6 +241,7 @@ prefixcheck: clean: checkclean rm -f core core.* *.old.po *.mo *.pot sjiscorr rm -f LINGUAS vim.desktop gvim.desktop tmp_*desktop + rm -f ./allfiles # rm -f big5corr distclean: clean @@ -262,21 +262,25 @@ PO_INPUTLIST = \ $(PACKAGE).pot: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST) # Convert the Vim scripts to (what looks like) Javascript. - $(VIMPROG) -u NONE --not-a-term -S $(PO_BASEDIR)/tojavascript.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST) + $(VIMPROG) -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot \ + $(PO_VIM_INPUTLIST) + @ echo ${PO_INPUTLIST} | tr ' ' '\n' > ./allfiles + @ cat ./vim_to_js >> ./allfiles # Create vim.pot. - $(XGETTEXT) --default-domain=$(PACKAGE) --add-comments \ - $(XGETTEXT_KEYWORDS) $(PO_INPUTLIST) $(PO_VIM_JSLIST) - mv -f $(PACKAGE).po $(PACKAGE).pot + $(XGETTEXT) --default-domain=$(PACKAGE) --output=$(PACKAGE).pot \ + --add-comments $(XGETTEXT_KEYWORDS) --files-from=./allfiles # Fix Vim scripts names, so that "gf" works. - $(VIMPROG) -u NONE --not-a-term -S $(PO_BASEDIR)/fixfilenames.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST) + $(VIMPROG) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot \ + $(PO_VIM_INPUTLIST) # Delete the temporary files. - rm *.js + rm -f *.js ./vim_to_js vim.desktop: vim.desktop.in $(POFILES) echo $(LANGUAGES) | tr " " "\n" |$(SED) -e '/\./d' | sort > LINGUAS $(MSGFMT) --desktop -d . --template vim.desktop.in -o tmp_vim.desktop rm -f LINGUAS - if command -v desktop-file-validate; then desktop-file-validate tmp_vim.desktop; fi + if command -v desktop-file-validate; \ + then desktop-file-validate tmp_vim.desktop; fi mv tmp_vim.desktop vim.desktop # The dependency on vim.desktop is only to avoid the two targets are build at @@ -285,7 +289,8 @@ gvim.desktop: gvim.desktop.in $(POFILES) vim.desktop echo $(LANGUAGES) | tr " " "\n" |$(SED) -e '/\./d' | sort > LINGUAS $(MSGFMT) --desktop -d . --template gvim.desktop.in -o tmp_gvim.desktop rm -f LINGUAS - if command -v desktop-file-validate; then desktop-file-validate tmp_gvim.desktop; fi + if command -v desktop-file-validate; \ + then desktop-file-validate tmp_gvim.desktop; fi mv tmp_gvim.desktop gvim.desktop # Only original translations with default encoding should be updated. @@ -302,3 +307,28 @@ $(LANGUAGES): else \ echo "msgmerge for $@.po failed!"; mv $@.po.old $@.po; \ fi + + +####### +# For translations of plug-ins +####### + +# Preparing the POT file of the plug-in package +POT_PLUGPACKAGE_PATH != pwd +$(PLUGPACKAGE).pot: $(PO_PLUG_INPUTLIST) + $(VIMPROG) -u NONE --not-a-term -S tojavascript.vim \ + $(PLUGPACKAGE).pot $? + $(XGETTEXT) --from-code=UTF-8 --default-domain=$(PLUGPACKAGE) \ + --package-name=$(PLUGPACKAGE) \ + --output-dir=$(POT_PLUGPACKAGE_PATH) \ + --output=$(PLUGPACKAGE).pot --files-from=./vim_to_js + $(VIMPROG) -u NONE --not-a-term -S fixfilenames.vim \ + $(POT_PLUGPACKAGE_PATH)/$(PLUGPACKAGE).pot $? + rm -f *.js ./vim_to_js + +# Converting the PO file of the plug-in package to the binary format of the MO +MO_PLUGPACKAGE_PATH != pwd +$(PLUGPACKAGE).mo: $(PO_PLUGPACKAGE) + $(MSGFMTCMD) -o $(MO_PLUGPACKAGE_PATH)/$@ $< + +# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: |