xref: /openbsd/gnu/usr.bin/gcc/gcc/intl/Makefile.in (revision 404b540a)
1# Makefile for directory with message catalog handling in GNU NLS Utilities.
2# Copyright (C) 1995-1998, 2000, 2001 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 = @PACKAGE@
20VERSION = @VERSION@
21
22SHELL = /bin/sh
23
24srcdir = @srcdir@
25top_srcdir = @top_srcdir@
26top_builddir = ..
27VPATH = @srcdir@
28
29prefix = @prefix@
30exec_prefix = @exec_prefix@
31transform = @program_transform_name@
32libdir = @libdir@
33includedir = @includedir@
34datadir = @datadir@
35localedir = $(datadir)/locale
36gettextsrcdir = $(datadir)/gettext/intl
37aliaspath = $(localedir)
38subdir = intl
39
40INSTALL = @INSTALL@
41INSTALL_DATA = @INSTALL_DATA@
42MKINSTALLDIRS = @MKINSTALLDIRS@
43mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
44
45l = @INTL_LIBTOOL_SUFFIX_PREFIX@
46OUTPUT_OPTION = @OUTPUT_OPTION@
47
48AR = ar
49CC = @CC@
50LIBTOOL = @LIBTOOL@
51RANLIB = @RANLIB@
52YACC = @INTLBISON@ -y -d
53YFLAGS = --name-prefix=__gettext
54
55DEFS = -DIN_GCC -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
56-DLIBDIR=\"$(libdir)\" @DEFS@
57CPPFLAGS = @CPPFLAGS@
58CFLAGS = @CFLAGS@
59LDFLAGS = @LDFLAGS@
60
61COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
62
63HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h
64COMHDRS = gettext.h gettextP.h hash-string.h
65SOURCES = $(COMSRCS) intl-compat.c
66COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
67finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
68explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
69localcharset.c
70OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
71finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
72explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \
73plural.$lo localcharset.$lo
74GETTOBJS = intl-compat.$lo
75DISTFILES.common = Makefile.in \
76config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
77DISTFILES.generated = plural.c
78DISTFILES.normal = VERSION
79DISTFILES.gettext = COPYING.LIB-2 COPYING.LIB-2.1 libintl.glibc
80DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.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=1
88LTV_REVISION=1
89LTV_AGE=0
90
91.SUFFIXES:
92.SUFFIXES: .c .y .o .lo .sin .sed
93.c.o:
94	$(COMPILE) $< $(OUTPUT_OPTION)
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''@/@PACKAGE@/g' $< > t-$@
104	mv t-$@ $@
105
106INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir) \
107	   -I$(top_srcdir)/config -I$(top_srcdir)/../include
108
109# GCC LOCAL: Removed libintl.h from all-yes.
110all: all-@USE_INCLUDED_LIBINTL@
111all-yes: libintl.$la charset.alias ref-add.sed ref-del.sed
112all-no: all-no-@BUILD_INCLUDED_LIBINTL@
113all-no-yes: libgnuintl.$la
114all-no-no:
115
116libintl.a libgnuintl.a: $(OBJECTS)
117	rm -f $@
118	$(AR) cru $@ $(OBJECTS)
119	$(RANLIB) $@
120
121libintl.la libgnuintl.la: $(OBJECTS)
122	$(LIBTOOL) --mode=link \
123	  $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
124	  $(OBJECTS) @LIBICONV@ \
125	  -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
126	  -rpath $(libdir) \
127	  -no-undefined
128
129#GCC LOCAL: Do not install this file.
130#libintl.h: libgnuintl.h
131#	cp $(srcdir)/libgnuintl.h libintl.h
132
133charset.alias: config.charset
134	$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
135	mv t-$@ $@
136
137check: all
138
139# This installation goal is only used in GNU gettext.  Packages which
140# only use the library should use install instead.
141
142# We must not install the libintl.h/libintl.a files if we are on a
143# system which has the GNU gettext() function in its C library or in a
144# separate library.
145# If you want to use the one which comes with this version of the
146# package, you have to use `configure --with-included-gettext'.
147install: install-exec install-data
148install-exec: all
149	if test "$(PACKAGE)" = "gettext" \
150	   && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
151	  $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
152	  $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
153	  $(LIBTOOL) --mode=install \
154	    $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
155	else \
156	  : ; \
157	fi
158	if test '@USE_INCLUDED_LIBINTL@' = yes; then \
159	  $(mkinstalldirs) $(DESTDIR)$(libdir); \
160	  temp=$(DESTDIR)$(libdir)/t-charset.alias; \
161	  dest=$(DESTDIR)$(libdir)/charset.alias; \
162	  if test -f $(DESTDIR)$(libdir)/charset.alias; then \
163	    orig=$(DESTDIR)$(libdir)/charset.alias; \
164	    sed -f ref-add.sed $$orig > $$temp; \
165	    $(INSTALL_DATA) $$temp $$dest; \
166	    rm -f $$temp; \
167	  else \
168	    if test @GLIBC21@ = no; then \
169	      orig=charset.alias; \
170	      sed -f ref-add.sed $$orig > $$temp; \
171	      $(INSTALL_DATA) $$temp $$dest; \
172	      rm -f $$temp; \
173	    fi; \
174	  fi; \
175	  $(mkinstalldirs) $(DESTDIR)$(localedir); \
176	  test -f $(DESTDIR)$(localedir)/locale.alias \
177	    && orig=$(DESTDIR)$(localedir)/locale.alias \
178	    || orig=$(srcdir)/locale.alias; \
179	  temp=$(DESTDIR)$(localedir)/t-locale.alias; \
180	  dest=$(DESTDIR)$(localedir)/locale.alias; \
181	  sed -f ref-add.sed $$orig > $$temp; \
182	  $(INSTALL_DATA) $$temp $$dest; \
183	  rm -f $$temp; \
184	else \
185	  : ; \
186	fi
187install-data: all
188	if test "$(PACKAGE)" = "gettext"; then \
189	  $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
190	  $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
191	  $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
192	  dists="COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common)"; \
193	  for file in $$dists; do \
194	    $(INSTALL_DATA) $(srcdir)/$$file \
195			    $(DESTDIR)$(gettextsrcdir)/$$file; \
196	  done; \
197	  chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
198	  dists="$(DISTFILES.generated)"; \
199	  for file in $$dists; do \
200	    if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
201	    $(INSTALL_DATA) $$dir/$$file \
202			    $(DESTDIR)$(gettextsrcdir)/$$file; \
203	  done; \
204	  dists="$(DISTFILES.obsolete)"; \
205	  for file in $$dists; do \
206	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
207	  done; \
208	else \
209	  : ; \
210	fi
211
212# Define this as empty until I found a useful application.
213installcheck:
214
215uninstall:
216	if test "$(PACKAGE)" = "gettext" \
217	   && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
218	  rm -f $(DESTDIR)$(includedir)/libintl.h; \
219	  $(LIBTOOL) --mode=uninstall \
220	    rm -f $(DESTDIR)$(libdir)/libintl.$la; \
221	else \
222	  : ; \
223	fi
224	if test '@USE_INCLUDED_LIBINTL@' = yes; then \
225	  if test -f $(DESTDIR)$(libdir)/charset.alias; then \
226	    temp=$(DESTDIR)$(libdir)/t-charset.alias; \
227	    dest=$(DESTDIR)$(libdir)/charset.alias; \
228	    sed -f ref-del.sed $$dest > $$temp; \
229	    if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
230	      rm -f $$dest; \
231	    else \
232	      $(INSTALL_DATA) $$temp $$dest; \
233	    fi; \
234	    rm -f $$temp; \
235	  fi; \
236	  if test -f $(DESTDIR)$(localedir)/locale.alias; then \
237	    temp=$(DESTDIR)$(localedir)/t-locale.alias; \
238	    dest=$(DESTDIR)$(localedir)/locale.alias; \
239	    sed -f ref-del.sed $$dest > $$temp; \
240	    if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
241	      rm -f $$dest; \
242	    else \
243	      $(INSTALL_DATA) $$temp $$dest; \
244	    fi; \
245	    rm -f $$temp; \
246	  fi; \
247	else \
248	  : ; \
249	fi
250	if test "$(PACKAGE)" = "gettext"; then \
251	  for file in VERSION ChangeLog COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
252	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
253	  done; \
254	else \
255	  : ; \
256	fi
257
258info dvi:
259
260$(OBJECTS): ../config.h libgnuintl.h
261bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
262dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
263
264tags: TAGS
265
266TAGS: $(HEADERS) $(SOURCES)
267	here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
268
269id: ID
270
271ID: $(HEADERS) $(SOURCES)
272	here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
273
274
275mostlyclean:
276	rm -f *.a *.la *.o *.lo core core.*
277	rm -f libintl.h charset.alias ref-add.sed ref-del.sed
278	rm -f -r .libs _libs
279
280clean: mostlyclean
281
282distclean: clean
283	rm -f Makefile ID TAGS
284	if test "$(PACKAGE)" = gettext; then \
285	  rm -f ChangeLog.inst $(DISTFILES.normal); \
286	else \
287	  : ; \
288	fi
289
290maintainer-clean: distclean
291	@echo "This command is intended for maintainers to use;"
292	@echo "it deletes files that may require special tools to rebuild."
293
294
295# GNU gettext needs not contain the file `VERSION' but contains some
296# other files which should not be distributed in other packages.
297distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
298dist distdir: Makefile
299	if test "$(PACKAGE)" = gettext; then \
300	  additional="$(DISTFILES.gettext)"; \
301	else \
302	  additional="$(DISTFILES.normal)"; \
303	fi; \
304	$(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
305	for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
306	  if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
307	  ln $$dir/$$file $(distdir) 2> /dev/null \
308	    || cp -p $$dir/$$file $(distdir); \
309	done
310
311Makefile: Makefile.in ../config.status
312	cd .. \
313	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
314
315# Tell versions [3.59,3.63) of GNU make not to export all variables.
316# Otherwise a system limit (for SysV at least) may be exceeded.
317.NOEXPORT:
318