1227569Sphilip# Makefile for program source directory in GNU NLS utilities package.
2227569Sphilip# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
3227569Sphilip# Copyright 2003, 2006 Free Software Foundation, Inc.
4227569Sphilip#
5227569Sphilip# This file may be copied and used freely without restrictions.  It can
6227569Sphilip# be used in projects which are not available under the GNU Public License
7227569Sphilip# but which still want to provide support for the GNU gettext functionality.
8227569Sphilip# Please note that the actual code is *not* freely available.
9227569Sphilip
10227569SphilipPACKAGE = @PACKAGE@
11227569SphilipVERSION = @VERSION@
12227569Sphilip
13227569SphilipSHELL = /bin/sh
14227569Sphilip@SET_MAKE@
15227569Sphilip
16227569Sphilipsrcdir = @srcdir@
17227569Sphiliptop_srcdir = @top_srcdir@
18227569SphilipVPATH = @srcdir@
19227569Sphiliptop_builddir = @top_builddir@
20227569Sphilip
21227569Sphilipprefix = @prefix@
22227569Sphilipexec_prefix = @exec_prefix@
23227569Sphilipdatadir = $(prefix)/@DATADIRNAME@
24227569Sphiliplocaledir = $(datadir)/locale
25227569Sphilipgnulocaledir = $(prefix)/share/locale
26227569Sphilipgettextsrcdir = $(prefix)/share/gettext/po
27227569Sphilipsubdir = po
28227569Sphilip
29227569SphilipDESTDIR =
30265884Sgnn
31265884SgnnINSTALL = @INSTALL@
32265884SgnnINSTALL_DATA = @INSTALL_DATA@
33265884SgnnMKINSTALLDIRS = @MKINSTALLDIRS@
34265884Sgnn
35265884SgnnCC = @CC@
36265884SgnnGENCAT = @GENCAT@
37265884SgnnGMSGFMT = PATH=../src:$$PATH @GMSGFMT@
38265884SgnnMSGFMT = @MSGFMT@
39265884SgnnXGETTEXT = PATH=../src:$$PATH @XGETTEXT@
40265884SgnnMSGMERGE = PATH=../src:$$PATH msgmerge
41265884Sgnn
42265884SgnnDEFS = @DEFS@
43265884SgnnCFLAGS = @CFLAGS@
44265884SgnnCPPFLAGS = @CPPFLAGS@
45227569Sphilip
46227569SphilipINCLUDES = -I.. -I$(top_srcdir)/intl
47227569Sphilip
48227569SphilipCOMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
49227569Sphilip
50227569SphilipSOURCES = cat-id-tbl.c
51227569SphilipPOFILES = @POFILES@
52227569SphilipGMOFILES = @GMOFILES@
53227569SphilipDISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
54227569Sphilipstamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
55227569Sphilip
56227569SphilipPOTFILES = \
57227569Sphilip
58227569SphilipCATALOGS = @CATALOGS@
59227569SphilipCATOBJEXT = @CATOBJEXT@
60227569SphilipINSTOBJEXT = @INSTOBJEXT@
61227569Sphilip
62227569Sphilip.SUFFIXES:
63227569Sphilip.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
64227569Sphilip
65227569Sphilip.c.o:
66227569Sphilip	$(COMPILE) $<
67227569Sphilip
68227569Sphilip.po.pox:
69227569Sphilip	$(MAKE) $(PACKAGE).pot
70227569Sphilip	$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
71227569Sphilip
72227569Sphilip.po.mo:
73227569Sphilip	$(MSGFMT) -o $@ $<
74227569Sphilip
75227569Sphilip.po.gmo:
76227569Sphilip	file=`echo $* | sed 's,.*/,,'`.gmo \
77227569Sphilip	  && rm -f $$file && $(GMSGFMT) -o $$file $<
78227569Sphilip
79227569Sphilip.po.cat:
80227569Sphilip	sed -f ../intl/po2msg.sed < $< > $*.msg \
81227569Sphilip	  && rm -f $@ && $(GENCAT) $@ $*.msg
82227569Sphilip
83227569Sphilip
84227569Sphilipall: all-@USE_NLS@
85227569Sphilip
86227569Sphilipall-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
87227569Sphilipall-no:
88227569Sphilip
89227569Sphilip$(srcdir)/$(PACKAGE).pot: $(POTFILES)
90227569Sphilip	$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
91227569Sphilip	  --add-comments --keyword=_ --keyword=N_ \
92227569Sphilip	  --files-from=$(srcdir)/POTFILES.in
93227569Sphilip	rm -f $(srcdir)/$(PACKAGE).pot
94227569Sphilip	mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
95227569Sphilip
96227569Sphilip$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
97227569Sphilip$(srcdir)/stamp-cat-id: $(PACKAGE).pot
98227569Sphilip	rm -f cat-id-tbl.tmp
99227569Sphilip	sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
100227569Sphilip		| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
101227569Sphilip	if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
102227569Sphilip	  rm cat-id-tbl.tmp; \
103227569Sphilip	else \
104227569Sphilip	  echo cat-id-tbl.c changed; \
105227569Sphilip	  rm -f $(srcdir)/cat-id-tbl.c; \
106227569Sphilip	  mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
107227569Sphilip	fi
108227569Sphilip	cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
109227569Sphilip
110227569Sphilip
111227569Sphilipinstall: install-exec install-data
112227569Sphilipinstall-exec:
113227569Sphilipinstall-info:
114227569Sphilipinstall-html:
115227569Sphilipinstall-data: install-data-@USE_NLS@
116227569Sphilipinstall-data-no: all
117227569Sphilipinstall-data-yes: all
118227569Sphilip	if test -r $(MKINSTALLDIRS); then \
119227569Sphilip	  $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
120227569Sphilip	else \
121227569Sphilip	  $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
122227569Sphilip	fi
123227569Sphilip	@catalogs='$(CATALOGS)'; \
124227569Sphilip	for cat in $$catalogs; do \
125227569Sphilip	  cat=`basename $$cat`; \
126227569Sphilip	  case "$$cat" in \
127227569Sphilip	    *.gmo) destdir=$(gnulocaledir);; \
128227569Sphilip	    *)     destdir=$(localedir);; \
129227569Sphilip	  esac; \
130227569Sphilip	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
131227569Sphilip	  dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
132227569Sphilip	  if test -r $(MKINSTALLDIRS); then \
133227569Sphilip	    $(MKINSTALLDIRS) $$dir; \
134227569Sphilip	  else \
135227569Sphilip	    $(top_srcdir)/mkinstalldirs $$dir; \
136227569Sphilip	  fi; \
137227569Sphilip	  if test -r $$cat; then \
138227569Sphilip	    $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
139227569Sphilip	    echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
140227569Sphilip	  else \
141227569Sphilip	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
142227569Sphilip	    echo "installing $(srcdir)/$$cat as" \
143227569Sphilip		 "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
144227569Sphilip	  fi; \
145227569Sphilip	  if test -r $$cat.m; then \
146227569Sphilip	    $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
147227569Sphilip	    echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
148227569Sphilip	  else \
149227569Sphilip	    if test -r $(srcdir)/$$cat.m ; then \
150227569Sphilip	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
151227569Sphilip		$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
152227569Sphilip	      echo "installing $(srcdir)/$$cat as" \
153227640Smarius		   "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
154227569Sphilip	    else \
155227569Sphilip	      true; \
156227569Sphilip	    fi; \
157227569Sphilip	  fi; \
158227569Sphilip	done
159227569Sphilip	if test "$(PACKAGE)" = "gettext"; then \
160227569Sphilip	  if test -r $(MKINSTALLDIRS); then \
161227569Sphilip	    $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
162227569Sphilip	  else \
163227569Sphilip	    $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
164227569Sphilip	  fi; \
165227569Sphilip	  $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
166227569Sphilip			  $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
167227569Sphilip	else \
168227569Sphilip	  : ; \
169227569Sphilip	fi
170227569Sphilip
171227569Sphilip# Define this as empty until I found a useful application.
172227569Sphilipinstallcheck:
173227569Sphilip
174227569Sphilipuninstall:
175227569Sphilip	catalogs='$(CATALOGS)'; \
176227569Sphilip	for cat in $$catalogs; do \
177227569Sphilip	  cat=`basename $$cat`; \
178227569Sphilip	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
179227569Sphilip	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
180227569Sphilip	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
181227569Sphilip	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
182227569Sphilip	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
183227569Sphilip	done
184227569Sphilip	rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in
185227569Sphilip
186227569Sphilipcheck: all
187227569Sphilip
188227569Sphilipcat-id-tbl.o: ../intl/libgettext.h
189227569Sphilip
190227569Sphiliphtml dvi pdf ps info tags TAGS ID:
191227569Sphilip
192227569Sphilipmostlyclean:
193227569Sphilip	rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
194227569Sphilip	rm -fr *.o
195227569Sphilip
196227569Sphilipclean: mostlyclean
197227569Sphilip
198227569Sphilipdistclean: clean
199227569Sphilip	rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
200227569Sphilip
201227569Sphilipmaintainer-clean: distclean
202227569Sphilip	@echo "This command is intended for maintainers to use;"
203227569Sphilip	@echo "it deletes files that may require special tools to rebuild."
204227569Sphilip	rm -f $(GMOFILES)
205227569Sphilip
206227569Sphilipdistdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
207227569Sphilipdist distdir: update-po $(DISTFILES)
208227569Sphilip	dists="$(DISTFILES)"; \
209227569Sphilip	for file in $$dists; do \
210227569Sphilip	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
211227569Sphilip	    || cp -p $(srcdir)/$$file $(distdir); \
212227569Sphilip	done
213227569Sphilip
214227569Sphilipupdate-po: Makefile
215227569Sphilip	$(MAKE) $(PACKAGE).pot
216227569Sphilip	PATH=`pwd`/../src:$$PATH; \
217227569Sphilip	cd $(srcdir); \
218227569Sphilip	catalogs='$(CATALOGS)'; \
219227569Sphilip	for cat in $$catalogs; do \
220227569Sphilip	  cat=`basename $$cat`; \
221227569Sphilip	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
222227569Sphilip	  mv $$lang.po $$lang.old.po; \
223227569Sphilip	  echo "$$lang:"; \
224227569Sphilip	  if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
225227569Sphilip	    rm -f $$lang.old.po; \
226227569Sphilip	  else \
227227569Sphilip	    echo "msgmerge for $$cat failed!"; \
228227569Sphilip	    rm -f $$lang.po; \
229227569Sphilip	    mv $$lang.old.po $$lang.po; \
230227569Sphilip	  fi; \
231227569Sphilip	done
232227569Sphilip
233227569SphilipPOTFILES: POTFILES.in
234227569Sphilip	( if test 'x$(srcdir)' != 'x.'; then \
235227569Sphilip	    posrcprefix='$(top_srcdir)/'; \
236227569Sphilip	  else \
237227569Sphilip	    posrcprefix="../"; \
238227569Sphilip	  fi; \
239227569Sphilip	  rm -f $@-t $@ \
240227569Sphilip	    && (sed -e '/^#/d' -e '/^[ 	]*$$/d' \
241227569Sphilip		    -e "s@.*@	$$posrcprefix& \\\\@" < $(srcdir)/$@.in \
242227569Sphilip		| sed -e '$$s/\\$$//') > $@-t \
243227569Sphilip	    && chmod a-w $@-t \
244227569Sphilip	    && mv $@-t $@ )
245227569Sphilip
246227569SphilipPOTFILES.in: @MAINT@ ../Makefile
247227569Sphilip	cd .. && $(MAKE) po/POTFILES.in
248227569Sphilip
249227569SphilipMakefile: Make-in ../config.status POTFILES
250227569Sphilip	cd .. \
251227569Sphilip	  && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
252227569Sphilip	     CONFIG_HEADERS= $(SHELL) ./config.status
253227569Sphilip
254227569Sphilip# Tell versions [3.59,3.63) of GNU make not to export all variables.
255227569Sphilip# Otherwise a system limit (for SysV at least) may be exceeded.
256227569Sphilip.NOEXPORT:
257227569Sphilip