]>
Commit | Line | Data |
---|---|---|
a4300c7a | 1 | # Copyright (C) 1996-1999,2001,2002,2006,2007,2009,2011,2012 |
9de06f3c | 2 | # Free Software Foundation, Inc. |
ce4d8b66 RM |
3 | # This file is part of the GNU C Library. |
4 | ||
5 | # The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
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. | |
ce4d8b66 RM |
9 | |
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 | |
41bdb6e2 | 13 | # Lesser General Public License for more details. |
ce4d8b66 | 14 | |
41bdb6e2 | 15 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
16 | # License along with the GNU C Library; if not, see |
17 | # <http://www.gnu.org/licenses/>. | |
0c5ecdc4 UD |
18 | |
19 | # Makefile for installing libc message catalogs. | |
ce4d8b66 RM |
20 | |
21 | subdir := po | |
22 | ||
bf1097cb | 23 | # Add names of the languages with broken .po files here. |
9de06f3c | 24 | BROKEN_LINGUAS = |
c5196097 | 25 | |
ce4d8b66 | 26 | # List of languages for which we have message catalogs of translations. |
c5196097 | 27 | ALL_LINGUAS := $(filter-out $(BROKEN_LINGUAS),$(basename $(wildcard *.po))) |
ce4d8b66 RM |
28 | |
29 | # You can override this in configparms or the make command line to limit | |
30 | # the languages which get installed. | |
31 | ifdef LINGUAS | |
32 | LINGUAS := $(filter $(addsuffix %,$(LINGUAS)),$(ALL_LINGUAS)) | |
33 | else | |
34 | LINGUAS = $(ALL_LINGUAS) | |
35 | endif | |
36 | ||
37 | # Text domain name to install under; must match ../locale/SYS_libc.c string. | |
8ca5c11b | 38 | domainname = libc |
ce4d8b66 | 39 | |
c4029823 UD |
40 | all: # Make this the default target; it will be defined in Rules. |
41 | ||
ce4d8b66 | 42 | include ../Makeconfig |
ce4d8b66 RM |
43 | |
44 | # Pattern for where message catalog object for language % gets installed. | |
4a33c2f5 | 45 | mo-installed = $(inst_msgcatdir)/%/LC_MESSAGES/$(domainname).mo |
ce4d8b66 RM |
46 | |
47 | # Files to install: a $(domainname).mo file for each language. | |
48 | install-others = $(LINGUAS:%=$(mo-installed)) | |
49 | ||
ce4d8b66 | 50 | |
c17097f1 | 51 | include ../Rules |
ce4d8b66 | 52 | |
9de06f3c RM |
53 | # Generate the translation template from all the source files. |
54 | libc.pot: header.pot libc.pot.files | |
55 | @rm -f $@.new | |
56 | set `date -R`; disp="$$6"; \ | |
57 | sed -e 's/VERSION/$(version)/' \ | |
58 | -e "s/DATE/`date +'%Y-%m-%d %H:%M'$$disp`/" \ | |
59 | $< > $@.new | |
41fce8bd | 60 | egrep -v '\.ksh$$' $(word 2,$^) > $(objdir)/tmp-libc.pot-files |
9de06f3c RM |
61 | cd ..; $(XGETTEXT) --keyword=_ --keyword=N_ \ |
62 | --add-comments=TRANS --flag=error:3:c-format \ | |
51f8846e | 63 | --flag=f_print:2:c-format \ |
9de06f3c | 64 | --sort-by-file --omit-header -E -n -d - \ |
41fce8bd UD |
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 | |
9de06f3c | 71 | mv -f $@.new $@ |
9de06f3c | 72 | |
977e7f71 | 73 | po-sed-cmd = \ |
41fce8bd | 74 | '/\/tst-/d;$(foreach S,[ch] cxx sh ksh bash,$(subst .,\.,/.$S\(.in\)*$$/p;))' |
977e7f71 | 75 | |
9de06f3c RM |
76 | # Omit tst-* files, and get only files with the given suffixes. |
77 | libc.pot.files: FORCE | |
977e7f71 | 78 | $(..)scripts/list-sources.sh .. | sed -n $(po-sed-cmd) > $@.new |
9de06f3c | 79 | mv -f $@.new $@ |
ce4d8b66 RM |
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 | ||
8ca5c11b | 88 | # Install the message object files as libc.po in the language directory. |
73237de3 | 89 | $(mo-installed): %.mo $(+force); $(do-install) || exit 0 |
ce4d8b66 RM |
90 | |
91 | .PHONY: linguas linguas.mo | |
92 | linguas: $(ALL_LINGUAS:=.po) | |
93 | linguas.mo: $(ALL_LINGUAS:=.mo) | |
9a0a462c UD |
94 | |
95 | realclean: | |
96 | rm -f $(ALL_LINGUAS:=.mo) | |
ce4d8b66 RM |
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)/%=%) | |
ce4d8b66 | 111 | linguas.mo: $(pofiles:$(podir)/%.po=%.mo) |
ce4d8b66 RM |
112 | |
113 | endif |