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 @ifGNUmake@ CHECK=sparse
63 @ifGNUmake@ CHECK_OPTS=-Wsparse-all -Wno-transparent-union -Wno-return-void -Wno-undef -Wno-non-pointer-null
64 @ifGNUmake@ ifeq ("$(C)", "2")
65 @ifGNUmake@ CHECK_CMD=$(CHECK) $(CHECK_OPTS) -Wbitwise -D__CHECK_ENDIAN__
67 @ifGNUmake@ ifeq ("$(C)", "1")
68 @ifGNUmake@ CHECK_CMD=$(CHECK) $(CHECK_OPTS)
70 @ifGNUmake@ CHECK_CMD=@true
74 @ifNotGNUmake@ CHECK_CMD=@true
76 l = @INTL_LIBTOOL_SUFFIX_PREFIX@
82 YACC = @INTLBISON@ -y -d
83 YFLAGS = --name-prefix=__gettext
85 DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
86 -DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \
87 -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
88 -Dset_relocation_prefix=libintl_set_relocation_prefix \
89 -Drelocate=libintl_relocate \
90 -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H
96 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
108 printf-args.h printf-args.c \
109 printf-parse.h wprintf-parse.h printf-parse.c \
110 vasnprintf.h vasnwprintf.h vasnprintf.c \
162 DISTFILES.common = Makefile.in \
163 config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
164 DISTFILES.generated = plural.c
165 DISTFILES.normal = VERSION
166 DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
167 libgnuintl.h_vms Makefile.vms \
168 libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
169 DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
170 COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
172 all: all-@USE_INCLUDED_LIBINTL@
173 all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
174 all-no: all-no-@BUILD_INCLUDED_LIBINTL@
175 all-no-yes: libgnuintl.$la
178 libintl.a libgnuintl.a: $(OBJECTS)
181 $(Q) $(AR) cru $@ $(OBJECTS)
185 libintl.la libgnuintl.la: $(OBJECTS)
186 $(LIBTOOL) --mode=link \
187 $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
188 $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \
189 -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
193 # Libtool's library version information for libintl.
194 # Before making a gettext release, the gettext maintainer must change this
195 # according to the libtool documentation, section "Library interface versions".
196 # Maintainers of other packages that include the intl directory must *not*
197 # change these values.
203 .SUFFIXES: .c .y .o .lo .sin .sed
208 $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
211 $(YACC) $(YFLAGS) --output $@ $<
214 bindtextdom.lo: $(srcdir)/bindtextdom.c
215 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
216 dcgettext.lo: $(srcdir)/dcgettext.c
217 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
218 dgettext.lo: $(srcdir)/dgettext.c
219 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
220 gettext.lo: $(srcdir)/gettext.c
221 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
222 finddomain.lo: $(srcdir)/finddomain.c
223 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
224 loadmsgcat.lo: $(srcdir)/loadmsgcat.c
225 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
226 localealias.lo: $(srcdir)/localealias.c
227 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
228 textdomain.lo: $(srcdir)/textdomain.c
229 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
230 l10nflist.lo: $(srcdir)/l10nflist.c
231 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
232 explodename.lo: $(srcdir)/explodename.c
233 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
234 dcigettext.lo: $(srcdir)/dcigettext.c
235 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
236 dcngettext.lo: $(srcdir)/dcngettext.c
237 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
238 dngettext.lo: $(srcdir)/dngettext.c
239 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
240 ngettext.lo: $(srcdir)/ngettext.c
241 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
242 plural.lo: $(srcdir)/plural.c
243 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
244 plural-exp.lo: $(srcdir)/plural-exp.c
245 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
246 localcharset.lo: $(srcdir)/localcharset.c
247 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
248 relocatable.lo: $(srcdir)/relocatable.c
249 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
250 localename.lo: $(srcdir)/localename.c
251 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
252 log.lo: $(srcdir)/log.c
253 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
254 printf.lo: $(srcdir)/printf.c
255 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
256 osdep.lo: $(srcdir)/osdep.c
257 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
258 intl-compat.lo: $(srcdir)/intl-compat.c
259 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
261 ref-add.sed: $(srcdir)/ref-add.sin
262 $(E) " SED ref-add.sed"
263 $(Q) sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
264 $(Q) mv t-ref-add.sed ref-add.sed
265 ref-del.sed: $(srcdir)/ref-del.sin
266 $(E) " SED ref-del.sed"
267 $(Q) sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
268 $(Q) mv t-ref-del.sed ref-del.sed
270 INCLUDES = -I. -I$(srcdir) -I.. -I$(top_builddir)/lib
272 libgnuintl.h: $(srcdir)/libgnuintl.h.in
273 $(E) " SED libgnuintl.h "
274 $(Q) sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
275 -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
276 -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
277 -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
278 < $(srcdir)/libgnuintl.h.in > libgnuintl.h
280 libintl.h: libgnuintl.h
282 $(Q) cp libgnuintl.h libintl.h
284 charset.alias: $(srcdir)/config.charset
285 $(E) " CONFIG.CHARSET $@"
286 $(Q) $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
291 # We must not install the libintl.h/libintl.a files if we are on a
292 # system which has the GNU gettext() function in its C library or in a
294 # If you want to use the one which comes with this version of the
295 # package, you have to use `configure --with-included-gettext'.
296 install: install-exec install-data
298 $(Q) if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
299 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
300 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
301 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
302 $(LIBTOOL) --mode=install \
303 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
304 if test "@RELOCATABLE@" = yes; then \
305 dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
306 if test -n "$$dependencies"; then \
307 rm -f $(DESTDIR)$(libdir)/libintl.la; \
313 $(Q) if test "$(PACKAGE)" = "gettext-tools" \
314 && test '@USE_INCLUDED_LIBINTL@' = no; then \
315 $(mkinstalldirs) $(DESTDIR)$(libdir); \
316 $(LIBTOOL) --mode=install \
317 $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
318 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
319 $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
320 $(LIBTOOL) --mode=uninstall \
321 rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
325 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
326 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
327 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
328 dest=$(DESTDIR)$(libdir)/charset.alias; \
329 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
330 orig=$(DESTDIR)$(libdir)/charset.alias; \
331 sed -f ref-add.sed $$orig > $$temp; \
332 $(INSTALL_DATA) $$temp $$dest; \
335 if test @GLIBC21@ = no; then \
336 orig=charset.alias; \
337 sed -f ref-add.sed $$orig > $$temp; \
338 $(INSTALL_DATA) $$temp $$dest; \
342 $(mkinstalldirs) $(DESTDIR)$(localedir); \
343 test -f $(DESTDIR)$(localedir)/locale.alias \
344 && orig=$(DESTDIR)$(localedir)/locale.alias \
345 || orig=$(srcdir)/locale.alias; \
346 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
347 dest=$(DESTDIR)$(localedir)/locale.alias; \
348 sed -f ref-add.sed $$orig > $$temp; \
349 $(INSTALL_DATA) $$temp $$dest; \
355 $(Q) if test "$(PACKAGE)" = "gettext-tools"; then \
356 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
357 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
358 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
359 dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
360 for file in $$dists; do \
361 $(INSTALL_DATA) $(srcdir)/$$file \
362 $(DESTDIR)$(gettextsrcdir)/$$file; \
364 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
365 dists="$(DISTFILES.generated)"; \
366 for file in $$dists; do \
367 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
368 $(INSTALL_DATA) $$dir/$$file \
369 $(DESTDIR)$(gettextsrcdir)/$$file; \
371 dists="$(DISTFILES.obsolete)"; \
372 for file in $$dists; do \
373 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
379 install-strip: install
382 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
383 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
384 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
388 if test "$(PACKAGE)" = "gettext-tools" \
389 && test '@USE_INCLUDED_LIBINTL@' = no; then \
390 $(mkinstalldirs) $(DESTDIR)$(libdir); \
394 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
395 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
396 $(mkinstalldirs) $(DESTDIR)$(localedir); \
400 if test "$(PACKAGE)" = "gettext-tools"; then \
401 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
406 # Define this as empty until I found a useful application.
413 install-shlibs-strip:
416 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
417 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
418 rm -f $(DESTDIR)$(includedir)/libintl.h; \
419 $(LIBTOOL) --mode=uninstall \
420 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
424 if test "$(PACKAGE)" = "gettext-tools" \
425 && test '@USE_INCLUDED_LIBINTL@' = no; then \
426 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
430 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
431 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
432 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
433 dest=$(DESTDIR)$(libdir)/charset.alias; \
434 sed -f ref-del.sed $$dest > $$temp; \
435 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
438 $(INSTALL_DATA) $$temp $$dest; \
442 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
443 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
444 dest=$(DESTDIR)$(localedir)/locale.alias; \
445 sed -f ref-del.sed $$dest > $$temp; \
446 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
449 $(INSTALL_DATA) $$temp $$dest; \
456 if test "$(PACKAGE)" = "gettext-tools"; then \
457 for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
458 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
464 info dvi ps pdf html:
466 $(OBJECTS): libgnuintl.h
467 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
468 dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
469 explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
470 dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
471 dcigettext.$lo: $(srcdir)/eval-plural.h
472 localcharset.$lo: $(srcdir)/localcharset.h
473 localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
474 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
478 TAGS: $(HEADERS) $(SOURCES)
479 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
483 CTAGS: $(HEADERS) $(SOURCES)
484 here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
488 ID: $(HEADERS) $(SOURCES)
489 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
494 rm -f *.a *.la *.o *.obj *.lo core core.*
495 rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
501 rm -f Makefile ID TAGS
502 if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
503 rm -f ChangeLog.inst $(DISTFILES.normal); \
508 maintainer-clean: distclean
509 $(E) "This command is intended for maintainers to use;"
510 $(E) "it deletes files that may require special tools to rebuild."
513 # GNU gettext needs not contain the file `VERSION' but contains some
514 # other files which should not be distributed in other packages.
515 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
516 dist distdir: Makefile
517 if test "$(PACKAGE)" = "gettext-tools"; then \
520 if test "$(PACKAGE)" = "gettext-runtime"; then \
521 additional="$(DISTFILES.gettext)"; \
523 additional="$(DISTFILES.normal)"; \
525 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
526 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
527 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
528 cp -p $$dir/$$file $(distdir); \
532 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
533 # cd $(top_builddir) && $(SHELL) ./config.status
534 # This would be more efficient, but doesn't work any more with autoconf-2.57,
535 # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
536 cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
538 # Tell versions [3.59,3.63) of GNU make not to export all variables.
539 # Otherwise a system limit (for SysV at least) may be exceeded.