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