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
196 $(YACC) $(YFLAGS) --output $@ $<
199 bindtextdom.lo: $(srcdir)/bindtextdom.c
200 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
201 dcgettext.lo: $(srcdir)/dcgettext.c
202 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
203 dgettext.lo: $(srcdir)/dgettext.c
204 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
205 gettext.lo: $(srcdir)/gettext.c
206 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
207 finddomain.lo: $(srcdir)/finddomain.c
208 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
209 loadmsgcat.lo: $(srcdir)/loadmsgcat.c
210 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
211 localealias.lo: $(srcdir)/localealias.c
212 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
213 textdomain.lo: $(srcdir)/textdomain.c
214 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
215 l10nflist.lo: $(srcdir)/l10nflist.c
216 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
217 explodename.lo: $(srcdir)/explodename.c
218 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
219 dcigettext.lo: $(srcdir)/dcigettext.c
220 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
221 dcngettext.lo: $(srcdir)/dcngettext.c
222 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
223 dngettext.lo: $(srcdir)/dngettext.c
224 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
225 ngettext.lo: $(srcdir)/ngettext.c
226 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
227 plural.lo: $(srcdir)/plural.c
228 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
229 plural-exp.lo: $(srcdir)/plural-exp.c
230 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
231 localcharset.lo: $(srcdir)/localcharset.c
232 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
233 relocatable.lo: $(srcdir)/relocatable.c
234 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
235 localename.lo: $(srcdir)/localename.c
236 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
237 log.lo: $(srcdir)/log.c
238 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
239 printf.lo: $(srcdir)/printf.c
240 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
241 osdep.lo: $(srcdir)/osdep.c
242 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
243 intl-compat.lo: $(srcdir)/intl-compat.c
244 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
246 ref-add.sed: $(srcdir)/ref-add.sin
247 $(E) " SED ref-add.sed"
248 $(Q) sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
249 $(Q) mv t-ref-add.sed ref-add.sed
250 ref-del.sed: $(srcdir)/ref-del.sin
251 $(E) " SED ref-del.sed"
252 $(Q) sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
253 $(Q) mv t-ref-del.sed ref-del.sed
255 INCLUDES = -I. -I$(srcdir) -I.. -I$(top_builddir)/lib
257 libgnuintl.h: $(srcdir)/libgnuintl.h.in
258 $(E) " SED libgnuintl.h "
259 $(Q) sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
260 -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
261 -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
262 -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
263 < $(srcdir)/libgnuintl.h.in > libgnuintl.h
265 libintl.h: libgnuintl.h
267 $(Q) cp libgnuintl.h libintl.h
269 charset.alias: $(srcdir)/config.charset
270 $(E) " CONFIG.CHARSET $@"
271 $(Q) $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
276 # We must not install the libintl.h/libintl.a files if we are on a
277 # system which has the GNU gettext() function in its C library or in a
279 # If you want to use the one which comes with this version of the
280 # package, you have to use `configure --with-included-gettext'.
281 install: install-exec install-data
283 $(Q) if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
284 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
285 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
286 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
287 $(LIBTOOL) --mode=install \
288 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
289 if test "@RELOCATABLE@" = yes; then \
290 dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
291 if test -n "$$dependencies"; then \
292 rm -f $(DESTDIR)$(libdir)/libintl.la; \
298 $(Q) if test "$(PACKAGE)" = "gettext-tools" \
299 && test '@USE_INCLUDED_LIBINTL@' = no; then \
300 $(mkinstalldirs) $(DESTDIR)$(libdir); \
301 $(LIBTOOL) --mode=install \
302 $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
303 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
304 $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
305 $(LIBTOOL) --mode=uninstall \
306 rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
310 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
311 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
312 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
313 dest=$(DESTDIR)$(libdir)/charset.alias; \
314 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
315 orig=$(DESTDIR)$(libdir)/charset.alias; \
316 sed -f ref-add.sed $$orig > $$temp; \
317 $(INSTALL_DATA) $$temp $$dest; \
320 if test @GLIBC21@ = no; then \
321 orig=charset.alias; \
322 sed -f ref-add.sed $$orig > $$temp; \
323 $(INSTALL_DATA) $$temp $$dest; \
327 $(mkinstalldirs) $(DESTDIR)$(localedir); \
328 test -f $(DESTDIR)$(localedir)/locale.alias \
329 && orig=$(DESTDIR)$(localedir)/locale.alias \
330 || orig=$(srcdir)/locale.alias; \
331 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
332 dest=$(DESTDIR)$(localedir)/locale.alias; \
333 sed -f ref-add.sed $$orig > $$temp; \
334 $(INSTALL_DATA) $$temp $$dest; \
340 $(Q) if test "$(PACKAGE)" = "gettext-tools"; then \
341 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
342 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
343 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
344 dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
345 for file in $$dists; do \
346 $(INSTALL_DATA) $(srcdir)/$$file \
347 $(DESTDIR)$(gettextsrcdir)/$$file; \
349 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
350 dists="$(DISTFILES.generated)"; \
351 for file in $$dists; do \
352 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
353 $(INSTALL_DATA) $$dir/$$file \
354 $(DESTDIR)$(gettextsrcdir)/$$file; \
356 dists="$(DISTFILES.obsolete)"; \
357 for file in $$dists; do \
358 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
364 install-strip: install
367 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
368 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
369 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
373 if test "$(PACKAGE)" = "gettext-tools" \
374 && test '@USE_INCLUDED_LIBINTL@' = no; then \
375 $(mkinstalldirs) $(DESTDIR)$(libdir); \
379 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
380 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
381 $(mkinstalldirs) $(DESTDIR)$(localedir); \
385 if test "$(PACKAGE)" = "gettext-tools"; then \
386 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
391 # Define this as empty until I found a useful application.
398 install-shlibs-strip:
401 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
402 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
403 rm -f $(DESTDIR)$(includedir)/libintl.h; \
404 $(LIBTOOL) --mode=uninstall \
405 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
409 if test "$(PACKAGE)" = "gettext-tools" \
410 && test '@USE_INCLUDED_LIBINTL@' = no; then \
411 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
415 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
416 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
417 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
418 dest=$(DESTDIR)$(libdir)/charset.alias; \
419 sed -f ref-del.sed $$dest > $$temp; \
420 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
423 $(INSTALL_DATA) $$temp $$dest; \
427 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
428 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
429 dest=$(DESTDIR)$(localedir)/locale.alias; \
430 sed -f ref-del.sed $$dest > $$temp; \
431 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
434 $(INSTALL_DATA) $$temp $$dest; \
441 if test "$(PACKAGE)" = "gettext-tools"; then \
442 for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
443 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
449 info dvi ps pdf html:
451 $(OBJECTS): libgnuintl.h
452 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
453 dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
454 explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
455 dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
456 dcigettext.$lo: $(srcdir)/eval-plural.h
457 localcharset.$lo: $(srcdir)/localcharset.h
458 localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
459 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
463 TAGS: $(HEADERS) $(SOURCES)
464 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
468 CTAGS: $(HEADERS) $(SOURCES)
469 here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
473 ID: $(HEADERS) $(SOURCES)
474 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
478 rm -f *.a *.la *.o *.obj *.lo core core.*
479 rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
485 rm -f Makefile ID TAGS
486 if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
487 rm -f ChangeLog.inst $(DISTFILES.normal); \
492 maintainer-clean: distclean
493 $(E) "This command is intended for maintainers to use;"
494 $(E) "it deletes files that may require special tools to rebuild."
497 # GNU gettext needs not contain the file `VERSION' but contains some
498 # other files which should not be distributed in other packages.
499 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
500 dist distdir: Makefile
501 if test "$(PACKAGE)" = "gettext-tools"; then \
504 if test "$(PACKAGE)" = "gettext-runtime"; then \
505 additional="$(DISTFILES.gettext)"; \
507 additional="$(DISTFILES.normal)"; \
509 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
510 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
511 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
512 cp -p $$dir/$$file $(distdir); \
516 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
517 # cd $(top_builddir) && $(SHELL) ./config.status
518 # This would be more efficient, but doesn't work any more with autoconf-2.57,
519 # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
520 cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
522 # Tell versions [3.59,3.63) of GNU make not to export all variables.
523 # Otherwise a system limit (for SysV at least) may be exceeded.