blob: 3f853016f386c14356f3a7f27ad720bf6af1feca [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
19
20# Uncomment one of the lines below or modify it to put the path to your
Bram Moolenaar5eba4c22005-07-12 22:40:29 +000021# gettext binaries
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000022ifndef GETTEXT_PATH
23#GETTEXT_PATH = C:/gettext.win32/bin/
24#GETTEXT_PATH = C:/gettext-0.10.35-w32/win32/Release/
25GETTEXT_PATH = /bin/
26endif
27
Bram Moolenaar5eba4c22005-07-12 22:40:29 +000028# The OLD_PO_FILE_INPUT and OLD_PO_FILE_OUTPUT are for the new GNU gettext
29# tools 0.10.37, which use a slightly different .po file format that is not
30# compatible with Solaris (and old gettext implementations) unless these are
31# set. gettext 0.10.36 will not work!
32MSGFMT = OLD_PO_FILE_INPUT=yes $(GETTEXT_PATH)msgfmt -v
33XGETTEXT = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes $(GETTEXT_PATH)xgettext
34MSGMERGE = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes $(GETTEXT_PATH)msgmerge
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000035
36# MV = move
37# CP = copy
38# RM = del
39# MKD = mkdir
40MV = mv -f
41CP = cp -f
42RM = rm -f
43MKD = mkdir -p
44
45.SUFFIXES:
46.SUFFIXES: .po .mo .pot
47.PHONY: first_time all install clean $(LANGUAGES)
48
49.po.mo:
50 $(MSGFMT) -o $@ $<
51
Bram Moolenaara4a29342018-06-24 15:52:56 +020052all: $(MOFILES) $(MOCONVERTED)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000053
54first_time:
55 $(XGETTEXT) --default-domain=$(LANGUAGE) \
Bram Moolenaarc36651b2018-04-29 12:22:56 +020056 --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(wildcard ../*.c) ../if_perl.xs ../GvimExt/gvimext.cpp $(wildcard ../globals.h) ../if_py_both.h ../vim.h
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000057
58$(LANGUAGES):
59 $(XGETTEXT) --default-domain=$(PACKAGE) \
Bram Moolenaarc36651b2018-04-29 12:22:56 +020060 --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(wildcard ../*.c) ../if_perl.xs ../GvimExt/gvimext.cpp $(wildcard ../globals.h) ../if_py_both.h ../vim.h
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000061 $(MV) $(PACKAGE).po $(PACKAGE).pot
62 $(CP) $@.po $@.po.orig
63 $(MV) $@.po $@.po.old
64 $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
65 $(RM) $@.po.old
66
Bram Moolenaara4a29342018-06-24 15:52:56 +020067install: $(MOFILES) $(MOCONVERTED)
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000068 for TARGET in $(LANGUAGES); do \
69 $(MKD) $(VIMRUNTIME)/lang/$$TARGET/LC_MESSAGES ; \
70 $(CP) $$TARGET.mo $(VIMRUNTIME)/lang/$$TARGET/LC_MESSAGES/$(PACKAGE).mo ; \
71 done
72
Bram Moolenaar01380622015-12-29 16:04:42 +010073install-all: install
74
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000075clean:
76 $(RM) *.mo
77 $(RM) *.pot
78
79