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