Remove support for automatic cvs check-ins
[platform/upstream/linaro-glibc.git] / po / Makefile
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.
4
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.
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
13 # Lesser General Public License for more details.
14
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, write to the Free
17 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 # 02111-1307 USA.
19
20 # Makefile for installing libc message catalogs.
21
22 subdir := po
23
24 # Add names of the languages with broken .po files here.
25 BROKEN_LINGUAS =
26
27 # List of languages for which we have message catalogs of translations.
28 ALL_LINGUAS := $(filter-out $(BROKEN_LINGUAS),$(basename $(wildcard *.po)))
29
30 # You can override this in configparms or the make command line to limit
31 # the languages which get installed.
32 ifdef LINGUAS
33 LINGUAS := $(filter $(addsuffix %,$(LINGUAS)),$(ALL_LINGUAS))
34 else
35 LINGUAS = $(ALL_LINGUAS)
36 endif
37
38 # Text domain name to install under; must match ../locale/SYS_libc.c string.
39 domainname = libc
40
41 all: # Make this the default target; it will be defined in Rules.
42
43 include ../Makeconfig
44
45 # Pattern for where message catalog object for language % gets installed.
46 mo-installed = $(inst_msgcatdir)/%/LC_MESSAGES/$(domainname).mo
47
48 # Files to install: a $(domainname).mo file for each language.
49 install-others = $(LINGUAS:%=$(mo-installed))
50
51 # Files to distribute: all the source and compiled binary translation files.
52 distribute = $(ALL_LINGUAS:=.po) $(BROKEN_LINGUAS:=.po) $(ALL_LINGUAS:=.mo) \
53              libc.pot header.pot
54
55
56 include ../Rules
57
58 # Generate the translation template from all the source files.
59 libc.pot: header.pot libc.pot.files
60         @rm -f $@.new
61         set `date -R`; disp="$$6"; \
62         sed -e 's/VERSION/$(version)/' \
63             -e "s/DATE/`date +'%Y-%m-%d %H:%M'$$disp`/" \
64             $< > $@.new
65         egrep -v '\.ksh$$' $(word 2,$^) > $(objdir)/tmp-libc.pot-files
66         cd ..; $(XGETTEXT) --keyword=_ --keyword=N_ \
67                            --add-comments=TRANS --flag=error:3:c-format \
68                            --flag=f_print:2:c-format \
69                            --sort-by-file --omit-header -E -n -d - \
70                            -f $(objdir)/tmp-libc.pot-files >> po/$@.new
71         egrep '\.ksh$$' $(word 2,$^) > $(objdir)/tmp-libc.pot-files
72         cd ..; $(XGETTEXT) --add-comments=TRANS --language=Shell \
73                            --sort-by-file --omit-header -E -n -o po/$@.new -j \
74                            -f $(objdir)/tmp-libc.pot-files po/$@.new
75         rm $(objdir)/tmp-libc.pot-files
76         mv -f $@.new $@
77
78 po-sed-cmd = \
79   '/\/tst-/d;$(foreach S,[ch] cxx sh ksh bash,$(subst .,\.,/.$S\(.in\)*$$/p;))'
80
81 # Omit tst-* files, and get only files with the given suffixes.
82 libc.pot.files: FORCE
83         $(..)scripts/list-sources.sh .. | sed -n $(po-sed-cmd) > $@.new
84         mv -f $@.new $@
85
86 .SUFFIXES: .mo .po .pot
87
88 # Compile the binary message object files from the portable object source
89 # files of translations for each language.
90 %.mo: %.po
91         $(MSGFMT) -o $@ $<
92
93 # Install the message object files as libc.po in the language directory.
94 $(mo-installed): %.mo $(+force); $(do-install) || exit 0
95
96 .PHONY: linguas linguas.mo
97 linguas: $(ALL_LINGUAS:=.po)
98 linguas.mo: $(ALL_LINGUAS:=.mo)
99
100 realclean:
101         rm -f $(ALL_LINGUAS:=.mo)
102 \f
103 # Copy the PO files from the translation coordinator's repository.
104
105 podir = /com/share/ftp/gnu/po/maint/glibc
106
107 pofiles := $(wildcard $(podir)/*.po)
108
109 ifneq (,$(pofiles))
110
111 %.po: $(podir)/%.po
112         cp -f $< $@
113         chmod 444 $@
114
115 linguas: $(pofiles:$(podir)/%=%)
116 linguas.mo: $(pofiles:$(podir)/%.po=%.mo)
117
118 endif