1 # Makefile for directory with message catalog handling library of GNU gettext
2 # Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
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)
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.
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,
25 top_srcdir = @top_srcdir@
30 exec_prefix = @exec_prefix@
31 transform = @program_transform_name@
33 includedir = @includedir@
35 localedir = $(datadir)/locale
36 gettextsrcdir = $(datadir)/gettext/intl
37 aliaspath = $(localedir)
41 INSTALL_DATA = @INSTALL_DATA@
42 MKINSTALLDIRS = @MKINSTALLDIRS@
43 mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
45 l = @INTL_LIBTOOL_SUFFIX_PREFIX@
51 YACC = @INTLBISON@ -y -d
52 YFLAGS = --name-prefix=__gettext
54 DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
55 -DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \
56 -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
57 -Dset_relocation_prefix=libintl_set_relocation_prefix \
58 -Drelocate=libintl_relocate \
59 -DDEPENDS_ON_LIBICONV=1 @DEFS@
65 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
125 DISTFILES.common = Makefile.in \
126 config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
127 DISTFILES.generated = plural.c
128 DISTFILES.normal = VERSION
129 DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
130 Makefile.vms libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
131 DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
132 COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
134 all: all-@USE_INCLUDED_LIBINTL@
135 all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
136 all-no: all-no-@BUILD_INCLUDED_LIBINTL@
137 all-no-yes: libgnuintl.$la
140 libintl.a libgnuintl.a: $(OBJECTS)
142 $(AR) cru $@ $(OBJECTS)
145 libintl.la libgnuintl.la: $(OBJECTS)
146 $(LIBTOOL) --mode=link \
147 $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
148 $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \
149 -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
153 # Libtool's library version information for libintl.
154 # Before making a gettext release, the gettext maintainer must change this
155 # according to the libtool documentation, section "Library interface versions".
156 # Maintainers of other packages that include the intl directory must *not*
157 # change these values.
163 .SUFFIXES: .c .y .o .lo .sin .sed
169 $(YACC) $(YFLAGS) --output $@ $<
172 bindtextdom.lo: $(srcdir)/bindtextdom.c
173 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
174 dcgettext.lo: $(srcdir)/dcgettext.c
175 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
176 dgettext.lo: $(srcdir)/dgettext.c
177 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
178 gettext.lo: $(srcdir)/gettext.c
179 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
180 finddomain.lo: $(srcdir)/finddomain.c
181 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
182 loadmsgcat.lo: $(srcdir)/loadmsgcat.c
183 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
184 localealias.lo: $(srcdir)/localealias.c
185 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
186 textdomain.lo: $(srcdir)/textdomain.c
187 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
188 l10nflist.lo: $(srcdir)/l10nflist.c
189 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
190 explodename.lo: $(srcdir)/explodename.c
191 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
192 dcigettext.lo: $(srcdir)/dcigettext.c
193 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
194 dcngettext.lo: $(srcdir)/dcngettext.c
195 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
196 dngettext.lo: $(srcdir)/dngettext.c
197 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
198 ngettext.lo: $(srcdir)/ngettext.c
199 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
200 plural.lo: $(srcdir)/plural.c
201 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
202 plural-exp.lo: $(srcdir)/plural-exp.c
203 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
204 localcharset.lo: $(srcdir)/localcharset.c
205 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
206 relocatable.lo: $(srcdir)/relocatable.c
207 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
208 localename.lo: $(srcdir)/localename.c
209 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
210 log.lo: $(srcdir)/log.c
211 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
212 osdep.lo: $(srcdir)/osdep.c
213 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
214 intl-compat.lo: $(srcdir)/intl-compat.c
215 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
217 ref-add.sed: $(srcdir)/ref-add.sin
218 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
219 mv t-ref-add.sed ref-add.sed
220 ref-del.sed: $(srcdir)/ref-del.sin
221 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
222 mv t-ref-del.sed ref-del.sed
224 INCLUDES = -I. -I$(srcdir) -I..
226 libgnuintl.h: $(srcdir)/libgnuintl.h.in
227 cp $(srcdir)/libgnuintl.h.in libgnuintl.h
229 libintl.h: libgnuintl.h
230 cp libgnuintl.h libintl.h
232 charset.alias: $(srcdir)/config.charset
233 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
238 # We must not install the libintl.h/libintl.a files if we are on a
239 # system which has the GNU gettext() function in its C library or in a
241 # If you want to use the one which comes with this version of the
242 # package, you have to use `configure --with-included-gettext'.
243 install: install-exec install-data
245 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
246 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
247 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
248 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
249 $(LIBTOOL) --mode=install \
250 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
251 if test "@RELOCATABLE@" = yes; then \
252 dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
253 if test -n "$dependencies"; then \
254 rm -f $(DESTDIR)$(libdir)/libintl.la; \
260 if test "$(PACKAGE)" = "gettext-tools" \
261 && test '@USE_INCLUDED_LIBINTL@' = no; then \
262 $(mkinstalldirs) $(DESTDIR)$(libdir); \
263 $(LIBTOOL) --mode=install \
264 $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
265 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
266 $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
267 $(LIBTOOL) --mode=uninstall \
268 rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
272 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
273 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
274 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
275 dest=$(DESTDIR)$(libdir)/charset.alias; \
276 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
277 orig=$(DESTDIR)$(libdir)/charset.alias; \
278 sed -f ref-add.sed $$orig > $$temp; \
279 $(INSTALL_DATA) $$temp $$dest; \
282 if test @GLIBC21@ = no; then \
283 orig=charset.alias; \
284 sed -f ref-add.sed $$orig > $$temp; \
285 $(INSTALL_DATA) $$temp $$dest; \
289 $(mkinstalldirs) $(DESTDIR)$(localedir); \
290 test -f $(DESTDIR)$(localedir)/locale.alias \
291 && orig=$(DESTDIR)$(localedir)/locale.alias \
292 || orig=$(srcdir)/locale.alias; \
293 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
294 dest=$(DESTDIR)$(localedir)/locale.alias; \
295 sed -f ref-add.sed $$orig > $$temp; \
296 $(INSTALL_DATA) $$temp $$dest; \
302 if test "$(PACKAGE)" = "gettext-tools"; then \
303 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
304 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
305 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
306 dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
307 for file in $$dists; do \
308 $(INSTALL_DATA) $(srcdir)/$$file \
309 $(DESTDIR)$(gettextsrcdir)/$$file; \
311 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
312 dists="$(DISTFILES.generated)"; \
313 for file in $$dists; do \
314 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
315 $(INSTALL_DATA) $$dir/$$file \
316 $(DESTDIR)$(gettextsrcdir)/$$file; \
318 dists="$(DISTFILES.obsolete)"; \
319 for file in $$dists; do \
320 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
326 install-strip: install
329 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
330 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
331 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
335 if test "$(PACKAGE)" = "gettext-tools" \
336 && test '@USE_INCLUDED_LIBINTL@' = no; then \
337 $(mkinstalldirs) $(DESTDIR)$(libdir); \
341 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
342 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
343 $(mkinstalldirs) $(DESTDIR)$(localedir); \
347 if test "$(PACKAGE)" = "gettext-tools"; then \
348 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
353 # Define this as empty until I found a useful application.
357 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
358 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
359 rm -f $(DESTDIR)$(includedir)/libintl.h; \
360 $(LIBTOOL) --mode=uninstall \
361 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
365 if test "$(PACKAGE)" = "gettext-tools" \
366 && test '@USE_INCLUDED_LIBINTL@' = no; then \
367 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
371 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
372 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
373 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
374 dest=$(DESTDIR)$(libdir)/charset.alias; \
375 sed -f ref-del.sed $$dest > $$temp; \
376 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
379 $(INSTALL_DATA) $$temp $$dest; \
383 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
384 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
385 dest=$(DESTDIR)$(localedir)/locale.alias; \
386 sed -f ref-del.sed $$dest > $$temp; \
387 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
390 $(INSTALL_DATA) $$temp $$dest; \
397 if test "$(PACKAGE)" = "gettext-tools"; then \
398 for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
399 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
405 info dvi ps pdf html:
407 $(OBJECTS): ../config.h libgnuintl.h
408 bindtextdom.$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: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
409 dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
410 explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
411 dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
412 dcigettext.$lo: $(srcdir)/eval-plural.h
413 localcharset.$lo: $(srcdir)/localcharset.h
414 localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
418 TAGS: $(HEADERS) $(SOURCES)
419 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
423 CTAGS: $(HEADERS) $(SOURCES)
424 here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
428 ID: $(HEADERS) $(SOURCES)
429 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
433 rm -f *.a *.la *.o *.obj *.lo core core.*
434 rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
440 rm -f Makefile ID TAGS
441 if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
442 rm -f ChangeLog.inst $(DISTFILES.normal); \
447 maintainer-clean: distclean
448 @echo "This command is intended for maintainers to use;"
449 @echo "it deletes files that may require special tools to rebuild."
452 # GNU gettext needs not contain the file `VERSION' but contains some
453 # other files which should not be distributed in other packages.
454 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
455 dist distdir: Makefile
456 if test "$(PACKAGE)" = "gettext-tools"; then \
459 if test "$(PACKAGE)" = "gettext-runtime"; then \
460 additional="$(DISTFILES.gettext)"; \
462 additional="$(DISTFILES.normal)"; \
464 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
465 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
466 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
467 cp -p $$dir/$$file $(distdir); \
471 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
472 cd $(top_builddir) && $(SHELL) ./config.status
473 # This would be more efficient, but doesn't work any more with autoconf-2.57,
474 # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
475 # cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
477 # Tell versions [3.59,3.63) of GNU make not to export all variables.
478 # Otherwise a system limit (for SysV at least) may be exceeded.