OSDN Git Service

2003-06-26 Paolo Carlini <pcarlini@unitus.it>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / po / Makefile.am
1 ## Makefile for the po subdirectory of the GNU C++ Standard library.
2 ##
3 ## Copyright (C) 2001 Free Software Foundation, Inc.
4 ##
5 ## This file is part of the libstdc++ version 3 distribution.
6 ## Process this file with automake to produce Makefile.in.
7
8 ## This file is part of the GNU ISO C++ Library.  This library is free
9 ## software; you can redistribute it and/or modify it under the
10 ## terms of the GNU General Public License as published by the
11 ## Free Software Foundation; either version 2, or (at your option)
12 ## any later version.
13
14 ## This library is distributed in the hope that it will be useful,
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ## GNU General Public License for more details.
18
19 ## You should have received a copy of the GNU General Public License along
20 ## with this library; see the file COPYING.  If not, write to the Free
21 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
22 ## USA.
23
24 PACKAGE = @PACKAGE@
25 glibcpp_srcdir = @glibcpp_srcdir@
26
27 # Location of installation directories.
28 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
29 locale_installdir = $(DESTDIR)$(datadir)/locale
30 locale_builddir = @glibcpp_localedir@
31
32 # Tell automake that foo.po makes foo.mo
33 SUFFIXES = .po .mo
34
35 LOCALE_IN = @glibcpp_POFILES@
36 LOCALE_OUT = @glibcpp_MOFILES@
37
38 MSGFMT = msgfmt
39
40 # Necessary files.
41 DISTFILES = \
42         Makefile.am Makefile.in string_literals.cc POTFILES.in $(PACKAGE).pot \
43         $(LOCALE_IN) 
44
45 .po.mo:
46         $(MSGFMT) -o $@ $<
47
48 all-local: all-local-@USE_NLS@
49 all-local-no: 
50 all-local-yes: $(LOCALE_OUT) 
51
52 # 'make check' needs the catalogs constructed in build directory.
53 check: check-@USE_NLS@
54 check-no:
55 check-yes:
56         $(mkinstalldirs) $(locale_builddir) 
57         @catalogs='$(LOCALE_OUT)'; \
58         for cat in $$catalogs; do \
59           cat=`basename $$cat`; \
60           lang=`echo $$cat | sed 's/\.mo$$//'`; \
61           install_dir=$(locale_builddir)/$$lang/LC_MESSAGES; \
62           $(mkinstalldirs) $$install_dir; \
63           $(INSTALL_DATA) $$cat $$install_dir/$(PACKAGE).mo; \
64         done 
65
66 # Install rules here. 
67 # Wish install could just `cp -R ./share $(locale_installdir)` ...
68 install-data-local: install-data-local-@USE_NLS@
69 install-data-local-no:
70 install-data-local-yes: all-local-yes
71         $(mkinstalldirs) $(locale_installdir) 
72         @catalogs='$(LOCALE_OUT)'; \
73         for cat in $$catalogs; do \
74           cat=`basename $$cat`; \
75           lang=`echo $$cat | sed 's/\.mo$$//'`; \
76           install_dir=$(locale_installdir)/$$lang/LC_MESSAGES; \
77           $(mkinstalldirs) $$install_dir; \
78           $(INSTALL_DATA) $$cat $$install_dir/$(PACKAGE).mo; \
79         done
80
81 # Maintainence of the .po template file.  This rule is never run automatically,
82 # and updates the source directory.
83 pot:
84         cd $(glibcpp_srcdir); \
85         xgettext --default-domain=$(PACKAGE) --add-comments --c++ --debug \
86           --join-existing -o po/$(PACKAGE).pot --keyword=__N \
87           `grep -r -l '__N(".*")' .`
88
89 # Specify what gets cleaned up on a 'make clean'
90 CLEANFILES = $(LOCALE_OUT)