Makefile.in.in revision 1.3
1# Makefile for program source directory in GNU NLS utilities package.
2# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 2, or (at your option)
7# any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18PACKAGE = @PACKAGE@
19VERSION = @VERSION@
20
21SHELL = /bin/sh
22@SET_MAKE@
23
24srcdir = @srcdir@
25top_srcdir = @top_srcdir@
26VPATH = @srcdir@
27
28prefix = @prefix@
29exec_prefix = @exec_prefix@
30datadir = $(prefix)/@DATADIRNAME@
31localedir = $(datadir)/locale
32gnulocaledir = $(prefix)/share/locale
33gettextsrcdir = $(prefix)/share/gettext/po
34subdir = po
35
36INSTALL = @INSTALL@
37INSTALL_DATA = @INSTALL_DATA@
38MKINSTALLDIRS = @MKINSTALLDIRS@
39
40CC = @CC@
41GENCAT = @GENCAT@
42GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
43MSGFMT = @MSGFMT@
44XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
45MSGMERGE = PATH=../src:$$PATH msgmerge
46
47DEFS = @DEFS@
48CFLAGS = @CFLAGS@
49CPPFLAGS = @CPPFLAGS@
50
51INCLUDES = -I.. -I$(top_srcdir)/intl
52
53COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
54
55SOURCES = cat-id-tbl.c
56POFILES = @POFILES@
57GMOFILES = @GMOFILES@
58DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
59stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
60
61POTFILES = \
62
63CATALOGS = @CATALOGS@
64CATOBJEXT = @CATOBJEXT@
65INSTOBJEXT = @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
89all: all-@USE_NLS@
90
91all-yes: cat-id-tbl.c $(CATALOGS)
92all-no:
93
94$(srcdir)/$(PACKAGE).pot: $(POTFILES)
95	$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
96	  --add-comments --keyword=_ --keyword=N_ \
97	  --files-from=$(srcdir)/POTFILES.in
98	if [ ! -s $(PACKAGE).po ] \
99	  || cmp -s $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; then \
100	  rm -f $(PACKAGE).po; \
101	else \
102	  rm -f $(srcdir)/$(PACKAGE).pot \
103	    && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; \
104	fi
105
106$(srcdir)/cat-id-tbl.c: stamp-cat-id
107$(srcdir)/stamp-cat-id: $(PACKAGE).pot
108	rm -f cat-id-tbl.tmp
109	sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
110		| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
111	if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
112	  rm cat-id-tbl.tmp; \
113	else \
114	  echo cat-id-tbl.c changed; \
115	  rm -f $(srcdir)/cat-id-tbl.c; \
116	  mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
117	fi
118	cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
119
120
121install: install-exec install-data
122install-exec:
123install-data: install-data-@USE_NLS@
124install-data-no: all
125install-data-yes: all
126	if test -r $(MKINSTALLDIRS); then \
127	  $(MKINSTALLDIRS) $(datadir); \
128	else \
129	  $(top_srcdir)/mkinstalldirs $(datadir); \
130	fi
131	@catalogs='$(CATALOGS)'; \
132	for cat in $$catalogs; do \
133	  cat=`basename $$cat`; \
134	  case "$$cat" in \
135	    *.gmo) destdir=$(gnulocaledir);; \
136	    *)     destdir=$(localedir);; \
137	  esac; \
138	  lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
139	  dir=$$destdir/$$lang/LC_MESSAGES; \
140	  if test -r $(MKINSTALLDIRS); then \
141	    $(MKINSTALLDIRS) $$dir; \
142	  else \
143	    $(top_srcdir)/mkinstalldirs $$dir; \
144	  fi; \
145	  if test -r $$cat; then \
146	    $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
147	    echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
148	  else \
149	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
150	    echo "installing $(srcdir)/$$cat as" \
151		 "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
152	  fi; \
153	  if test -r $$cat.m; then \
154	    $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
155	    echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
156	  else \
157	    if test -r $(srcdir)/$$cat.m ; then \
158	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
159		$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
160	      echo "installing $(srcdir)/$$cat as" \
161		   "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
162	    else \
163	      true; \
164	    fi; \
165	  fi; \
166	done
167	if test "$(PACKAGE)" = "gettext"; then \
168	  if test -r $(MKINSTALLDIRS); then \
169	    $(MKINSTALLDIRS) $(gettextsrcdir); \
170	  else \
171	    $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
172	  fi; \
173	  cd $(srcdir) && \
174	    $(INSTALL_DATA) Makefile.in.in $(gettextsrcdir)/Makefile.in.in; \
175	else \
176	  : ; \
177	fi
178
179# Define this as empty until I found a useful application.
180installcheck:
181
182uninstall:
183	catalogs='$(CATALOGS)'; \
184	for cat in $$catalogs; do \
185	  lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
186	  rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
187	  rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
188	  rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
189	  rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
190	done
191	rm -f $(gettextsrcdir)/po-Makefile.in.in
192
193check: all
194
195cat-id-tbl.o: ../intl/libgettext.h
196
197dvi info tags TAGS ID:
198
199mostlyclean:
200	rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
201	rm -fr *.o
202
203clean: mostlyclean
204
205distclean: clean
206	rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
207
208maintainer-clean: distclean
209	@echo "This command is intended for maintainers to use;"
210	@echo "it deletes files that may require special tools to rebuild."
211
212distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
213dist distdir: update-po $(DISTFILES)
214	dists="$(DISTFILES)"; \
215	for file in $$dists; do \
216	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
217	    || cp -p $(srcdir)/$$file $(distdir); \
218	done
219
220update-po: Makefile
221	$(MAKE) $(PACKAGE).pot
222	PATH=`pwd`/../src:$$PATH; \
223	cd $(srcdir); \
224	catalogs='$(CATALOGS)'; \
225	for cat in $$catalogs; do \
226	  lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
227	  mv $$lang.po $$lang.old.po; \
228	  echo "$$lang:"; \
229	  if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
230	    rm -f $$lang.old.po; \
231	  else \
232	    echo "msgmerge for $$cat failed!"; \
233	    rm -f $$lang.po; \
234	    mv $$lang.old.po $$lang.po; \
235	  fi; \
236	done
237
238POTFILES: POTFILES.in
239	( if test 'x$(srcdir)' != 'x.'; then \
240	    posrcprefix='$(top_srcdir)/'; \
241	  else \
242	    posrcprefix="../"; \
243	  fi; \
244	  sed -e '/^#/d' -e '/^[ 	]*$$/d' \
245	      -e "s@.*@	$$posrcprefix& \\\\@" \
246	      -e '$$s/\(.*\) \\/\1/' < $(srcdir)/POTFILES.in > POTFILES )
247
248Makefile: Makefile.in.in ../config.status POTFILES
249	cd .. \
250	  && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
251	       $(SHELL) ./config.status
252
253# Tell versions [3.59,3.63) of GNU make not to export all variables.
254# Otherwise a system limit (for SysV at least) may be exceeded.
255.NOEXPORT:
256