1*3d8817e4Smiod# Makefile for program source directory in GNU NLS utilities package.
2*3d8817e4Smiod# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
3*3d8817e4Smiod# Copyright 2003, 2006 Free Software Foundation, Inc.
4*3d8817e4Smiod#
5*3d8817e4Smiod# This file may be copied and used freely without restrictions.  It can
6*3d8817e4Smiod# be used in projects which are not available under the GNU Public License
7*3d8817e4Smiod# but which still want to provide support for the GNU gettext functionality.
8*3d8817e4Smiod# Please note that the actual code is *not* freely available.
9*3d8817e4Smiod
10*3d8817e4SmiodPACKAGE = @PACKAGE@
11*3d8817e4SmiodVERSION = @VERSION@
12*3d8817e4Smiod
13*3d8817e4SmiodSHELL = /bin/sh
14*3d8817e4Smiod@SET_MAKE@
15*3d8817e4Smiod
16*3d8817e4Smiodsrcdir = @srcdir@
17*3d8817e4Smiodtop_srcdir = @top_srcdir@
18*3d8817e4SmiodVPATH = @srcdir@
19*3d8817e4Smiod
20*3d8817e4Smiodprefix = @prefix@
21*3d8817e4Smiodexec_prefix = @exec_prefix@
22*3d8817e4Smioddatadir = $(prefix)/@DATADIRNAME@
23*3d8817e4Smiodlocaledir = $(datadir)/locale
24*3d8817e4Smiodgnulocaledir = $(prefix)/share/locale
25*3d8817e4Smiodgettextsrcdir = $(prefix)/share/gettext/po
26*3d8817e4Smiodsubdir = po
27*3d8817e4Smiod
28*3d8817e4SmiodDESTDIR =
29*3d8817e4Smiod
30*3d8817e4SmiodINSTALL = @INSTALL@
31*3d8817e4SmiodINSTALL_DATA = @INSTALL_DATA@
32*3d8817e4SmiodMKINSTALLDIRS = @MKINSTALLDIRS@
33*3d8817e4Smiod
34*3d8817e4SmiodCC = @CC@
35*3d8817e4SmiodGENCAT = @GENCAT@
36*3d8817e4SmiodGMSGFMT = PATH=../src:$$PATH @GMSGFMT@
37*3d8817e4SmiodMSGFMT = @MSGFMT@
38*3d8817e4SmiodXGETTEXT = PATH=../src:$$PATH @XGETTEXT@
39*3d8817e4SmiodMSGMERGE = PATH=../src:$$PATH msgmerge
40*3d8817e4Smiod
41*3d8817e4SmiodDEFS = @DEFS@
42*3d8817e4SmiodCFLAGS = @CFLAGS@
43*3d8817e4SmiodCPPFLAGS = @CPPFLAGS@
44*3d8817e4Smiod
45*3d8817e4SmiodINCLUDES = -I.. -I$(top_srcdir)/intl
46*3d8817e4Smiod
47*3d8817e4SmiodCOMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
48*3d8817e4Smiod
49*3d8817e4SmiodSOURCES = cat-id-tbl.c
50*3d8817e4SmiodPOFILES = @POFILES@
51*3d8817e4SmiodGMOFILES = @GMOFILES@
52*3d8817e4SmiodDISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
53*3d8817e4Smiodstamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
54*3d8817e4Smiod
55*3d8817e4SmiodPOTFILES = \
56*3d8817e4Smiod
57*3d8817e4SmiodCATALOGS = @CATALOGS@
58*3d8817e4SmiodCATOBJEXT = @CATOBJEXT@
59*3d8817e4SmiodINSTOBJEXT = @INSTOBJEXT@
60*3d8817e4Smiod
61*3d8817e4Smiod.SUFFIXES:
62*3d8817e4Smiod.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
63*3d8817e4Smiod
64*3d8817e4Smiod.c.o:
65*3d8817e4Smiod	$(COMPILE) $<
66*3d8817e4Smiod
67*3d8817e4Smiod.po.pox:
68*3d8817e4Smiod	$(MAKE) $(PACKAGE).pot
69*3d8817e4Smiod	$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
70*3d8817e4Smiod
71*3d8817e4Smiod.po.mo:
72*3d8817e4Smiod	$(MSGFMT) -o $@ $<
73*3d8817e4Smiod
74*3d8817e4Smiod.po.gmo:
75*3d8817e4Smiod	file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
76*3d8817e4Smiod	  && rm -f $$file && $(GMSGFMT) -o $$file $<
77*3d8817e4Smiod
78*3d8817e4Smiod.po.cat:
79*3d8817e4Smiod	sed -f ../intl/po2msg.sed < $< > $*.msg \
80*3d8817e4Smiod	  && rm -f $@ && $(GENCAT) $@ $*.msg
81*3d8817e4Smiod
82*3d8817e4Smiod
83*3d8817e4Smiodall: all-@USE_NLS@
84*3d8817e4Smiod
85*3d8817e4Smiodall-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
86*3d8817e4Smiodall-no:
87*3d8817e4Smiod
88*3d8817e4Smiod$(srcdir)/$(PACKAGE).pot: $(POTFILES)
89*3d8817e4Smiod	$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
90*3d8817e4Smiod	  --add-comments --keyword=_ --keyword=N_ \
91*3d8817e4Smiod	  --files-from=$(srcdir)/POTFILES.in
92*3d8817e4Smiod	rm -f $(srcdir)/$(PACKAGE).pot
93*3d8817e4Smiod	mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
94*3d8817e4Smiod
95*3d8817e4Smiod$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
96*3d8817e4Smiod$(srcdir)/stamp-cat-id: $(PACKAGE).pot
97*3d8817e4Smiod	rm -f cat-id-tbl.tmp
98*3d8817e4Smiod	sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
99*3d8817e4Smiod		| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
100*3d8817e4Smiod	if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
101*3d8817e4Smiod	  rm cat-id-tbl.tmp; \
102*3d8817e4Smiod	else \
103*3d8817e4Smiod	  echo cat-id-tbl.c changed; \
104*3d8817e4Smiod	  rm -f $(srcdir)/cat-id-tbl.c; \
105*3d8817e4Smiod	  mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
106*3d8817e4Smiod	fi
107*3d8817e4Smiod	cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
108*3d8817e4Smiod
109*3d8817e4Smiod
110*3d8817e4Smiodinstall: install-exec install-data
111*3d8817e4Smiodinstall-exec:
112*3d8817e4Smiodinstall-info:
113*3d8817e4Smiodinstall-html:
114*3d8817e4Smiodinstall-data: install-data-@USE_NLS@
115*3d8817e4Smiodinstall-data-no: all
116*3d8817e4Smiodinstall-data-yes: all
117*3d8817e4Smiod	if test -r $(MKINSTALLDIRS); then \
118*3d8817e4Smiod	  $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
119*3d8817e4Smiod	else \
120*3d8817e4Smiod	  $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
121*3d8817e4Smiod	fi
122*3d8817e4Smiod	@catalogs='$(CATALOGS)'; \
123*3d8817e4Smiod	for cat in $$catalogs; do \
124*3d8817e4Smiod	  cat=`basename $$cat`; \
125*3d8817e4Smiod	  case "$$cat" in \
126*3d8817e4Smiod	    *.gmo) destdir=$(gnulocaledir);; \
127*3d8817e4Smiod	    *)     destdir=$(localedir);; \
128*3d8817e4Smiod	  esac; \
129*3d8817e4Smiod	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
130*3d8817e4Smiod	  dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
131*3d8817e4Smiod	  if test -r $(MKINSTALLDIRS); then \
132*3d8817e4Smiod	    $(MKINSTALLDIRS) $$dir; \
133*3d8817e4Smiod	  else \
134*3d8817e4Smiod	    $(top_srcdir)/mkinstalldirs $$dir; \
135*3d8817e4Smiod	  fi; \
136*3d8817e4Smiod	  if test -r $$cat; then \
137*3d8817e4Smiod	    $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
138*3d8817e4Smiod	    echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
139*3d8817e4Smiod	  else \
140*3d8817e4Smiod	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
141*3d8817e4Smiod	    echo "installing $(srcdir)/$$cat as" \
142*3d8817e4Smiod		 "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
143*3d8817e4Smiod	  fi; \
144*3d8817e4Smiod	  if test -r $$cat.m; then \
145*3d8817e4Smiod	    $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
146*3d8817e4Smiod	    echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
147*3d8817e4Smiod	  else \
148*3d8817e4Smiod	    if test -r $(srcdir)/$$cat.m ; then \
149*3d8817e4Smiod	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
150*3d8817e4Smiod		$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
151*3d8817e4Smiod	      echo "installing $(srcdir)/$$cat as" \
152*3d8817e4Smiod		   "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
153*3d8817e4Smiod	    else \
154*3d8817e4Smiod	      true; \
155*3d8817e4Smiod	    fi; \
156*3d8817e4Smiod	  fi; \
157*3d8817e4Smiod	done
158*3d8817e4Smiod	if test "$(PACKAGE)" = "gettext"; then \
159*3d8817e4Smiod	  if test -r $(MKINSTALLDIRS); then \
160*3d8817e4Smiod	    $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
161*3d8817e4Smiod	  else \
162*3d8817e4Smiod	    $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
163*3d8817e4Smiod	  fi; \
164*3d8817e4Smiod	  $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
165*3d8817e4Smiod			  $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
166*3d8817e4Smiod	else \
167*3d8817e4Smiod	  : ; \
168*3d8817e4Smiod	fi
169*3d8817e4Smiod
170*3d8817e4Smiod# Define this as empty until I found a useful application.
171*3d8817e4Smiodinstallcheck:
172*3d8817e4Smiod
173*3d8817e4Smioduninstall:
174*3d8817e4Smiod	catalogs='$(CATALOGS)'; \
175*3d8817e4Smiod	for cat in $$catalogs; do \
176*3d8817e4Smiod	  cat=`basename $$cat`; \
177*3d8817e4Smiod	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
178*3d8817e4Smiod	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
179*3d8817e4Smiod	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
180*3d8817e4Smiod	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
181*3d8817e4Smiod	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
182*3d8817e4Smiod	done
183*3d8817e4Smiod	rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in
184*3d8817e4Smiod
185*3d8817e4Smiodcheck: all
186*3d8817e4Smiod
187*3d8817e4Smiodcat-id-tbl.o: ../intl/libgettext.h
188*3d8817e4Smiod
189*3d8817e4Smiodhtml dvi pdf ps info tags TAGS ID:
190*3d8817e4Smiod
191*3d8817e4Smiodmostlyclean:
192*3d8817e4Smiod	rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
193*3d8817e4Smiod	rm -fr *.o
194*3d8817e4Smiod
195*3d8817e4Smiodclean: mostlyclean
196*3d8817e4Smiod
197*3d8817e4Smioddistclean: clean
198*3d8817e4Smiod	rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
199*3d8817e4Smiod
200*3d8817e4Smiodmaintainer-clean: distclean
201*3d8817e4Smiod	@echo "This command is intended for maintainers to use;"
202*3d8817e4Smiod	@echo "it deletes files that may require special tools to rebuild."
203*3d8817e4Smiod	rm -f $(GMOFILES)
204*3d8817e4Smiod
205*3d8817e4Smioddistdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
206*3d8817e4Smioddist distdir: update-po $(DISTFILES)
207*3d8817e4Smiod	dists="$(DISTFILES)"; \
208*3d8817e4Smiod	for file in $$dists; do \
209*3d8817e4Smiod	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
210*3d8817e4Smiod	    || cp -p $(srcdir)/$$file $(distdir); \
211*3d8817e4Smiod	done
212*3d8817e4Smiod
213*3d8817e4Smiodupdate-po: Makefile
214*3d8817e4Smiod	$(MAKE) $(PACKAGE).pot
215*3d8817e4Smiod	PATH=`pwd`/../src:$$PATH; \
216*3d8817e4Smiod	cd $(srcdir); \
217*3d8817e4Smiod	catalogs='$(CATALOGS)'; \
218*3d8817e4Smiod	for cat in $$catalogs; do \
219*3d8817e4Smiod	  cat=`basename $$cat`; \
220*3d8817e4Smiod	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
221*3d8817e4Smiod	  mv $$lang.po $$lang.old.po; \
222*3d8817e4Smiod	  echo "$$lang:"; \
223*3d8817e4Smiod	  if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
224*3d8817e4Smiod	    rm -f $$lang.old.po; \
225*3d8817e4Smiod	  else \
226*3d8817e4Smiod	    echo "msgmerge for $$cat failed!"; \
227*3d8817e4Smiod	    rm -f $$lang.po; \
228*3d8817e4Smiod	    mv $$lang.old.po $$lang.po; \
229*3d8817e4Smiod	  fi; \
230*3d8817e4Smiod	done
231*3d8817e4Smiod
232*3d8817e4SmiodPOTFILES: POTFILES.in
233*3d8817e4Smiod	( if test 'x$(srcdir)' != 'x.'; then \
234*3d8817e4Smiod	    posrcprefix='$(top_srcdir)/'; \
235*3d8817e4Smiod	  else \
236*3d8817e4Smiod	    posrcprefix="../"; \
237*3d8817e4Smiod	  fi; \
238*3d8817e4Smiod	  rm -f $@-t $@ \
239*3d8817e4Smiod	    && (sed -e '/^#/d' -e '/^[ 	]*$$/d' \
240*3d8817e4Smiod		    -e "s@.*@	$$posrcprefix& \\\\@" < $(srcdir)/$@.in \
241*3d8817e4Smiod		| sed -e '$$s/\\$$//') > $@-t \
242*3d8817e4Smiod	    && chmod a-w $@-t \
243*3d8817e4Smiod	    && mv $@-t $@ )
244*3d8817e4Smiod
245*3d8817e4SmiodPOTFILES.in: @MAINT@ ../Makefile
246*3d8817e4Smiod	cd .. && $(MAKE) po/POTFILES.in
247*3d8817e4Smiod
248*3d8817e4SmiodMakefile: Make-in ../config.status POTFILES
249*3d8817e4Smiod	cd .. \
250*3d8817e4Smiod	  && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
251*3d8817e4Smiod	     CONFIG_HEADERS= $(SHELL) ./config.status
252*3d8817e4Smiod
253*3d8817e4Smiod# Tell versions [3.59,3.63) of GNU make not to export all variables.
254*3d8817e4Smiod# Otherwise a system limit (for SysV at least) may be exceeded.
255*3d8817e4Smiod.NOEXPORT:
256