1 # Copyright (C) 1996-1999,2001,2002,2006,2007,2009,2011,2012
2 # Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
5 # The GNU C Library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # The GNU C Library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, see
17 # <http://www.gnu.org/licenses/>.
19 # Makefile for installing libc message catalogs.
23 # Add names of the languages with broken .po files here.
26 # List of languages for which we have message catalogs of translations.
27 ALL_LINGUAS
:= $(filter-out $(BROKEN_LINGUAS
),$(basename $(wildcard *.po
)))
29 # You can override this in configparms or the make command line to limit
30 # the languages which get installed.
32 LINGUAS
:= $(filter $(addsuffix %,$(LINGUAS
)),$(ALL_LINGUAS
))
34 LINGUAS
= $(ALL_LINGUAS
)
37 # Text domain name to install under; must match ../locale/SYS_libc.c string.
40 all: # Make this the default target; it will be defined in Rules.
44 # Pattern for where message catalog object for language % gets installed.
45 mo-installed
= $(inst_msgcatdir
)/%/LC_MESSAGES
/$(domainname
).mo
47 # Files to install: a $(domainname).mo file for each language.
48 install-others
= $(LINGUAS
:%=$(mo-installed
))
53 # Generate the translation template from all the source files.
54 libc.pot
: header.pot libc.pot.files
56 set
`date -R`; disp
="$$6"; \
57 sed
-e
's/VERSION/$(version)/' \
58 -e
"s/DATE/`date +'%Y-%m-%d %H:%M'$$disp`/" \
59 -e
"s/CHARSET/UTF-8/" \
61 egrep
-v
'\.ksh$$' $(word 2,$^
) > $(objdir
)/tmp-libc.pot-files
62 cd ..
; $(XGETTEXT
) --keyword
=_
--keyword
=N_ \
63 --add-comments
=TRANS
--flag
=error
:3:c-format \
64 --flag
=f_print
:2:c-format \
65 --sort-by-file
--omit-header
-E
-n
-d
- \
66 -f
$(objdir
)/tmp-libc.pot-files
>> po
/$@.new
67 egrep
'\.ksh$$' $(word 2,$^
) > $(objdir
)/tmp-libc.pot-files
68 cd ..
; $(XGETTEXT
) --add-comments
=TRANS
--language
=Shell \
69 --sort-by-file
--omit-header
-E
-n
-o po
/$@.new
-j \
70 -f
$(objdir
)/tmp-libc.pot-files po
/$@.new
71 rm $(objdir
)/tmp-libc.pot-files
75 '/\/tst-/d;$(foreach S,[ch] cxx sh ksh bash,$(subst .,\.,/.$S\(.in\)*$$/p;))'
77 # Omit tst-* files, and get only files with the given suffixes.
79 $(..
)scripts
/list-sources.sh .. | sed
-n
$(po-sed-cmd
) > $@.new
82 .SUFFIXES
: .mo .po .pot
84 # Compile the binary message object files from the portable object source
85 # files of translations for each language.
89 # Install the message object files as libc.po in the language directory.
90 $(mo-installed
): %.mo
$(+force); $(do-install
) || exit
0
92 .PHONY
: linguas linguas.mo
93 linguas
: $(ALL_LINGUAS
:=.po
)
94 linguas.mo
: $(ALL_LINGUAS
:=.mo
)
97 rm -f
$(ALL_LINGUAS
:=.mo
)
99 # Copy the PO files from the translation coordinator's repository.
101 podir
= /com
/share
/ftp
/gnu
/po
/maint
/glibc
103 pofiles
:= $(wildcard $(podir
)/*.po
)
111 linguas
: $(pofiles
:$(podir
)/%=%)
112 linguas.mo
: $(pofiles
:$(podir
)/%.po
=%.mo
)