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 datarootdir = @datarootdir@
32 transform = @program_transform_name@
34 includedir = @includedir@
36 localedir = $(datadir)/locale
37 gettextsrcdir = $(datadir)/gettext/intl
38 aliaspath = $(localedir)
42 INSTALL_DATA = @INSTALL_DATA@
43 MKINSTALLDIRS = @MKINSTALLDIRS@
44 mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
49 @ifGNUmake@ ifeq ($(strip $(V)),)
50 @ifGNUmake@ # E = @echo
59 @ifNotGNUmake@ E = @E@
60 @ifNotGNUmake@ Q = @Q@
62 l = @INTL_LIBTOOL_SUFFIX_PREFIX@
68 YACC = @INTLBISON@ -y -d
69 YFLAGS = --name-prefix=__gettext
71 DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
72 -DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \
73 -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
74 -Dset_relocation_prefix=libintl_set_relocation_prefix \
75 -Drelocate=libintl_relocate \
76 -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H
82 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
94 printf-args.h printf-args.c \
95 printf-parse.h wprintf-parse.h printf-parse.c \
96 vasnprintf.h vasnwprintf.h vasnprintf.c \
148 DISTFILES.common = Makefile.in \
149 config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
150 DISTFILES.generated = plural.c
151 DISTFILES.normal = VERSION
152 DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
153 libgnuintl.h_vms Makefile.vms \
154 libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
155 DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
156 COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
158 all: all-@USE_INCLUDED_LIBINTL@
159 all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
160 all-no: all-no-@BUILD_INCLUDED_LIBINTL@
161 all-no-yes: libgnuintl.$la
164 libintl.a libgnuintl.a: $(OBJECTS)
167 $(Q) $(AR) cru $@ $(OBJECTS)
171 libintl.la libgnuintl.la: $(OBJECTS)
172 $(LIBTOOL) --mode=link \
173 $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
174 $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \
175 -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
179 # Libtool's library version information for libintl.
180 # Before making a gettext release, the gettext maintainer must change this
181 # according to the libtool documentation, section "Library interface versions".
182 # Maintainers of other packages that include the intl directory must *not*
183 # change these values.
189 .SUFFIXES: .c .y .o .lo .sin .sed
194 $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
197 $(YACC) $(YFLAGS) --output $@ $<
200 bindtextdom.lo: $(srcdir)/bindtextdom.c
201 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
202 dcgettext.lo: $(srcdir)/dcgettext.c
203 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
204 dgettext.lo: $(srcdir)/dgettext.c
205 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
206 gettext.lo: $(srcdir)/gettext.c
207 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
208 finddomain.lo: $(srcdir)/finddomain.c
209 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
210 loadmsgcat.lo: $(srcdir)/loadmsgcat.c
211 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
212 localealias.lo: $(srcdir)/localealias.c
213 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
214 textdomain.lo: $(srcdir)/textdomain.c
215 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
216 l10nflist.lo: $(srcdir)/l10nflist.c
217 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
218 explodename.lo: $(srcdir)/explodename.c
219 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
220 dcigettext.lo: $(srcdir)/dcigettext.c
221 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
222 dcngettext.lo: $(srcdir)/dcngettext.c
223 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
224 dngettext.lo: $(srcdir)/dngettext.c
225 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
226 ngettext.lo: $(srcdir)/ngettext.c
227 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
228 plural.lo: $(srcdir)/plural.c
229 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
230 plural-exp.lo: $(srcdir)/plural-exp.c
231 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
232 localcharset.lo: $(srcdir)/localcharset.c
233 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
234 relocatable.lo: $(srcdir)/relocatable.c
235 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
236 localename.lo: $(srcdir)/localename.c
237 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
238 log.lo: $(srcdir)/log.c
239 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
240 printf.lo: $(srcdir)/printf.c
241 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
242 osdep.lo: $(srcdir)/osdep.c
243 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
244 intl-compat.lo: $(srcdir)/intl-compat.c
245 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
247 ref-add.sed: $(srcdir)/ref-add.sin
248 $(E) " SED ref-add.sed"
249 $(Q) sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
250 $(Q) mv t-ref-add.sed ref-add.sed
251 ref-del.sed: $(srcdir)/ref-del.sin
252 $(E) " SED ref-del.sed"
253 $(Q) sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
254 $(Q) mv t-ref-del.sed ref-del.sed
256 INCLUDES = -I. -I$(srcdir) -I.. -I$(top_builddir)/lib
258 libgnuintl.h: $(srcdir)/libgnuintl.h.in
259 $(E) " SED libgnuintl.h "
260 $(Q) sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
261 -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
262 -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
263 -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
264 < $(srcdir)/libgnuintl.h.in > libgnuintl.h
266 libintl.h: libgnuintl.h
268 $(Q) cp libgnuintl.h libintl.h
270 charset.alias: $(srcdir)/config.charset
271 $(E) " CONFIG.CHARSET $@"
272 $(Q) $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
277 # We must not install the libintl.h/libintl.a files if we are on a
278 # system which has the GNU gettext() function in its C library or in a
280 # If you want to use the one which comes with this version of the
281 # package, you have to use `configure --with-included-gettext'.
282 install: install-exec install-data
284 $(Q) if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
285 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
286 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
287 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
288 $(LIBTOOL) --mode=install \
289 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
290 if test "@RELOCATABLE@" = yes; then \
291 dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
292 if test -n "$$dependencies"; then \
293 rm -f $(DESTDIR)$(libdir)/libintl.la; \
299 $(Q) if test "$(PACKAGE)" = "gettext-tools" \
300 && test '@USE_INCLUDED_LIBINTL@' = no; then \
301 $(mkinstalldirs) $(DESTDIR)$(libdir); \
302 $(LIBTOOL) --mode=install \
303 $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
304 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
305 $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
306 $(LIBTOOL) --mode=uninstall \
307 rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
311 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
312 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
313 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
314 dest=$(DESTDIR)$(libdir)/charset.alias; \
315 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
316 orig=$(DESTDIR)$(libdir)/charset.alias; \
317 sed -f ref-add.sed $$orig > $$temp; \
318 $(INSTALL_DATA) $$temp $$dest; \
321 if test @GLIBC21@ = no; then \
322 orig=charset.alias; \
323 sed -f ref-add.sed $$orig > $$temp; \
324 $(INSTALL_DATA) $$temp $$dest; \
328 $(mkinstalldirs) $(DESTDIR)$(localedir); \
329 test -f $(DESTDIR)$(localedir)/locale.alias \
330 && orig=$(DESTDIR)$(localedir)/locale.alias \
331 || orig=$(srcdir)/locale.alias; \
332 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
333 dest=$(DESTDIR)$(localedir)/locale.alias; \
334 sed -f ref-add.sed $$orig > $$temp; \
335 $(INSTALL_DATA) $$temp $$dest; \
341 $(Q) if test "$(PACKAGE)" = "gettext-tools"; then \
342 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
343 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
344 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
345 dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
346 for file in $$dists; do \
347 $(INSTALL_DATA) $(srcdir)/$$file \
348 $(DESTDIR)$(gettextsrcdir)/$$file; \
350 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
351 dists="$(DISTFILES.generated)"; \
352 for file in $$dists; do \
353 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
354 $(INSTALL_DATA) $$dir/$$file \
355 $(DESTDIR)$(gettextsrcdir)/$$file; \
357 dists="$(DISTFILES.obsolete)"; \
358 for file in $$dists; do \
359 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
365 install-strip: install
368 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
369 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
370 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
374 if test "$(PACKAGE)" = "gettext-tools" \
375 && test '@USE_INCLUDED_LIBINTL@' = no; then \
376 $(mkinstalldirs) $(DESTDIR)$(libdir); \
380 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
381 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
382 $(mkinstalldirs) $(DESTDIR)$(localedir); \
386 if test "$(PACKAGE)" = "gettext-tools"; then \
387 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
392 # Define this as empty until I found a useful application.
399 install-shlibs-strip:
402 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
403 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
404 rm -f $(DESTDIR)$(includedir)/libintl.h; \
405 $(LIBTOOL) --mode=uninstall \
406 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
410 if test "$(PACKAGE)" = "gettext-tools" \
411 && test '@USE_INCLUDED_LIBINTL@' = no; then \
412 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
416 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
417 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
418 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
419 dest=$(DESTDIR)$(libdir)/charset.alias; \
420 sed -f ref-del.sed $$dest > $$temp; \
421 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
424 $(INSTALL_DATA) $$temp $$dest; \
428 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
429 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
430 dest=$(DESTDIR)$(localedir)/locale.alias; \
431 sed -f ref-del.sed $$dest > $$temp; \
432 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
435 $(INSTALL_DATA) $$temp $$dest; \
442 if test "$(PACKAGE)" = "gettext-tools"; then \
443 for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
444 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
450 info dvi ps pdf html:
452 $(OBJECTS): libgnuintl.h
453 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
454 dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
455 explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
456 dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
457 dcigettext.$lo: $(srcdir)/eval-plural.h
458 localcharset.$lo: $(srcdir)/localcharset.h
459 localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
460 printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c
464 TAGS: $(HEADERS) $(SOURCES)
465 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
469 CTAGS: $(HEADERS) $(SOURCES)
470 here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
474 ID: $(HEADERS) $(SOURCES)
475 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
479 rm -f *.a *.la *.o *.obj *.lo core core.*
480 rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
486 rm -f Makefile ID TAGS
487 if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
488 rm -f ChangeLog.inst $(DISTFILES.normal); \
493 maintainer-clean: distclean
494 $(E) "This command is intended for maintainers to use;"
495 $(E) "it deletes files that may require special tools to rebuild."
498 # GNU gettext needs not contain the file `VERSION' but contains some
499 # other files which should not be distributed in other packages.
500 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
501 dist distdir: Makefile
502 if test "$(PACKAGE)" = "gettext-tools"; then \
505 if test "$(PACKAGE)" = "gettext-runtime"; then \
506 additional="$(DISTFILES.gettext)"; \
508 additional="$(DISTFILES.normal)"; \
510 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
511 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
512 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
513 cp -p $$dir/$$file $(distdir); \
517 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
518 # cd $(top_builddir) && $(SHELL) ./config.status
519 # This would be more efficient, but doesn't work any more with autoconf-2.57,
520 # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
521 cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
523 # Tell versions [3.59,3.63) of GNU make not to export all variables.
524 # Otherwise a system limit (for SysV at least) may be exceeded.