xref: /netbsd/external/gpl3/gdb.old/dist/ld/po/Make-in (revision 56bb7041)
1*56bb7041Schristos# Makefile for program source directory in GNU NLS utilities package.
2*56bb7041Schristos# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
3*56bb7041Schristos# Copyright (C) 2003-2020 Free Software Foundation, Inc.
4*56bb7041Schristos#
5*56bb7041Schristos# This file may be copied and used freely without restrictions.  It can
6*56bb7041Schristos# be used in projects which are not available under the GNU Public License
7*56bb7041Schristos# but which still want to provide support for the GNU gettext functionality.
8*56bb7041Schristos# Please note that the actual code is *not* freely available.
9*56bb7041Schristos
10*56bb7041SchristosPACKAGE = @PACKAGE@
11*56bb7041SchristosVERSION = @VERSION@
12*56bb7041Schristos
13*56bb7041SchristosSHELL = /bin/sh
14*56bb7041Schristos@SET_MAKE@
15*56bb7041Schristos
16*56bb7041Schristossrcdir = @srcdir@
17*56bb7041Schristostop_srcdir = @top_srcdir@
18*56bb7041SchristosVPATH = @srcdir@
19*56bb7041Schristostop_builddir = @top_builddir@
20*56bb7041Schristos
21*56bb7041Schristosprefix = @prefix@
22*56bb7041Schristosexec_prefix = @exec_prefix@
23*56bb7041Schristosdatadir = @datadir@
24*56bb7041Schristoslocaledir = @localedir@
25*56bb7041Schristosgnulocaledir = @datarootdir@/locale
26*56bb7041Schristosgettextsrcdir = @datarootdir@/gettext/po
27*56bb7041Schristossubdir = po
28*56bb7041Schristos
29*56bb7041SchristosDESTDIR =
30*56bb7041Schristos
31*56bb7041SchristosINSTALL = @INSTALL@
32*56bb7041SchristosINSTALL_DATA = @INSTALL_DATA@
33*56bb7041SchristosMKINSTALLDIRS = @MKINSTALLDIRS@
34*56bb7041Schristos
35*56bb7041SchristosCC = @CC@
36*56bb7041SchristosGENCAT = @GENCAT@
37*56bb7041SchristosGMSGFMT = PATH=../src:$$PATH @GMSGFMT@
38*56bb7041SchristosMSGFMT = @MSGFMT@
39*56bb7041SchristosXGETTEXT = PATH=../src:$$PATH @XGETTEXT@
40*56bb7041SchristosMSGMERGE = PATH=../src:$$PATH msgmerge
41*56bb7041Schristos
42*56bb7041SchristosDEFS = @DEFS@
43*56bb7041SchristosCFLAGS = @CFLAGS@
44*56bb7041SchristosCPPFLAGS = @CPPFLAGS@
45*56bb7041Schristos
46*56bb7041SchristosINCLUDES = -I.. -I$(top_srcdir)/intl
47*56bb7041Schristos
48*56bb7041SchristosCOMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
49*56bb7041Schristos
50*56bb7041SchristosSOURCES = cat-id-tbl.c
51*56bb7041SchristosPOFILES = @POFILES@
52*56bb7041SchristosGMOFILES = @GMOFILES@
53*56bb7041SchristosDISTFILES = ChangeLog Makefile.in.in SRC-POTFILES.in BLD-POTFILES.in $(PACKAGE).pot \
54*56bb7041Schristosstamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
55*56bb7041Schristos
56*56bb7041SchristosSRC-POTFILES = \
57*56bb7041Schristos
58*56bb7041SchristosBLD-POTFILES = \
59*56bb7041Schristos
60*56bb7041SchristosCATALOGS = @CATALOGS@
61*56bb7041SchristosCATOBJEXT = @CATOBJEXT@
62*56bb7041SchristosINSTOBJEXT = @INSTOBJEXT@
63*56bb7041Schristos
64*56bb7041Schristos.SUFFIXES:
65*56bb7041Schristos.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
66*56bb7041Schristos
67*56bb7041Schristos.c.o:
68*56bb7041Schristos	$(COMPILE) $<
69*56bb7041Schristos
70*56bb7041Schristos.po.pox:
71*56bb7041Schristos	$(MAKE) $(PACKAGE).pot
72*56bb7041Schristos	$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
73*56bb7041Schristos
74*56bb7041Schristos.po.mo:
75*56bb7041Schristos	$(MSGFMT) -o $@ $<
76*56bb7041Schristos
77*56bb7041Schristos.po.gmo:
78*56bb7041Schristos	file=`echo $* | sed 's,.*/,,'`.gmo \
79*56bb7041Schristos	  && rm -f $$file && $(GMSGFMT) -o $$file $<
80*56bb7041Schristos
81*56bb7041Schristos.po.cat:
82*56bb7041Schristos	sed -f ../intl/po2msg.sed < $< > $*.msg \
83*56bb7041Schristos	  && rm -f $@ && $(GENCAT) $@ $*.msg
84*56bb7041Schristos
85*56bb7041Schristos
86*56bb7041Schristosall: all-@USE_NLS@
87*56bb7041Schristos
88*56bb7041Schristosall-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
89*56bb7041Schristosall-no:
90*56bb7041Schristos
91*56bb7041Schristos$(srcdir)/$(PACKAGE).pot: $(SRC-POTFILES) $(BLD-POTFILES)
92*56bb7041Schristos	$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
93*56bb7041Schristos	  --add-comments --keyword=_ --keyword=N_ \
94*56bb7041Schristos	  --msgid-bugs-address=bug-binutils@gnu.org \
95*56bb7041Schristos	  --files-from=$(srcdir)/SRC-POTFILES.in
96*56bb7041Schristos	$(XGETTEXT) --default-domain=$(PACKAGE) --directory=.. \
97*56bb7041Schristos	  --add-comments --keyword=_ --keyword=N_ \
98*56bb7041Schristos	  --join-existing \
99*56bb7041Schristos	  --msgid-bugs-address=bug-binutils@gnu.org \
100*56bb7041Schristos	  --files-from=$(srcdir)/BLD-POTFILES.in
101*56bb7041Schristos	rm -f $(srcdir)/$(PACKAGE).pot
102*56bb7041Schristos	mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
103*56bb7041Schristos
104*56bb7041Schristos$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
105*56bb7041Schristos$(srcdir)/stamp-cat-id: $(PACKAGE).pot
106*56bb7041Schristos	rm -f cat-id-tbl.tmp
107*56bb7041Schristos	sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
108*56bb7041Schristos		| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
109*56bb7041Schristos	if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
110*56bb7041Schristos	  rm cat-id-tbl.tmp; \
111*56bb7041Schristos	else \
112*56bb7041Schristos	  echo cat-id-tbl.c changed; \
113*56bb7041Schristos	  rm -f $(srcdir)/cat-id-tbl.c; \
114*56bb7041Schristos	  mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
115*56bb7041Schristos	fi
116*56bb7041Schristos	cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
117*56bb7041Schristos
118*56bb7041Schristos
119*56bb7041Schristosinstall: install-exec install-data
120*56bb7041Schristosinstall-exec:
121*56bb7041Schristosinstall-info:
122*56bb7041Schristosinstall-html:
123*56bb7041Schristosinstall-pdf:
124*56bb7041Schristosinstall-data: install-data-@USE_NLS@
125*56bb7041Schristosinstall-data-no: all
126*56bb7041Schristosinstall-data-yes: all
127*56bb7041Schristos	if test -r $(MKINSTALLDIRS); then \
128*56bb7041Schristos	  $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
129*56bb7041Schristos	else \
130*56bb7041Schristos	  $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
131*56bb7041Schristos	fi
132*56bb7041Schristos	@catalogs='$(CATALOGS)'; \
133*56bb7041Schristos	for cat in $$catalogs; do \
134*56bb7041Schristos	  cat=`basename $$cat`; \
135*56bb7041Schristos	  case "$$cat" in \
136*56bb7041Schristos	    *.gmo) destdir=$(gnulocaledir);; \
137*56bb7041Schristos	    *)     destdir=$(localedir);; \
138*56bb7041Schristos	  esac; \
139*56bb7041Schristos	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
140*56bb7041Schristos	  dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
141*56bb7041Schristos	  if test -r $(MKINSTALLDIRS); then \
142*56bb7041Schristos	    $(MKINSTALLDIRS) $$dir; \
143*56bb7041Schristos	  else \
144*56bb7041Schristos	    $(top_srcdir)/mkinstalldirs $$dir; \
145*56bb7041Schristos	  fi; \
146*56bb7041Schristos	  if test -r $$cat; then \
147*56bb7041Schristos	    $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
148*56bb7041Schristos	    echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
149*56bb7041Schristos	  else \
150*56bb7041Schristos	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
151*56bb7041Schristos	    echo "installing $(srcdir)/$$cat as" \
152*56bb7041Schristos		 "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
153*56bb7041Schristos	  fi; \
154*56bb7041Schristos	  if test -r $$cat.m; then \
155*56bb7041Schristos	    $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
156*56bb7041Schristos	    echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
157*56bb7041Schristos	  else \
158*56bb7041Schristos	    if test -r $(srcdir)/$$cat.m ; then \
159*56bb7041Schristos	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
160*56bb7041Schristos		$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
161*56bb7041Schristos	      echo "installing $(srcdir)/$$cat as" \
162*56bb7041Schristos		   "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
163*56bb7041Schristos	    else \
164*56bb7041Schristos	      true; \
165*56bb7041Schristos	    fi; \
166*56bb7041Schristos	  fi; \
167*56bb7041Schristos	done
168*56bb7041Schristos	if test "$(PACKAGE)" = "gettext"; then \
169*56bb7041Schristos	  if test -r $(MKINSTALLDIRS); then \
170*56bb7041Schristos	    $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
171*56bb7041Schristos	  else \
172*56bb7041Schristos	    $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
173*56bb7041Schristos	  fi; \
174*56bb7041Schristos	  $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
175*56bb7041Schristos			  $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
176*56bb7041Schristos	else \
177*56bb7041Schristos	  : ; \
178*56bb7041Schristos	fi
179*56bb7041Schristos
180*56bb7041Schristos# Define this as empty until I found a useful application.
181*56bb7041Schristosinstallcheck:
182*56bb7041Schristos
183*56bb7041Schristosuninstall:
184*56bb7041Schristos	catalogs='$(CATALOGS)'; \
185*56bb7041Schristos	for cat in $$catalogs; do \
186*56bb7041Schristos	  cat=`basename $$cat`; \
187*56bb7041Schristos	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
188*56bb7041Schristos	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
189*56bb7041Schristos	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
190*56bb7041Schristos	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
191*56bb7041Schristos	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
192*56bb7041Schristos	done
193*56bb7041Schristos	rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in
194*56bb7041Schristos
195*56bb7041Schristoscheck: all
196*56bb7041Schristos
197*56bb7041Schristoscat-id-tbl.o: ../intl/libgettext.h
198*56bb7041Schristos
199*56bb7041Schristoshtml dvi pdf ps info tags TAGS ID:
200*56bb7041Schristos
201*56bb7041Schristosmostlyclean:
202*56bb7041Schristos	rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
203*56bb7041Schristos	rm -fr *.o
204*56bb7041Schristos
205*56bb7041Schristosclean: mostlyclean
206*56bb7041Schristos
207*56bb7041Schristosdistclean: clean
208*56bb7041Schristos	rm -f Makefile Makefile.in *.mo *.msg *.cat *.cat.m
209*56bb7041Schristos	rm -f SRC-POTFILES BLD-POTFILES
210*56bb7041Schristos
211*56bb7041Schristosmaintainer-clean: distclean
212*56bb7041Schristos	@echo "This command is intended for maintainers to use;"
213*56bb7041Schristos	@echo "it deletes files that may require special tools to rebuild."
214*56bb7041Schristos	rm -f $(GMOFILES) SRC-POTFILES.in BLD-POTFILES.in
215*56bb7041Schristos
216*56bb7041Schristosdistdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
217*56bb7041Schristosdist distdir: update-po $(DISTFILES)
218*56bb7041Schristos	dists="$(DISTFILES)"; \
219*56bb7041Schristos	for file in $$dists; do \
220*56bb7041Schristos	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
221*56bb7041Schristos	    || cp -p $(srcdir)/$$file $(distdir); \
222*56bb7041Schristos	done
223*56bb7041Schristos
224*56bb7041Schristosupdate-po: Makefile
225*56bb7041Schristos	$(MAKE) $(PACKAGE).pot
226*56bb7041Schristos	PATH=`pwd`/../src:$$PATH; \
227*56bb7041Schristos	cd $(srcdir); \
228*56bb7041Schristos	catalogs='$(CATALOGS)'; \
229*56bb7041Schristos	for cat in $$catalogs; do \
230*56bb7041Schristos	  cat=`basename $$cat`; \
231*56bb7041Schristos	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
232*56bb7041Schristos	  mv $$lang.po $$lang.old.po; \
233*56bb7041Schristos	  echo "$$lang:"; \
234*56bb7041Schristos	  if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
235*56bb7041Schristos	    rm -f $$lang.old.po; \
236*56bb7041Schristos	  else \
237*56bb7041Schristos	    echo "msgmerge for $$cat failed!"; \
238*56bb7041Schristos	    rm -f $$lang.po; \
239*56bb7041Schristos	    mv $$lang.old.po $$lang.po; \
240*56bb7041Schristos	  fi; \
241*56bb7041Schristos	done
242*56bb7041Schristos
243*56bb7041SchristosSRC-POTFILES: SRC-POTFILES.in
244*56bb7041Schristos	( if test 'x$(srcdir)' != 'x.'; then \
245*56bb7041Schristos	    posrcprefix='$(top_srcdir)/'; \
246*56bb7041Schristos	  else \
247*56bb7041Schristos	    posrcprefix="../"; \
248*56bb7041Schristos	  fi; \
249*56bb7041Schristos	  rm -f $@-t $@ \
250*56bb7041Schristos	    && (sed -e '/^#/d' -e '/^[	 ]*$$/d' \
251*56bb7041Schristos		    -e "s@.*@	$$posrcprefix& \\\\@" < $(srcdir)/$@.in \
252*56bb7041Schristos		| sed -e '$$s/\\$$//') > $@-t \
253*56bb7041Schristos	    && chmod a-w $@-t \
254*56bb7041Schristos	    && mv $@-t $@ )
255*56bb7041Schristos
256*56bb7041SchristosBLD-POTFILES: BLD-POTFILES.in
257*56bb7041Schristos	  rm -f $@-t $@ \
258*56bb7041Schristos	  && sed -e '/^#/d' -e '/^[	 ]*$$/d' \
259*56bb7041Schristos		 -e "s@.*@	../& \\\\@" < $(srcdir)/$@.in \
260*56bb7041Schristos	     | sed -e '$$s/\\$$//' > $@-t \
261*56bb7041Schristos	  && chmod a-w $@-t \
262*56bb7041Schristos	  && mv $@-t $@
263*56bb7041Schristos
264*56bb7041SchristosSRC-POTFILES.in: @MAINT@ ../Makefile
265*56bb7041Schristos	cd .. && $(MAKE) po/SRC-POTFILES.in
266*56bb7041Schristos
267*56bb7041SchristosBLD-POTFILES.in: @MAINT@ ../Makefile
268*56bb7041Schristos	cd .. && $(MAKE) po/BLD-POTFILES.in
269*56bb7041Schristos
270*56bb7041SchristosMakefile: Make-in ../config.status SRC-POTFILES BLD-POTFILES
271*56bb7041Schristos	cd .. \
272*56bb7041Schristos	  && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
273*56bb7041Schristos	     CONFIG_HEADERS= $(SHELL) ./config.status
274*56bb7041Schristos
275*56bb7041Schristos# Tell versions [3.59,3.63) of GNU make not to export all variables.
276*56bb7041Schristos# Otherwise a system limit (for SysV at least) may be exceeded.
277*56bb7041Schristos.NOEXPORT:
278