Replace FSF snail mail address with URLs.
[glibc.git] / po / Makefile
blob7f523eeb36f4ad326d44fe9bf0d6348579b55f6b
1 # Copyright (C) 1996-1999,2001,2002,2006,2007,2009,2011
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.
21 subdir := po
23 # Add names of the languages with broken .po files here.
24 BROKEN_LINGUAS =
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.
31 ifdef LINGUAS
32 LINGUAS := $(filter $(addsuffix %,$(LINGUAS)),$(ALL_LINGUAS))
33 else
34 LINGUAS = $(ALL_LINGUAS)
35 endif
37 # Text domain name to install under; must match ../locale/SYS_libc.c string.
38 domainname = libc
40 all: # Make this the default target; it will be defined in Rules.
42 include ../Makeconfig
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))
50 # Files to distribute: all the source and compiled binary translation files.
51 distribute = $(ALL_LINGUAS:=.po) $(BROKEN_LINGUAS:=.po) $(ALL_LINGUAS:=.mo) \
52 libc.pot header.pot
55 include ../Rules
57 # Generate the translation template from all the source files.
58 libc.pot: header.pot libc.pot.files
59 @rm -f $@.new
60 set `date -R`; disp="$$6"; \
61 sed -e 's/VERSION/$(version)/' \
62 -e "s/DATE/`date +'%Y-%m-%d %H:%M'$$disp`/" \
63 $< > $@.new
64 egrep -v '\.ksh$$' $(word 2,$^) > $(objdir)/tmp-libc.pot-files
65 cd ..; $(XGETTEXT) --keyword=_ --keyword=N_ \
66 --add-comments=TRANS --flag=error:3:c-format \
67 --flag=f_print:2:c-format \
68 --sort-by-file --omit-header -E -n -d - \
69 -f $(objdir)/tmp-libc.pot-files >> po/$@.new
70 egrep '\.ksh$$' $(word 2,$^) > $(objdir)/tmp-libc.pot-files
71 cd ..; $(XGETTEXT) --add-comments=TRANS --language=Shell \
72 --sort-by-file --omit-header -E -n -o po/$@.new -j \
73 -f $(objdir)/tmp-libc.pot-files po/$@.new
74 rm $(objdir)/tmp-libc.pot-files
75 mv -f $@.new $@
77 po-sed-cmd = \
78 '/\/tst-/d;$(foreach S,[ch] cxx sh ksh bash,$(subst .,\.,/.$S\(.in\)*$$/p;))'
80 # Omit tst-* files, and get only files with the given suffixes.
81 libc.pot.files: FORCE
82 $(..)scripts/list-sources.sh .. | sed -n $(po-sed-cmd) > $@.new
83 mv -f $@.new $@
85 .SUFFIXES: .mo .po .pot
87 # Compile the binary message object files from the portable object source
88 # files of translations for each language.
89 %.mo: %.po
90 $(MSGFMT) -o $@ $<
92 # Install the message object files as libc.po in the language directory.
93 $(mo-installed): %.mo $(+force); $(do-install) || exit 0
95 .PHONY: linguas linguas.mo
96 linguas: $(ALL_LINGUAS:=.po)
97 linguas.mo: $(ALL_LINGUAS:=.mo)
99 realclean:
100 rm -f $(ALL_LINGUAS:=.mo)
102 # Copy the PO files from the translation coordinator's repository.
104 podir = /com/share/ftp/gnu/po/maint/glibc
106 pofiles := $(wildcard $(podir)/*.po)
108 ifneq (,$(pofiles))
110 %.po: $(podir)/%.po
111 cp -f $< $@
112 chmod 444 $@
114 linguas: $(pofiles:$(podir)/%=%)
115 linguas.mo: $(pofiles:$(podir)/%.po=%.mo)
117 endif