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)
77 printf-args.h printf-args.c \
78 printf-parse.h wprintf-parse.h printf-parse.c \
79 vasnprintf.h vasnwprintf.h vasnprintf.c \
131 DISTFILES.common = Makefile.in \
132 config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
133 DISTFILES.generated = plural.c
134 DISTFILES.normal = VERSION
135 DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
136 libgnuintl.h_vms Makefile.vms \
137 libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
138 DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
139 COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
141 all: all-@USE_INCLUDED_LIBINTL@
142 all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
143 all-no: all-no-@BUILD_INCLUDED_LIBINTL@
144 all-no-yes: libgnuintl.$la
147 libintl.a libgnuintl.a: $(OBJECTS)
150 @$(AR) cru $@ $(OBJECTS)
154 libintl.la libgnuintl.la: $(OBJECTS)
155 $(LIBTOOL) --mode=link \
156 $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
157 $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \
158 -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
162 # Libtool's library version information for libintl.
163 # Before making a gettext release, the gettext maintainer must change this
164 # according to the libtool documentation, section "Library interface versions".
165 # Maintainers of other packages that include the intl directory must *not*
166 # change these values.
172 .SUFFIXES: .c .y .o .lo .sin .sed
179 $(YACC) $(YFLAGS) --output $@ $<
182 bindtextdom.lo: $(srcdir)/bindtextdom.c
183 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
184 dcgettext.lo: $(srcdir)/dcgettext.c
185 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
186 dgettext.lo: $(srcdir)/dgettext.c
187 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
188 gettext.lo: $(srcdir)/gettext.c
189 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
190 finddomain.lo: $(srcdir)/finddomain.c
191 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
192 loadmsgcat.lo: $(srcdir)/loadmsgcat.c
193 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
194 localealias.lo: $(srcdir)/localealias.c
195 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
196 textdomain.lo: $(srcdir)/textdomain.c
197 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
198 l10nflist.lo: $(srcdir)/l10nflist.c
199 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
200 explodename.lo: $(srcdir)/explodename.c
201 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
202 dcigettext.lo: $(srcdir)/dcigettext.c
203 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
204 dcngettext.lo: $(srcdir)/dcngettext.c
205 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
206 dngettext.lo: $(srcdir)/dngettext.c
207 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
208 ngettext.lo: $(srcdir)/ngettext.c
209 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
210 plural.lo: $(srcdir)/plural.c
211 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
212 plural-exp.lo: $(srcdir)/plural-exp.c
213 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
214 localcharset.lo: $(srcdir)/localcharset.c
215 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
216 relocatable.lo: $(srcdir)/relocatable.c
217 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
218 localename.lo: $(srcdir)/localename.c
219 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
220 log.lo: $(srcdir)/log.c
221 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
222 printf.lo: $(srcdir)/printf.c
223 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
224 osdep.lo: $(srcdir)/osdep.c
225 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
226 intl-compat.lo: $(srcdir)/intl-compat.c
227 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
229 ref-add.sed: $(srcdir)/ref-add.sin
230 @echo " SED ref-add.sed"
231 @sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
232 @mv t-ref-add.sed ref-add.sed
233 ref-del.sed: $(srcdir)/ref-del.sin
234 @echo " SED ref-del.sed"
235 @sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
236 @mv t-ref-del.sed ref-del.sed
238 INCLUDES = -I. -I$(srcdir) -I..
240 libgnuintl.h: $(srcdir)/libgnuintl.h.in
241 @echo " SED libgnuintl.h "
242 @sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
243 -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
244 -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
245 -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
246 < $(srcdir)/libgnuintl.h.in > libgnuintl.h
248 libintl.h: libgnuintl.h
249 @echo " CP libintl.h"
250 @cp libgnuintl.h libintl.h
252 charset.alias: $(srcdir)/config.charset
253 @echo " CONFIG.CHARSET $@"
254 @$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
259 # We must not install the libintl.h/libintl.a files if we are on a
260 # system which has the GNU gettext() function in its C library or in a
262 # If you want to use the one which comes with this version of the
263 # package, you have to use `configure --with-included-gettext'.
264 install: install-exec install-data
266 @if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
267 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
268 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
269 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
270 $(LIBTOOL) --mode=install \
271 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
272 if test "@RELOCATABLE@" = yes; then \
273 dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
274 if test -n "$$dependencies"; then \
275 rm -f $(DESTDIR)$(libdir)/libintl.la; \
281 @if test "$(PACKAGE)" = "gettext-tools" \
282 && test '@USE_INCLUDED_LIBINTL@' = no; then \
283 $(mkinstalldirs) $(DESTDIR)$(libdir); \
284 $(LIBTOOL) --mode=install \
285 $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
286 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
287 $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
288 $(LIBTOOL) --mode=uninstall \
289 rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
293 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
294 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
295 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
296 dest=$(DESTDIR)$(libdir)/charset.alias; \
297 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
298 orig=$(DESTDIR)$(libdir)/charset.alias; \
299 sed -f ref-add.sed $$orig > $$temp; \
300 $(INSTALL_DATA) $$temp $$dest; \
303 if test @GLIBC21@ = no; then \
304 orig=charset.alias; \
305 sed -f ref-add.sed $$orig > $$temp; \
306 $(INSTALL_DATA) $$temp $$dest; \
310 $(mkinstalldirs) $(DESTDIR)$(localedir); \
311 test -f $(DESTDIR)$(localedir)/locale.alias \
312 && orig=$(DESTDIR)$(localedir)/locale.alias \
313 || orig=$(srcdir)/locale.alias; \
314 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
315 dest=$(DESTDIR)$(localedir)/locale.alias; \
316 sed -f ref-add.sed $$orig > $$temp; \
317 $(INSTALL_DATA) $$temp $$dest; \
323 @if test "$(PACKAGE)" = "gettext-tools"; then \
324 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
325 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
326 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
327 dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
328 for file in $$dists; do \
329 $(INSTALL_DATA) $(srcdir)/$$file \
330 $(DESTDIR)$(gettextsrcdir)/$$file; \
332 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
333 dists="$(DISTFILES.generated)"; \
334 for file in $$dists; do \
335 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
336 $(INSTALL_DATA) $$dir/$$file \
337 $(DESTDIR)$(gettextsrcdir)/$$file; \
339 dists="$(DISTFILES.obsolete)"; \
340 for file in $$dists; do \
341 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
347 install-strip: install
350 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
351 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
352 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
356 if test "$(PACKAGE)" = "gettext-tools" \
357 && test '@USE_INCLUDED_LIBINTL@' = no; then \
358 $(mkinstalldirs) $(DESTDIR)$(libdir); \
362 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
363 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
364 $(mkinstalldirs) $(DESTDIR)$(localedir); \
368 if test "$(PACKAGE)" = "gettext-tools"; then \
369 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
374 # Define this as empty until I found a useful application.
381 install-shlibs-strip:
384 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
385 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
386 rm -f $(DESTDIR)$(includedir)/libintl.h; \
387 $(LIBTOOL) --mode=uninstall \
388 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
392 if test "$(PACKAGE)" = "gettext-tools" \
393 && test '@USE_INCLUDED_LIBINTL@' = no; then \
394 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
398 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
399 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
400 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
401 dest=$(DESTDIR)$(libdir)/charset.alias; \
402 sed -f ref-del.sed $$dest > $$temp; \
403 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
406 $(INSTALL_DATA) $$temp $$dest; \
410 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
411 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
412 dest=$(DESTDIR)$(localedir)/locale.alias; \
413 sed -f ref-del.sed $$dest > $$temp; \
414 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
417 $(INSTALL_DATA) $$temp $$dest; \
424 if test "$(PACKAGE)" = "gettext-tools"; then \
425 for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
426 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
432 info dvi ps pdf html:
434 $(OBJECTS): libgnuintl.h
435 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
436 dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
437 explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
438 dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
439 dcigettext.$lo: $(srcdir)/eval-plural.h
440 localcharset.$lo: $(srcdir)/localcharset.h
441 localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
442 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
446 TAGS: $(HEADERS) $(SOURCES)
447 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
451 CTAGS: $(HEADERS) $(SOURCES)
452 here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
456 ID: $(HEADERS) $(SOURCES)
457 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
461 rm -f *.a *.la *.o *.obj *.lo core core.*
462 rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
468 rm -f Makefile ID TAGS
469 if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
470 rm -f ChangeLog.inst $(DISTFILES.normal); \
475 maintainer-clean: distclean
476 @echo "This command is intended for maintainers to use;"
477 @echo "it deletes files that may require special tools to rebuild."
480 # GNU gettext needs not contain the file `VERSION' but contains some
481 # other files which should not be distributed in other packages.
482 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
483 dist distdir: Makefile
484 if test "$(PACKAGE)" = "gettext-tools"; then \
487 if test "$(PACKAGE)" = "gettext-runtime"; then \
488 additional="$(DISTFILES.gettext)"; \
490 additional="$(DISTFILES.normal)"; \
492 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
493 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
494 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
495 cp -p $$dir/$$file $(distdir); \
499 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
500 # cd $(top_builddir) && $(SHELL) ./config.status
501 # This would be more efficient, but doesn't work any more with autoconf-2.57,
502 # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
503 cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
505 # Tell versions [3.59,3.63) of GNU make not to export all variables.
506 # Otherwise a system limit (for SysV at least) may be exceeded.