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)
46 l = @INTL_LIBTOOL_SUFFIX_PREFIX@
52 YACC = @INTLBISON@ -y -d
53 YFLAGS = --name-prefix=__gettext
55 DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
56 -DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \
57 -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
58 -Dset_relocation_prefix=libintl_set_relocation_prefix \
59 -Drelocate=libintl_relocate \
60 -DDEPENDS_ON_LIBICONV=1 @DEFS@
66 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
78 printf-args.h printf-args.c \
79 printf-parse.h wprintf-parse.h printf-parse.c \
80 vasnprintf.h vasnwprintf.h vasnprintf.c \
132 DISTFILES.common = Makefile.in \
133 config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
134 DISTFILES.generated = plural.c
135 DISTFILES.normal = VERSION
136 DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
137 libgnuintl.h_vms Makefile.vms \
138 libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
139 DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
140 COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
142 all: all-@USE_INCLUDED_LIBINTL@
143 all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
144 all-no: all-no-@BUILD_INCLUDED_LIBINTL@
145 all-no-yes: libgnuintl.$la
148 libintl.a libgnuintl.a: $(OBJECTS)
151 @$(AR) cru $@ $(OBJECTS)
155 libintl.la libgnuintl.la: $(OBJECTS)
156 $(LIBTOOL) --mode=link \
157 $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
158 $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \
159 -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
163 # Libtool's library version information for libintl.
164 # Before making a gettext release, the gettext maintainer must change this
165 # according to the libtool documentation, section "Library interface versions".
166 # Maintainers of other packages that include the intl directory must *not*
167 # change these values.
173 .SUFFIXES: .c .y .o .lo .sin .sed
180 $(YACC) $(YFLAGS) --output $@ $<
183 bindtextdom.lo: $(srcdir)/bindtextdom.c
184 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
185 dcgettext.lo: $(srcdir)/dcgettext.c
186 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
187 dgettext.lo: $(srcdir)/dgettext.c
188 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
189 gettext.lo: $(srcdir)/gettext.c
190 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
191 finddomain.lo: $(srcdir)/finddomain.c
192 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
193 loadmsgcat.lo: $(srcdir)/loadmsgcat.c
194 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
195 localealias.lo: $(srcdir)/localealias.c
196 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
197 textdomain.lo: $(srcdir)/textdomain.c
198 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
199 l10nflist.lo: $(srcdir)/l10nflist.c
200 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
201 explodename.lo: $(srcdir)/explodename.c
202 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
203 dcigettext.lo: $(srcdir)/dcigettext.c
204 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
205 dcngettext.lo: $(srcdir)/dcngettext.c
206 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
207 dngettext.lo: $(srcdir)/dngettext.c
208 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
209 ngettext.lo: $(srcdir)/ngettext.c
210 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
211 plural.lo: $(srcdir)/plural.c
212 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
213 plural-exp.lo: $(srcdir)/plural-exp.c
214 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
215 localcharset.lo: $(srcdir)/localcharset.c
216 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
217 relocatable.lo: $(srcdir)/relocatable.c
218 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
219 localename.lo: $(srcdir)/localename.c
220 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
221 log.lo: $(srcdir)/log.c
222 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
223 printf.lo: $(srcdir)/printf.c
224 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
225 osdep.lo: $(srcdir)/osdep.c
226 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
227 intl-compat.lo: $(srcdir)/intl-compat.c
228 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
230 ref-add.sed: $(srcdir)/ref-add.sin
231 @echo " SED ref-add.sed"
232 @sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
233 @mv t-ref-add.sed ref-add.sed
234 ref-del.sed: $(srcdir)/ref-del.sin
235 @echo " SED ref-del.sed"
236 @sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
237 @mv t-ref-del.sed ref-del.sed
239 INCLUDES = -I. -I$(srcdir) -I..
241 libgnuintl.h: $(srcdir)/libgnuintl.h.in
242 @echo " SED libgnuintl.h "
243 @sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
244 -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
245 -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
246 -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
247 < $(srcdir)/libgnuintl.h.in > libgnuintl.h
249 libintl.h: libgnuintl.h
250 @echo " CP libintl.h"
251 @cp libgnuintl.h libintl.h
253 charset.alias: $(srcdir)/config.charset
254 @echo " CONFIG.CHARSET $@"
255 @$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
260 # We must not install the libintl.h/libintl.a files if we are on a
261 # system which has the GNU gettext() function in its C library or in a
263 # If you want to use the one which comes with this version of the
264 # package, you have to use `configure --with-included-gettext'.
265 install: install-exec install-data
267 @if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
268 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
269 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
270 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
271 $(LIBTOOL) --mode=install \
272 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
273 if test "@RELOCATABLE@" = yes; then \
274 dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
275 if test -n "$$dependencies"; then \
276 rm -f $(DESTDIR)$(libdir)/libintl.la; \
282 @if test "$(PACKAGE)" = "gettext-tools" \
283 && test '@USE_INCLUDED_LIBINTL@' = no; then \
284 $(mkinstalldirs) $(DESTDIR)$(libdir); \
285 $(LIBTOOL) --mode=install \
286 $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
287 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
288 $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
289 $(LIBTOOL) --mode=uninstall \
290 rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
294 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
295 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
296 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
297 dest=$(DESTDIR)$(libdir)/charset.alias; \
298 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
299 orig=$(DESTDIR)$(libdir)/charset.alias; \
300 sed -f ref-add.sed $$orig > $$temp; \
301 $(INSTALL_DATA) $$temp $$dest; \
304 if test @GLIBC21@ = no; then \
305 orig=charset.alias; \
306 sed -f ref-add.sed $$orig > $$temp; \
307 $(INSTALL_DATA) $$temp $$dest; \
311 $(mkinstalldirs) $(DESTDIR)$(localedir); \
312 test -f $(DESTDIR)$(localedir)/locale.alias \
313 && orig=$(DESTDIR)$(localedir)/locale.alias \
314 || orig=$(srcdir)/locale.alias; \
315 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
316 dest=$(DESTDIR)$(localedir)/locale.alias; \
317 sed -f ref-add.sed $$orig > $$temp; \
318 $(INSTALL_DATA) $$temp $$dest; \
324 @if test "$(PACKAGE)" = "gettext-tools"; then \
325 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
326 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
327 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
328 dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
329 for file in $$dists; do \
330 $(INSTALL_DATA) $(srcdir)/$$file \
331 $(DESTDIR)$(gettextsrcdir)/$$file; \
333 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
334 dists="$(DISTFILES.generated)"; \
335 for file in $$dists; do \
336 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
337 $(INSTALL_DATA) $$dir/$$file \
338 $(DESTDIR)$(gettextsrcdir)/$$file; \
340 dists="$(DISTFILES.obsolete)"; \
341 for file in $$dists; do \
342 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
348 install-strip: install
351 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
352 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
353 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
357 if test "$(PACKAGE)" = "gettext-tools" \
358 && test '@USE_INCLUDED_LIBINTL@' = no; then \
359 $(mkinstalldirs) $(DESTDIR)$(libdir); \
363 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
364 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
365 $(mkinstalldirs) $(DESTDIR)$(localedir); \
369 if test "$(PACKAGE)" = "gettext-tools"; then \
370 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
375 # Define this as empty until I found a useful application.
382 install-shlibs-strip:
385 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
386 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
387 rm -f $(DESTDIR)$(includedir)/libintl.h; \
388 $(LIBTOOL) --mode=uninstall \
389 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
393 if test "$(PACKAGE)" = "gettext-tools" \
394 && test '@USE_INCLUDED_LIBINTL@' = no; then \
395 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
399 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
400 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
401 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
402 dest=$(DESTDIR)$(libdir)/charset.alias; \
403 sed -f ref-del.sed $$dest > $$temp; \
404 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
407 $(INSTALL_DATA) $$temp $$dest; \
411 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
412 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
413 dest=$(DESTDIR)$(localedir)/locale.alias; \
414 sed -f ref-del.sed $$dest > $$temp; \
415 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
418 $(INSTALL_DATA) $$temp $$dest; \
425 if test "$(PACKAGE)" = "gettext-tools"; then \
426 for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
427 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
433 info dvi ps pdf html:
435 $(OBJECTS): libgnuintl.h
436 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
437 dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
438 explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
439 dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
440 dcigettext.$lo: $(srcdir)/eval-plural.h
441 localcharset.$lo: $(srcdir)/localcharset.h
442 localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
443 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
447 TAGS: $(HEADERS) $(SOURCES)
448 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
452 CTAGS: $(HEADERS) $(SOURCES)
453 here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
457 ID: $(HEADERS) $(SOURCES)
458 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
462 rm -f *.a *.la *.o *.obj *.lo core core.*
463 rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
469 rm -f Makefile ID TAGS
470 if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
471 rm -f ChangeLog.inst $(DISTFILES.normal); \
476 maintainer-clean: distclean
477 @echo "This command is intended for maintainers to use;"
478 @echo "it deletes files that may require special tools to rebuild."
481 # GNU gettext needs not contain the file `VERSION' but contains some
482 # other files which should not be distributed in other packages.
483 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
484 dist distdir: Makefile
485 if test "$(PACKAGE)" = "gettext-tools"; then \
488 if test "$(PACKAGE)" = "gettext-runtime"; then \
489 additional="$(DISTFILES.gettext)"; \
491 additional="$(DISTFILES.normal)"; \
493 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
494 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
495 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
496 cp -p $$dir/$$file $(distdir); \
500 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
501 # cd $(top_builddir) && $(SHELL) ./config.status
502 # This would be more efficient, but doesn't work any more with autoconf-2.57,
503 # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
504 cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
506 # Tell versions [3.59,3.63) of GNU make not to export all variables.
507 # Otherwise a system limit (for SysV at least) may be exceeded.