summaryrefslogtreecommitdiff
path: root/i18n/Makefile.am
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2000-01-25 07:42:51 +0000
committerPaul Smith <psmith@gnu.org>2000-01-25 07:42:51 +0000
commitde2a8fc730d0b87cd19959ba876ffa34d0853dcd (patch)
tree926e855867dbb2b79b5e5fe6050ec3154f35e50e /i18n/Makefile.am
parent447c76f601fc1dedfd8e9cc333b8e576b96d1d0c (diff)
downloadgunmake-de2a8fc730d0b87cd19959ba876ffa34d0853dcd.tar.gz
* Updated gettext to use more advanced libit 0.7 version.
* Various cleanups.
Diffstat (limited to 'i18n/Makefile.am')
-rw-r--r--i18n/Makefile.am75
1 files changed, 75 insertions, 0 deletions
diff --git a/i18n/Makefile.am b/i18n/Makefile.am
new file mode 100644
index 0000000..b6a224d
--- /dev/null
+++ b/i18n/Makefile.am
@@ -0,0 +1,75 @@
+# Makefile for PO directories.
+# François Pinard <pinard@iro.umontreal.ca>, 1998.
+
+AUTOMAKE_OPTIONS = gnits
+
+localedir = $(prefix)/share/locale
+
+ALL_POFILES = @ALL_POFILES@
+ALL_MOFILES = @ALL_MOFILES@
+MOFILES = @MOFILES@
+
+EXTRA_DIST = $(PACKAGE).pot $(ALL_POFILES) $(ALL_MOFILES)
+
+MSGFMT = msgfmt
+MSGMERGE = msgmerge
+XGETTEXT = xgettext
+
+SUFFIXES = .po .pox .mo
+
+.po.pox:
+ $(MAKE) $(PACKAGE).pot
+ $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
+
+.po.mo:
+ file=$(srcdir)/`echo $* | sed 's,.*/,,'`.mo \
+ && rm -f $$file && $(MSGFMT) -o $$file $<
+
+all: $(ALL_MOFILES)
+
+install-data-local: $(MOFILES)
+if USE_NLS
+ files='$(MOFILES)'; \
+ for file in $$files; do \
+ base=`basename $$file`; \
+ langdir=$(localedir)/`echo $$base | sed 's/\.mo$$//'`/LC_MESSAGES; \
+ $(mkinstalldirs) $$langdir; \
+ echo " $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$$langdir/$(PACKAGE).mo"; \
+ $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$$langdir/$(PACKAGE).mo; \
+ done
+endif
+
+uninstall-local:
+if USE_NLS
+ files='$(MOFILES)'; \
+ for file in $$files; do \
+ base=`basename $$file`; \
+ langdir=$(localedir)/`echo $$base | sed 's/\.mo$$//'`/LC_MESSAGES; \
+ rm -f $(DESTDIR)$$langdir/$(PACKAGE).mo; \
+ done
+endif
+
+MAINTAINER_CLEAN = $(PACKAGE).pot $(MOFILES)
+
+$(srcdir)/$(PACKAGE).pot: $(top_srcdir)/stamp-pot
+ $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
+ --add-comments --keyword=_ --keyword=N_ `cat $(top_srcdir)/stamp-pot`
+ test ! -f $(PACKAGE).po || ( rm -f $@ && mv $(PACKAGE).po $@ )
+
+update-po: Makefile
+ $(MAKE) $(PACKAGE).pot
+ files='$(ALL_MOFILES)'; \
+ for file in $$files; do \
+ base=`basename $$file`; \
+ lang=`echo $$base | sed 's/\.mo$$//'`; \
+ mv $(srcdir)/$$lang.po $(srcdir)/$$lang.old.po; \
+ echo "$$lang:"; \
+ cd $(srcdir) \
+ && if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
+ rm -f $$lang.old.po; \
+ else \
+ echo "msgmerge for $$file failed!"; \
+ rm -f $$lang.po; \
+ mv $$lang.old.po $$lang.po; \
+ fi; \
+ done