blob: c04837eed35249aac329fd8121dcae5a0d8abf23 [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
RestorerZcd33faf2024-07-04 17:47:16 +020019VIMPROG = ../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 +020066first_time: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
RestorerZcd33faf2024-07-04 17:47:16 +020067 $(VIMPROG) -u NONE --not-a-term -S tojavascript.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
Bram Moolenaarfa573352020-09-04 13:53:00 +020068 $(XGETTEXT) --default-domain=$(LANGUAGE) \
Bram Moolenaara1d5f9f2023-05-27 13:40:11 +010069 --add-comments $(XGETTEXT_KEYWORDS) $(PO_INPUTLIST) $(PO_VIM_JSLIST)
RestorerZcd33faf2024-07-04 17:47:16 +020070 $(VIMPROG) -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
Bram Moolenaarfa573352020-09-04 13:53:00 +020071 $(RM) *.js
72
73$(PACKAGE).pot: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
RestorerZcd33faf2024-07-04 17:47:16 +020074 $(VIMPROG) -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000075 $(XGETTEXT) --default-domain=$(PACKAGE) \
Bram Moolenaara1d5f9f2023-05-27 13:40:11 +010076 --add-comments $(XGETTEXT_KEYWORDS) $(PO_INPUTLIST) $(PO_VIM_JSLIST)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000077 $(MV) $(PACKAGE).po $(PACKAGE).pot
RestorerZcd33faf2024-07-04 17:47:16 +020078 $(VIMPROG) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
Bram Moolenaarfa573352020-09-04 13:53:00 +020079 $(RM) *.js
80
81# Don't add a dependency here, we only want to update the .po files manually
82$(LANGUAGES):
83 @$(MAKE) -f Make_cyg.mak $(PACKAGE).pot GETTEXT_PATH=$(GETTEXT_PATH)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000084 $(CP) $@.po $@.po.orig
85 $(MV) $@.po $@.po.old
86 $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
87 $(RM) $@.po.old
88
Bram Moolenaara4a29342018-06-24 15:52:56 +020089install: $(MOFILES) $(MOCONVERTED)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000090 for TARGET in $(LANGUAGES); do \
91 $(MKD) $(VIMRUNTIME)/lang/$$TARGET/LC_MESSAGES ; \
92 $(CP) $$TARGET.mo $(VIMRUNTIME)/lang/$$TARGET/LC_MESSAGES/$(PACKAGE).mo ; \
93 done
94
Bram Moolenaar01380622015-12-29 16:04:42 +010095install-all: install
96
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000097clean:
98 $(RM) *.mo
99 $(RM) *.pot