#
 # Copyright (c) 1994, Regents of the University of California
 #
-# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.84 2002/08/10 17:59:28 petere Exp $
+# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.85 2002/08/21 20:42:24 petere Exp $
 #
 #-------------------------------------------------------------------------
 
 
 all: submake-libpgport postgres $(POSTGRES_IMP)
        $(MAKE) -C utils/mb/conversion_procs $@
-ifeq ($(enable_nls), yes)
-       $(MAKE) -C po all
-endif
 
 ifneq ($(PORTNAME), win)
 
        $(MAKE) -C parser       gram.c parse.h scan.c
        $(MAKE) -C bootstrap    bootparse.c bootstrap_tokens.h bootscanner.c
        $(MAKE) -C utils/misc   guc-file.c
-ifeq ($(enable_nls), yes)
-       $(MAKE) -C po $@
-endif
+
 
 ##########################################################################
 
        $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample $(DESTDIR)$(datadir)/pg_hba.conf.sample
        $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample $(DESTDIR)$(datadir)/pg_ident.conf.sample
        $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample $(DESTDIR)$(datadir)/postgresql.conf.sample
-ifeq ($(enable_nls), yes)
-       $(MAKE) -C po $@
-endif
        $(MAKE) -C utils/mb $@
        $(MAKE) -C utils/mb/conversion_procs $@
 
 ifeq ($(MAKE_EXPORTS), true)
        $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
 endif
-ifeq ($(enable_nls), yes)
-       $(MAKE) -C po $@
-endif
+
 
 ##########################################################################
 
        rm -f $(DESTDIR)$(datadir)/pg_hba.conf.sample \
              $(DESTDIR)$(datadir)/pg_ident.conf.sample \
              $(DESTDIR)$(datadir)/postgresql.conf.sample
-ifeq ($(enable_nls), yes)
-       $(MAKE) -C po $@
-endif
 
 
 ##########################################################################
 endif
 endif
        for i in $(DIRS); do $(MAKE) -C $$i clean || exit; done
-ifeq ($(enable_nls), yes)
-       $(MAKE) -C po $@
-endif
 
 distclean: clean
        rm -f port/tas.s port/dynloader.c port/pg_sema.c port/pg_shmem.c
              $(srcdir)/parser/scan.c \
              $(srcdir)/parser/parse.h \
              $(srcdir)/utils/misc/guc-file.c
-       $(MAKE) -C po maintainer-clean
 
 
 ##########################################################################
 
--- /dev/null
+CATALOG_NAME   := postgres
+AVAIL_LANGUAGES        := cs de hu ru zh_CN zh_TW
+GETTEXT_FILES  := + gettext-files
+GETTEXT_TRIGGERS:= elog:2 postmaster_error yyerror
+
+gettext-files:
+       find $(srcdir)/ -name '*.c' -print >$@
+
+my-maintainer-clean:
+       rm -f gettext-files
+
+.PHONY: my-maintainer-clean
+maintainer-clean: my-maintainer-clean
 
+++ /dev/null
-# $Header: /cvsroot/pgsql/src/backend/po/Attic/Makefile,v 1.2 2001/09/10 22:25:48 petere Exp $
-
-subdir = src/backend/po
-top_builddir = ../../..
-include $(top_builddir)/src/Makefile.global
-
-
-gettext-files:
-       find $(srcdir)/.. -name '*.c' -print >$@
-
-maintainer-clean:
-       rm -f gettext-files
 
+++ /dev/null
-CATALOG_NAME   := postgres
-AVAIL_LANGUAGES        := cs de hu ru zh_CN zh_TW
-GETTEXT_FILES  := + gettext-files
-GETTEXT_TRIGGERS:= elog:2 postmaster_error yyerror
 
 # German message translation file for pg_dump and friends
 # Peter Eisentraut <peter_e@gmx.net>, 2001.
 #
-# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/de.po,v 1.6 2002/01/29 20:39:49 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_dump/po/de.po,v 1.1 2002/08/21 20:42:25 petere Exp $
 #
 # Use these quotes: »%s«
 #
 
 # Swedish message translation file for pg_dump
 # Peter Eisentraut <peter_e@gmx.net>, 2001.
 #
-# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/sv.po,v 1.1 2001/12/13 22:06:33 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_dump/po/sv.po,v 1.1 2002/08/21 20:42:26 petere Exp $
 #
 # Use these quotes: "%s"
 #
 
 # simplified Chinese translation file for pg_dump and friends
 # Weiping He <laser@zhengmai.com.cn>, 2001.
-# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/zh_CN.po,v 1.5 2001/12/10 18:45:57 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_dump/po/zh_CN.po,v 1.1 2002/08/21 20:42:26 petere Exp $
 #
 msgid ""
 msgstr ""
 
 # Czech message translation file for psql
 # Karel Zak <zakkr@zf.jcu.cz>, August 2001.
 #
-# $Header: /cvsroot/pgsql/src/bin/psql/Attic/cs.po,v 1.3 2002/06/20 20:29:42 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/psql/po/cs.po,v 1.1 2002/08/21 20:42:26 petere Exp $
 #
 msgid ""
 msgstr ""
 
 # German message translation file for psql
 # Peter Eisentraut <peter_e@gmx.net>, 2001.
 #
-# $Header: /cvsroot/pgsql/src/bin/psql/Attic/de.po,v 1.6 2002/06/20 20:29:42 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/psql/po/de.po,v 1.1 2002/08/21 20:42:26 petere Exp $
 #
 # Use these quotes: »%s«
 #
 
 # French message translation file for psql
 # Peter Eisentraut <peter_e@gmx.net>, 2001.
 #
-# $Header: /cvsroot/pgsql/src/bin/psql/Attic/fr.po,v 1.4 2002/06/20 20:29:42 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/psql/po/fr.po,v 1.1 2002/08/21 20:42:26 petere Exp $
 #
 # Use these quotes: «%s»
 #
 
 # PSQL Translated Messages in Russian Language (KOI8-R)
 # Serguei A. Mokhov <stgunya@yahoo.com>, August-September 2001.
 #
-# $Header: /cvsroot/pgsql/src/bin/psql/Attic/ru.po,v 1.5 2002/06/20 20:29:42 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/psql/po/Attic/ru.po,v 1.1 2002/08/21 20:42:26 petere Exp $
 #
 msgid ""
 msgstr ""
 
 # Peter Eisentraut <peter_e@gmx.net>, 2001.
 # Dennis Björklund <db@zigo.dhs.org>, 2002.
 #
-# $Header: /cvsroot/pgsql/src/bin/psql/Attic/sv.po,v 1.4 2002/08/06 21:13:44 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/psql/po/sv.po,v 1.1 2002/08/21 20:42:26 petere Exp $
 #
 # Use these quotes: "%s"
 #
 
 # simplified Chinese translation file for psql
 # Weiping He <laser@zhengmai.com.cn>, 2001.
 #
-# $Header: /cvsroot/pgsql/src/bin/psql/Attic/zh_CN.po,v 1.4 2002/06/20 20:29:42 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/psql/po/Attic/zh_CN.po,v 1.1 2002/08/21 20:42:27 petere Exp $
 #
 msgid ""
 msgstr ""
 
 # German message translation file for libpq
 # Peter Eisentraut <peter_e@gmx.net>, 2001.
 #
-# $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/de.po,v 1.4 2001/11/29 18:59:28 petere Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpq/po/de.po,v 1.1 2002/08/21 20:42:27 petere Exp $
 #
 # Use these quotes: »%s«
 #
 
 # French message translation file for libpq
 # Peter Eisentraut <peter_e@gmx.net>, 2001.
 #
-# $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/fr.po,v 1.2 2001/12/13 22:04:40 petere Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpq/po/fr.po,v 1.1 2002/08/21 20:42:27 petere Exp $
 #
 # Use these quotes: «%s»
 #
 
 # Swedish message translation file for libpq
 # Peter Eisentraut <peter_e@gmx.net>, 2001.
 #
-# $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/sv.po,v 1.1 2001/12/13 22:05:57 petere Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpq/po/sv.po,v 1.1 2002/08/21 20:42:27 petere Exp $
 #
 # Use these quotes: "%s"
 #
 
 # simplified Chinese translation file for libpq
 # Weiping He <laser@zhengmai.com.cn>, 2001
 #
-# $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/zh_CN.po,v 1.3 2001/11/29 18:59:28 petere Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpq/po/zh_CN.po,v 1.1 2002/08/21 20:42:27 petere Exp $
 #
 msgid ""
 msgstr ""
 
-# $Header: /cvsroot/pgsql/src/nls-global.mk,v 1.4 2001/11/29 18:59:28 petere Exp $
+# $Header: /cvsroot/pgsql/src/nls-global.mk,v 1.5 2002/08/21 20:42:24 petere Exp $
 
 # Common rules for Native Language Support (NLS)
 #
 LANGUAGES = $(AVAIL_LANGUAGES)
 endif
 
-PO_FILES = $(addsuffix .po, $(LANGUAGES))
-MO_FILES = $(addsuffix .mo, $(LANGUAGES))
+PO_FILES = $(addprefix po/, $(addsuffix .po, $(LANGUAGES)))
+MO_FILES = $(addprefix po/, $(addsuffix .mo, $(LANGUAGES)))
 
 ifdef XGETTEXT
 XGETTEXT += --foreign-user -ctranslator
 
 all-po: $(MO_FILES)
 
-distprep: $(srcdir)/$(CATALOG_NAME).pot
+distprep: $(srcdir)/po/$(CATALOG_NAME).pot
 
 %.mo: %.po
        $(MSGFMT) -o $@ $<
 
 ifdef XGETTEXT
 ifeq ($(word 1,$(GETTEXT_FILES)),+)
-$(srcdir)/$(CATALOG_NAME).pot: $(word 2, $(GETTEXT_FILES))
+$(srcdir)/po/$(CATALOG_NAME).pot: $(word 2, $(GETTEXT_FILES))
        $(XGETTEXT) -D $(srcdir) -n $(addprefix -k, $(GETTEXT_TRIGGERS)) -f $<
 else
-$(srcdir)/$(CATALOG_NAME).pot: $(GETTEXT_FILES)
+$(srcdir)/po/$(CATALOG_NAME).pot: $(GETTEXT_FILES)
 # Change to srcdir explicitly, don't rely on $^.  That way we get
 # consistent #: file references in the po files.
        $(XGETTEXT) -D $(srcdir) -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $(GETTEXT_FILES)
 
 install-po: all-po installdirs-po
        for lang in $(LANGUAGES); do \
-         $(INSTALL_DATA) $$lang.mo $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(CATALOG_NAME).mo || exit 1; \
+         $(INSTALL_DATA) po/$$lang.mo $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(CATALOG_NAME).mo || exit 1; \
        done
 
 installdirs-po:
 
 clean-po:
        rm -f $(MO_FILES)
-       @rm -f $(addsuffix .po.old, $(AVAIL_LANGUAGES))
+       @rm -f $(addsuffix .old, $(PO_FILES))
 
 maintainer-clean-po: clean-po
-       rm -f $(srcdir)/$(CATALOG_NAME).pot
+       rm -f $(srcdir)/po/$(CATALOG_NAME).pot
 
 
 maintainer-check-po: $(PO_FILES)
        done
 
 
-init-po: $(srcdir)/$(CATALOG_NAME).pot
+init-po: $(srcdir)/po/$(CATALOG_NAME).pot
 
 
-update-po: $(srcdir)/$(CATALOG_NAME).pot
+update-po: $(srcdir)/po/$(CATALOG_NAME).pot
 ifdef MSGMERGE
        @for lang in $(LANGUAGES); do \
          echo "merging $$lang:"; \
-         if $(MSGMERGE) $(srcdir)/$$lang.po $< -o $$lang.po.new; \
+         if $(MSGMERGE) $(srcdir)/po/$$lang.po $< -o po/$$lang.po.new; \
          then \
-           mv $(srcdir)/$$lang.po $$lang.po.old; \
-           mv $$lang.po.new $(srcdir)/$$lang.po; \
+           mv $(srcdir)/po/$$lang.po po/$$lang.po.old; \
+           mv po/$$lang.po.new $(srcdir)/po/$$lang.po; \
          else \
            echo "msgmerge for $$lang failed"; \
-           rm -f $$lang.po.new; \
+           rm -f po/$$lang.po.new; \
          fi; \
        done
 else
 
 .PHONY: all-po install-po installdirs-po uninstall-po clean-po \
         maintainer-clean-po maintainer-check-po init-po update-po
+.SILENT: installdirs-po