blob: 0fe7f92952eeb140c09cb6931055494e3c442b9c [file] [log] [blame]
Bram Moolenaar0dc065e2005-07-04 22:49:24 +00001# Makefile for the Vim message translations for Cygwin
2# by Tony Mechelynck <antoine.mechelynck@skynet.be>
3# after Make_ming.mak by
4# Eduardo F. Amatria <eferna1@platea.pntic.mec.es>
5#
6# Read the README_ming.txt file before using it.
7#
8# Use at your own risk but with care, it could even kill your canary.
9#
10
11ifndef VIMRUNTIME
12VIMRUNTIME = ../../runtime
13endif
14
Bram Moolenaara4a29342018-06-24 15:52:56 +020015# get LANGUAGES, MOFILES and MOCONVERTED
16include Make_all.mak
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000017
18PACKAGE = vim
Bram Moolenaarfa573352020-09-04 13:53:00 +020019VIM = ../vim
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000020
21# Uncomment one of the lines below or modify it to put the path to your
Bram Moolenaar5eba4c22005-07-12 22:40:29 +000022# gettext binaries
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000023ifndef GETTEXT_PATH
24#GETTEXT_PATH = C:/gettext.win32/bin/
25#GETTEXT_PATH = C:/gettext-0.10.35-w32/win32/Release/
26GETTEXT_PATH = /bin/
27endif
28
Bram Moolenaar5eba4c22005-07-12 22:40:29 +000029# The OLD_PO_FILE_INPUT and OLD_PO_FILE_OUTPUT are for the new GNU gettext
30# tools 0.10.37, which use a slightly different .po file format that is not
31# compatible with Solaris (and old gettext implementations) unless these are
32# set. gettext 0.10.36 will not work!
33MSGFMT = OLD_PO_FILE_INPUT=yes $(GETTEXT_PATH)msgfmt -v
34XGETTEXT = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes $(GETTEXT_PATH)xgettext
35MSGMERGE = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes $(GETTEXT_PATH)msgmerge
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000036
37# MV = move
38# CP = copy
39# RM = del
40# MKD = mkdir
41MV = mv -f
42CP = cp -f
43RM = rm -f
44MKD = mkdir -p
45
46.SUFFIXES:
47.SUFFIXES: .po .mo .pot
Bram Moolenaarfa573352020-09-04 13:53:00 +020048.PHONY: first_time all install install-all clean $(LANGUAGES)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000049
50.po.mo:
51 $(MSGFMT) -o $@ $<
52
Bram Moolenaara4a29342018-06-24 15:52:56 +020053all: $(MOFILES) $(MOCONVERTED)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000054
Bram Moolenaarfa573352020-09-04 13:53:00 +020055PO_INPUTLIST = \
56 $(wildcard ../*.c) \
57 ../if_perl.xs \
58 ../GvimExt/gvimext.cpp \
59 ../errors.h \
60 ../globals.h \
61 ../if_py_both.h \
62 ../vim.h \
63 gvim.desktop.in \
64 vim.desktop.in
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000065
Bram Moolenaarfa573352020-09-04 13:53:00 +020066PO_VIM_INPUTLIST = \
67 ../../runtime/optwin.vim
68
69PO_VIM_JSLIST = \
70 optwin.js
71
72first_time: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
73 $(VIM) -u NONE --not-a-term -S tojavascript.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
74 $(XGETTEXT) --default-domain=$(LANGUAGE) \
75 --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(PO_INPUTLIST) $(PO_VIM_JSLIST)
76 $(VIM) -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
77 $(RM) *.js
78
79$(PACKAGE).pot: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
80 $(VIM) -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000081 $(XGETTEXT) --default-domain=$(PACKAGE) \
Bram Moolenaarfa573352020-09-04 13:53:00 +020082 --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(PO_INPUTLIST) $(PO_VIM_JSLIST)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000083 $(MV) $(PACKAGE).po $(PACKAGE).pot
Bram Moolenaarfa573352020-09-04 13:53:00 +020084 $(VIM) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
85 $(RM) *.js
86
87# Don't add a dependency here, we only want to update the .po files manually
88$(LANGUAGES):
89 @$(MAKE) -f Make_cyg.mak $(PACKAGE).pot GETTEXT_PATH=$(GETTEXT_PATH)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000090 $(CP) $@.po $@.po.orig
91 $(MV) $@.po $@.po.old
92 $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
93 $(RM) $@.po.old
94
Bram Moolenaara4a29342018-06-24 15:52:56 +020095install: $(MOFILES) $(MOCONVERTED)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000096 for TARGET in $(LANGUAGES); do \
97 $(MKD) $(VIMRUNTIME)/lang/$$TARGET/LC_MESSAGES ; \
98 $(CP) $$TARGET.mo $(VIMRUNTIME)/lang/$$TARGET/LC_MESSAGES/$(PACKAGE).mo ; \
99 done
100
Bram Moolenaar01380622015-12-29 16:04:42 +0100101install-all: install
102
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000103clean:
104 $(RM) *.mo
105 $(RM) *.pot