1 |
24 |
jeremybenn |
# Makefile for program source directory in GNU NLS utilities package.
|
2 |
|
|
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper
|
3 |
|
|
# Copyright 2001, 2003, 2006 Free Software Foundation, Inc.
|
4 |
|
|
#
|
5 |
|
|
# This file may be copied and used freely without restrictions. It can
|
6 |
|
|
# be used in projects which are not available under the GNU Public License
|
7 |
|
|
# but which still want to provide support for the GNU gettext functionality.
|
8 |
|
|
# Please note that the actual code is *not* freely available.
|
9 |
|
|
|
10 |
|
|
PACKAGE = @PACKAGE@
|
11 |
|
|
VERSION = @VERSION@
|
12 |
|
|
|
13 |
|
|
SHELL = /bin/sh
|
14 |
|
|
@SET_MAKE@
|
15 |
|
|
|
16 |
|
|
srcdir = @srcdir@
|
17 |
|
|
top_srcdir = @top_srcdir@
|
18 |
|
|
VPATH = @srcdir@
|
19 |
|
|
top_builddir = @top_builddir@
|
20 |
|
|
|
21 |
|
|
prefix = @prefix@
|
22 |
|
|
exec_prefix = @exec_prefix@
|
23 |
|
|
datadir = $(prefix)/@DATADIRNAME@
|
24 |
|
|
localedir = $(datadir)/locale
|
25 |
|
|
gnulocaledir = $(prefix)/share/locale
|
26 |
|
|
gettextsrcdir = $(prefix)/share/gettext/po
|
27 |
|
|
subdir = po
|
28 |
|
|
|
29 |
|
|
DESTDIR =
|
30 |
|
|
|
31 |
|
|
INSTALL = @INSTALL@
|
32 |
|
|
INSTALL_DATA = @INSTALL_DATA@
|
33 |
|
|
MKINSTALLDIRS = @MKINSTALLDIRS@
|
34 |
|
|
|
35 |
|
|
CC = @CC@
|
36 |
|
|
GENCAT = @GENCAT@
|
37 |
|
|
GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
|
38 |
|
|
MSGFMT = @MSGFMT@
|
39 |
|
|
XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
|
40 |
|
|
MSGMERGE = PATH=../src:$$PATH msgmerge
|
41 |
|
|
|
42 |
|
|
DEFS = @DEFS@
|
43 |
|
|
CFLAGS = @CFLAGS@
|
44 |
|
|
CPPFLAGS = @CPPFLAGS@
|
45 |
|
|
|
46 |
|
|
INCLUDES = -I.. -I$(top_srcdir)/intl
|
47 |
|
|
|
48 |
|
|
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
49 |
|
|
|
50 |
|
|
SOURCES = cat-id-tbl.c
|
51 |
|
|
POFILES = @POFILES@
|
52 |
|
|
GMOFILES = @GMOFILES@
|
53 |
|
|
DISTFILES = ChangeLog Makefile.in.in SRC-POTFILES.in BLD-POTFILES.in $(PACKAGE).pot \
|
54 |
|
|
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
|
55 |
|
|
|
56 |
|
|
# Note - the following line gets processed by bfd/configure and amended
|
57 |
|
|
# to contain the full list of source dir POTFILES.
|
58 |
|
|
SRC-POTFILES = \
|
59 |
|
|
|
60 |
|
|
# Note - the following line gets processed by bfd/configure and amended
|
61 |
|
|
# to contain the full list of build dir POTFILES.
|
62 |
|
|
BLD-POTFILES = \
|
63 |
|
|
|
64 |
|
|
CATALOGS = @CATALOGS@
|
65 |
|
|
CATOBJEXT = @CATOBJEXT@
|
66 |
|
|
INSTOBJEXT = @INSTOBJEXT@
|
67 |
|
|
|
68 |
|
|
.SUFFIXES:
|
69 |
|
|
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
|
70 |
|
|
|
71 |
|
|
.c.o:
|
72 |
|
|
$(COMPILE) $<
|
73 |
|
|
|
74 |
|
|
.po.pox:
|
75 |
|
|
$(MAKE) $(PACKAGE).pot
|
76 |
|
|
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
|
77 |
|
|
|
78 |
|
|
.po.mo:
|
79 |
|
|
$(MSGFMT) -o $@ $<
|
80 |
|
|
|
81 |
|
|
.po.gmo:
|
82 |
|
|
file=`echo $* | sed 's,.*/,,'`.gmo \
|
83 |
|
|
&& rm -f $$file && $(GMSGFMT) -o $$file $<
|
84 |
|
|
|
85 |
|
|
.po.cat:
|
86 |
|
|
sed -f ../intl/po2msg.sed < $< > $*.msg \
|
87 |
|
|
&& rm -f $@ && $(GENCAT) $@ $*.msg
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
all: all-@USE_NLS@
|
91 |
|
|
|
92 |
|
|
all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
|
93 |
|
|
all-no:
|
94 |
|
|
|
95 |
|
|
$(srcdir)/$(PACKAGE).pot: $(SRC-POTFILES) $(BLD-POTFILES)
|
96 |
|
|
$(XGETTEXT) --default-domain=$(PACKAGE) \
|
97 |
|
|
--directory=$(top_srcdir) \
|
98 |
|
|
--add-comments --keyword=_ --keyword=N_ \
|
99 |
|
|
--msgid-bugs-address=bug-binutils@gnu.org \
|
100 |
|
|
--files-from=$(srcdir)/SRC-POTFILES.in
|
101 |
|
|
$(XGETTEXT) --default-domain=$(PACKAGE) \
|
102 |
|
|
--directory=.. \
|
103 |
|
|
--directory=. \
|
104 |
|
|
--add-comments --keyword=_ --keyword=N_ \
|
105 |
|
|
--join-existing \
|
106 |
|
|
--msgid-bugs-address=bug-binutils@gnu.org \
|
107 |
|
|
--files-from=$(srcdir)/BLD-POTFILES.in
|
108 |
|
|
rm -f $(srcdir)/$(PACKAGE).pot
|
109 |
|
|
mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
|
110 |
|
|
|
111 |
|
|
$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
|
112 |
|
|
$(srcdir)/stamp-cat-id: $(PACKAGE).pot
|
113 |
|
|
rm -f cat-id-tbl.tmp
|
114 |
|
|
sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
|
115 |
|
|
| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
|
116 |
|
|
if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
|
117 |
|
|
rm cat-id-tbl.tmp; \
|
118 |
|
|
else \
|
119 |
|
|
echo cat-id-tbl.c changed; \
|
120 |
|
|
rm -f $(srcdir)/cat-id-tbl.c; \
|
121 |
|
|
mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
|
122 |
|
|
fi
|
123 |
|
|
cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
|
124 |
|
|
|
125 |
|
|
|
126 |
|
|
install: install-exec install-data
|
127 |
|
|
install-exec:
|
128 |
|
|
install-info:
|
129 |
|
|
install-html:
|
130 |
|
|
install-data: install-data-@USE_NLS@
|
131 |
|
|
install-data-no: all
|
132 |
|
|
install-data-yes: all
|
133 |
|
|
if test -r $(MKINSTALLDIRS); then \
|
134 |
|
|
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
|
135 |
|
|
else \
|
136 |
|
|
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
|
137 |
|
|
fi
|
138 |
|
|
@catalogs='$(CATALOGS)'; \
|
139 |
|
|
for cat in $$catalogs; do \
|
140 |
|
|
cat=`basename $$cat`; \
|
141 |
|
|
case "$$cat" in \
|
142 |
|
|
*.gmo) destdir=$(gnulocaledir);; \
|
143 |
|
|
*) destdir=$(localedir);; \
|
144 |
|
|
esac; \
|
145 |
|
|
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
146 |
|
|
dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
|
147 |
|
|
if test -r $(MKINSTALLDIRS); then \
|
148 |
|
|
$(MKINSTALLDIRS) $$dir; \
|
149 |
|
|
else \
|
150 |
|
|
$(top_srcdir)/mkinstalldirs $$dir; \
|
151 |
|
|
fi; \
|
152 |
|
|
if test -r $$cat; then \
|
153 |
|
|
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
154 |
|
|
echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
155 |
|
|
else \
|
156 |
|
|
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
157 |
|
|
echo "installing $(srcdir)/$$cat as" \
|
158 |
|
|
"$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
159 |
|
|
fi; \
|
160 |
|
|
if test -r $$cat.m; then \
|
161 |
|
|
$(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
162 |
|
|
echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
163 |
|
|
else \
|
164 |
|
|
if test -r $(srcdir)/$$cat.m ; then \
|
165 |
|
|
$(INSTALL_DATA) $(srcdir)/$$cat.m \
|
166 |
|
|
$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
167 |
|
|
echo "installing $(srcdir)/$$cat as" \
|
168 |
|
|
"$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
169 |
|
|
else \
|
170 |
|
|
true; \
|
171 |
|
|
fi; \
|
172 |
|
|
fi; \
|
173 |
|
|
done
|
174 |
|
|
if test "$(PACKAGE)" = "gettext"; then \
|
175 |
|
|
if test -r $(MKINSTALLDIRS); then \
|
176 |
|
|
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
|
177 |
|
|
else \
|
178 |
|
|
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
|
179 |
|
|
fi; \
|
180 |
|
|
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
181 |
|
|
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
182 |
|
|
else \
|
183 |
|
|
: ; \
|
184 |
|
|
fi
|
185 |
|
|
|
186 |
|
|
# Define this as empty until I found a useful application.
|
187 |
|
|
installcheck:
|
188 |
|
|
|
189 |
|
|
uninstall:
|
190 |
|
|
catalogs='$(CATALOGS)'; \
|
191 |
|
|
for cat in $$catalogs; do \
|
192 |
|
|
cat=`basename $$cat`; \
|
193 |
|
|
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
194 |
|
|
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
195 |
|
|
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
196 |
|
|
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
197 |
|
|
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
198 |
|
|
done
|
199 |
|
|
rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in
|
200 |
|
|
|
201 |
|
|
check: all
|
202 |
|
|
|
203 |
|
|
cat-id-tbl.o: ../intl/libgettext.h
|
204 |
|
|
|
205 |
|
|
html dvi pdf ps info tags TAGS ID:
|
206 |
|
|
|
207 |
|
|
mostlyclean:
|
208 |
|
|
rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
|
209 |
|
|
rm -fr *.o
|
210 |
|
|
|
211 |
|
|
clean: mostlyclean
|
212 |
|
|
|
213 |
|
|
distclean: clean
|
214 |
|
|
rm -f Makefile Makefile.in *.mo *.msg *.cat *.cat.m
|
215 |
|
|
rm -f SRC-POTFILES BLD-POTFILES
|
216 |
|
|
|
217 |
|
|
maintainer-clean: distclean
|
218 |
|
|
@echo "This command is intended for maintainers to use;"
|
219 |
|
|
@echo "it deletes files that may require special tools to rebuild."
|
220 |
|
|
rm -f $(GMOFILES) SRC-POTFILES.in BLD-POTFILES.in
|
221 |
|
|
|
222 |
|
|
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
223 |
|
|
dist distdir: update-po $(DISTFILES)
|
224 |
|
|
dists="$(DISTFILES)"; \
|
225 |
|
|
for file in $$dists; do \
|
226 |
|
|
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|
227 |
|
|
|| cp -p $(srcdir)/$$file $(distdir); \
|
228 |
|
|
done
|
229 |
|
|
|
230 |
|
|
update-po: Makefile
|
231 |
|
|
$(MAKE) $(PACKAGE).pot
|
232 |
|
|
PATH=`pwd`/../src:$$PATH; \
|
233 |
|
|
cd $(srcdir); \
|
234 |
|
|
catalogs='$(CATALOGS)'; \
|
235 |
|
|
for cat in $$catalogs; do \
|
236 |
|
|
cat=`basename $$cat`; \
|
237 |
|
|
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
238 |
|
|
mv $$lang.po $$lang.old.po; \
|
239 |
|
|
echo "$$lang:"; \
|
240 |
|
|
if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
|
241 |
|
|
rm -f $$lang.old.po; \
|
242 |
|
|
else \
|
243 |
|
|
echo "msgmerge for $$cat failed!"; \
|
244 |
|
|
rm -f $$lang.po; \
|
245 |
|
|
mv $$lang.old.po $$lang.po; \
|
246 |
|
|
fi; \
|
247 |
|
|
done
|
248 |
|
|
|
249 |
|
|
SRC-POTFILES: SRC-POTFILES.in
|
250 |
|
|
( if test 'x$(srcdir)' != 'x.'; then \
|
251 |
|
|
posrcprefix='$(top_srcdir)/'; \
|
252 |
|
|
else \
|
253 |
|
|
posrcprefix="../"; \
|
254 |
|
|
fi; \
|
255 |
|
|
rm -f $@-t $@ \
|
256 |
|
|
&& (sed -e '/^#/d' \
|
257 |
|
|
-e '/^[ ]*$$/d' \
|
258 |
|
|
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
|
259 |
|
|
| sed -e '$$s/\\$$//') > $@-t \
|
260 |
|
|
&& chmod a-w $@-t \
|
261 |
|
|
&& mv $@-t $@ )
|
262 |
|
|
|
263 |
|
|
BLD-POTFILES: BLD-POTFILES.in
|
264 |
|
|
( rm -f $@-t $@ \
|
265 |
|
|
&& (sed -e '/^#/d' \
|
266 |
|
|
-e '/^[ ]*$$/d' \
|
267 |
|
|
-e "s@.*@ ../& \\\\@" < $(srcdir)/$@.in \
|
268 |
|
|
| sed -e '$$s/\\$$//') > $@-t \
|
269 |
|
|
&& chmod a-w $@-t \
|
270 |
|
|
&& mv $@-t $@ )
|
271 |
|
|
|
272 |
|
|
SRC-POTFILES.in: @MAINT@ ../Makefile
|
273 |
|
|
cd .. && $(MAKE) po/SRC-POTFILES.in
|
274 |
|
|
|
275 |
|
|
BLD-POTFILES.in: @MAINT@ ../Makefile
|
276 |
|
|
cd .. && $(MAKE) po/BLD-POTFILES.in
|
277 |
|
|
|
278 |
|
|
# Note - The presence of SRC-POTFILES and BLD-POTFILES as dependencies
|
279 |
|
|
# here breaks the implementation of the 'distclean' rule for maintainers.
|
280 |
|
|
# This is because if 'make distclean' is run in the BFD directory, the
|
281 |
|
|
# Makefile there will be deleted before 'distclean' is made here, and so
|
282 |
|
|
# the dependency SRC-POTFILES -> SRC-POTFILES.in -> ../Makefile cannot
|
283 |
|
|
# be satisfied.
|
284 |
|
|
#
|
285 |
|
|
# The SRC-POTFILES and BLD-POTFILES dependencies cannot be removed,
|
286 |
|
|
# however since it is necessary that these files be built during
|
287 |
|
|
# *configure* time, so that configure can insert them into the
|
288 |
|
|
# po/Makefile that it is creating, so that the Makefile will have
|
289 |
|
|
# the correct dependencies.
|
290 |
|
|
Makefile: Make-in ../config.status SRC-POTFILES BLD-POTFILES
|
291 |
|
|
cd .. \
|
292 |
|
|
&& CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
|
293 |
|
|
CONFIG_HEADERS= $(SHELL) ./config.status
|
294 |
|
|
|
295 |
|
|
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
296 |
|
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
297 |
|
|
.NOEXPORT:
|