1# Makefile for directory with message catalog handling in GNU NLS Utilities.
2# Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
3#
4# This program is free software; you can redistribute it and/or modify it
5# under the terms of the GNU Library General Public License as published
6# by 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 GNU
12# Library General Public License for more details.
13#
14# You should have received a copy of the GNU Library General Public
15# License along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17# USA.
18
19PACKAGE = grep
20VERSION = 2.5.1
21
22SHELL = /bin/sh
23
24srcdir = .
25top_srcdir = ..
26top_builddir = ..
27
28
29prefix = /usr/local
30exec_prefix = ${prefix}
31transform = s,x,x,
32libdir = ${exec_prefix}/lib
33includedir = ${prefix}/include
34datadir = ${prefix}/share
35localedir = $(datadir)/locale
36gettextsrcdir = $(datadir)/gettext/intl
37aliaspath = $(localedir)
38subdir = intl
39
40INSTALL = /usr/bin/install -c
41INSTALL_DATA = ${INSTALL} -m 644
42MKINSTALLDIRS = ./mkinstalldirs
43mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
44
45l = 
46
47AR = ar
48CC = gcc
49LIBTOOL = @LIBTOOL@
50RANLIB = ranlib
51YACC = bison -y -d
52YFLAGS = --name-prefix=__gettext
53
54DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
55-DLIBDIR=\"$(libdir)\" -DIN_LIBINTL -DHAVE_CONFIG_H
56CPPFLAGS = 
57CFLAGS = -g -O2 -I/usr/include/pcre
58LDFLAGS = 
59
60COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
61
62HEADERS = $(COMHDRS) libgnuintl.h loadinfo.h
63COMHDRS = gmo.h gettextP.h hash-string.h plural-exp.h eval-plural.h os2compat.h
64SOURCES = $(COMSRCS) intl-compat.c
65COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
66finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
67explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
68plural-exp.c localcharset.c localename.c osdep.c os2compat.c
69OBJECTS =  bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
70finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
71explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \
72plural.$lo plural-exp.$lo localcharset.$lo localename.$lo osdep.$lo
73GETTOBJS = intl-compat.$lo
74DISTFILES.common = Makefile.in \
75config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
76DISTFILES.generated = plural.c
77DISTFILES.normal = VERSION
78DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc
79DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
80COPYING.LIB-2 gettext.h libgettext.h plural-eval.c
81
82# Libtool's library version information for libintl.
83# Before making a gettext release, the gettext maintainer must change this
84# according to the libtool documentation, section "Library interface versions".
85# Maintainers of other packages that include the intl directory must *not*
86# change these values.
87LTV_CURRENT=2
88LTV_REVISION=0
89LTV_AGE=0
90
91.SUFFIXES:
92.SUFFIXES: .c .y .o .lo .sin .sed
93.c.o:
94	$(COMPILE) $<
95.c.lo:
96	$(LIBTOOL) --mode=compile $(COMPILE) $<
97
98.y.c:
99	$(YACC) $(YFLAGS) --output $@ $<
100	rm -f $*.h
101
102.sin.sed:
103	sed -e '/^#/d' -e 's/@''PACKAGE''@/grep/g' $< > t-$@
104	mv t-$@ $@
105
106INCLUDES = -I.. -I. -I$(top_srcdir)/intl
107
108all: all-no
109all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
110all-no: all-no-no
111all-no-yes: libgnuintl.$la
112all-no-no:
113
114libintl.a libgnuintl.a: $(OBJECTS)
115	rm -f $@
116	$(AR) cru $@ $(OBJECTS)
117	$(RANLIB) $@
118
119libintl.la libgnuintl.la: $(OBJECTS)
120	$(LIBTOOL) --mode=link \
121	  $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
122	  $(OBJECTS) @LTLIBICONV@ -lc \
123	  -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
124	  -rpath $(libdir) \
125	  -no-undefined
126
127libintl.h: libgnuintl.h
128	cp $(srcdir)/libgnuintl.h libintl.h
129
130charset.alias: config.charset
131	$(SHELL) $(srcdir)/config.charset 'i686-pc-linux-gnu' > t-$@
132	mv t-$@ $@
133
134check: all
135
136# This installation goal is only used in GNU gettext.  Packages which
137# only use the library should use install instead.
138
139# We must not install the libintl.h/libintl.a files if we are on a
140# system which has the GNU gettext() function in its C library or in a
141# separate library.
142# If you want to use the one which comes with this version of the
143# package, you have to use `configure --with-included-gettext'.
144install: install-exec install-data
145install-exec: all
146	if test "$(PACKAGE)" = "gettext" \
147	   && test '' = '$(GETTOBJS)'; then \
148	  $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
149	  $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
150	  $(LIBTOOL) --mode=install \
151	    $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
152	else \
153	  : ; \
154	fi
155	if test 'no' = yes; then \
156	  test yes != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
157	  temp=$(DESTDIR)$(libdir)/t-charset.alias; \
158	  dest=$(DESTDIR)$(libdir)/charset.alias; \
159	  if test -f $(DESTDIR)$(libdir)/charset.alias; then \
160	    orig=$(DESTDIR)$(libdir)/charset.alias; \
161	    sed -f ref-add.sed $$orig > $$temp; \
162	    $(INSTALL_DATA) $$temp $$dest; \
163	    rm -f $$temp; \
164	  else \
165	    if test yes = no; then \
166	      orig=charset.alias; \
167	      sed -f ref-add.sed $$orig > $$temp; \
168	      $(INSTALL_DATA) $$temp $$dest; \
169	      rm -f $$temp; \
170	    fi; \
171	  fi; \
172	  $(mkinstalldirs) $(DESTDIR)$(localedir); \
173	  test -f $(DESTDIR)$(localedir)/locale.alias \
174	    && orig=$(DESTDIR)$(localedir)/locale.alias \
175	    || orig=$(srcdir)/locale.alias; \
176	  temp=$(DESTDIR)$(localedir)/t-locale.alias; \
177	  dest=$(DESTDIR)$(localedir)/locale.alias; \
178	  sed -f ref-add.sed $$orig > $$temp; \
179	  $(INSTALL_DATA) $$temp $$dest; \
180	  rm -f $$temp; \
181	else \
182	  : ; \
183	fi
184install-data: all
185	if test "$(PACKAGE)" = "gettext"; then \
186	  $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
187	  $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
188	  $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
189	  dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
190	  for file in $$dists; do \
191	    $(INSTALL_DATA) $(srcdir)/$$file \
192			    $(DESTDIR)$(gettextsrcdir)/$$file; \
193	  done; \
194	  chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
195	  dists="$(DISTFILES.generated)"; \
196	  for file in $$dists; do \
197	    if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
198	    $(INSTALL_DATA) $$dir/$$file \
199			    $(DESTDIR)$(gettextsrcdir)/$$file; \
200	  done; \
201	  dists="$(DISTFILES.obsolete)"; \
202	  for file in $$dists; do \
203	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
204	  done; \
205	else \
206	  : ; \
207	fi
208
209install-strip: install
210
211installdirs:
212	if test "$(PACKAGE)" = "gettext" \
213	   && test '' = '$(GETTOBJS)'; then \
214	  $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
215	else \
216	  : ; \
217	fi
218	if test 'no' = yes; then \
219	  test yes != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
220	  $(mkinstalldirs) $(DESTDIR)$(localedir); \
221	else \
222	  : ; \
223	fi
224	if test "$(PACKAGE)" = "gettext"; then \
225	  $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
226	else \
227	  : ; \
228	fi
229
230# Define this as empty until I found a useful application.
231installcheck:
232
233uninstall:
234	if test "$(PACKAGE)" = "gettext" \
235	   && test '' = '$(GETTOBJS)'; then \
236	  rm -f $(DESTDIR)$(includedir)/libintl.h; \
237	  $(LIBTOOL) --mode=uninstall \
238	    rm -f $(DESTDIR)$(libdir)/libintl.$la; \
239	else \
240	  : ; \
241	fi
242	if test 'no' = yes; then \
243	  if test -f $(DESTDIR)$(libdir)/charset.alias; then \
244	    temp=$(DESTDIR)$(libdir)/t-charset.alias; \
245	    dest=$(DESTDIR)$(libdir)/charset.alias; \
246	    sed -f ref-del.sed $$dest > $$temp; \
247	    if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
248	      rm -f $$dest; \
249	    else \
250	      $(INSTALL_DATA) $$temp $$dest; \
251	    fi; \
252	    rm -f $$temp; \
253	  fi; \
254	  if test -f $(DESTDIR)$(localedir)/locale.alias; then \
255	    temp=$(DESTDIR)$(localedir)/t-locale.alias; \
256	    dest=$(DESTDIR)$(localedir)/locale.alias; \
257	    sed -f ref-del.sed $$dest > $$temp; \
258	    if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
259	      rm -f $$dest; \
260	    else \
261	      $(INSTALL_DATA) $$temp $$dest; \
262	    fi; \
263	    rm -f $$temp; \
264	  fi; \
265	else \
266	  : ; \
267	fi
268	if test "$(PACKAGE)" = "gettext"; then \
269	  for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
270	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
271	  done; \
272	else \
273	  : ; \
274	fi
275
276info dvi:
277
278$(OBJECTS): ../config.h libgnuintl.h
279bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: gettextP.h gmo.h loadinfo.h
280dcigettext.$lo: hash-string.h
281explodename.$lo l10nflist.$lo: loadinfo.h
282dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: plural-exp.h
283dcigettext.$lo: eval-plural.h
284
285tags: TAGS
286
287TAGS: $(HEADERS) $(SOURCES)
288	here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
289
290id: ID
291
292ID: $(HEADERS) $(SOURCES)
293	here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
294
295
296mostlyclean:
297	rm -f *.a *.la *.o *.lo core core.*
298	rm -f libintl.h charset.alias ref-add.sed ref-del.sed
299	rm -f -r .libs _libs
300
301clean: mostlyclean
302
303distclean: clean
304	rm -f Makefile ID TAGS
305	if test "$(PACKAGE)" = gettext; then \
306	  rm -f ChangeLog.inst $(DISTFILES.normal); \
307	else \
308	  : ; \
309	fi
310
311maintainer-clean: distclean
312	@echo "This command is intended for maintainers to use;"
313	@echo "it deletes files that may require special tools to rebuild."
314
315
316# GNU gettext needs not contain the file `VERSION' but contains some
317# other files which should not be distributed in other packages.
318distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
319dist distdir: Makefile
320	if test "$(PACKAGE)" = gettext; then \
321	  additional="$(DISTFILES.gettext)"; \
322	else \
323	  additional="$(DISTFILES.normal)"; \
324	fi; \
325	$(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
326	for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
327	  if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
328	  cp -p $$dir/$$file $(distdir); \
329	done
330
331Makefile: Makefile.in ../config.status
332	cd .. \
333	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
334
335# Tell versions [3.59,3.63) of GNU make not to export all variables.
336# Otherwise a system limit (for SysV at least) may be exceeded.
337.NOEXPORT:
338