1
# Makefile for directory with message catalog handling library of GNU gettext
2
# Copyright (C) 1995-1998, 2000-2006 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
25
top_srcdir = @top_srcdir@
28
# The VPATH variables allows builds with $builddir != $srcdir, assuming a
29
# 'make' program that supports VPATH (such as GNU make). This line is removed
30
# by autoconf automatically when "$(srcdir)" = ".".
31
# In this directory, the VPATH handling is particular:
32
# 1. If INTL_LIBTOOL_SUFFIX_PREFIX is 'l' (indicating a build with libtool),
33
# the .c -> .lo rules carefully use $(srcdir), so that VPATH can be omitted.
34
# 2. If PACKAGE = gettext-tools, VPATH _must_ be omitted, because otherwise
35
# 'make' does the wrong thing if GNU gettext was configured with
36
# "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la
37
# files it finds in srcdir = ../../gettext-runtime/intl.
41
exec_prefix = @exec_prefix@
42
transform = @program_transform_name@
44
includedir = @includedir@
45
datarootdir = @datarootdir@
47
localedir = $(datadir)/locale
48
gettextsrcdir = $(datadir)/gettext/intl
49
aliaspath = $(localedir)
53
INSTALL_DATA = @INSTALL_DATA@
56
# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
57
# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
58
# @install_sh@ does not start with $(SHELL), so we add it.
59
# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
60
# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
61
# versions, $(mkinstalldirs) and $(install_sh) are unused.
62
mkinstalldirs = $(SHELL) @install_sh@ -d
63
install_sh = $(SHELL) @install_sh@
67
l = @INTL_LIBTOOL_SUFFIX_PREFIX@
73
YACC = @INTLBISON@ -y -d
74
YFLAGS = --name-prefix=__gettext
76
# -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro.
77
# -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro.
78
DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
79
-DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL \
80
-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
81
-Dset_relocation_prefix=libintl_set_relocation_prefix \
82
-Drelocate=libintl_relocate \
83
-DDEPENDS_ON_LIBICONV=1 @DEFS@
85
CFLAGS = @CFLAGS@ @CFLAG_VISIBILITY@
86
LDFLAGS = @LDFLAGS@ $(LDFLAGS_@WOE32DLL@)
87
LDFLAGS_yes = -Wl,--export-all-symbols
91
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
104
printf-args.h printf-args.c \
105
printf-parse.h wprintf-parse.h printf-parse.c \
106
vasnprintf.h vasnwprintf.h vasnprintf.c \
167
DISTFILES.common = Makefile.in \
168
config.charset locale.alias ref-add.sin ref-del.sin export.h \
169
$(HEADERS) $(SOURCES)
170
DISTFILES.generated = plural.c
171
DISTFILES.normal = VERSION
172
DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc README.woe32
173
DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
174
COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h \
175
libgnuintl.h_vms Makefile.vms libgnuintl.h.msvc-static \
176
libgnuintl.h.msvc-shared Makefile.msvc
178
all: all-@USE_INCLUDED_LIBINTL@
179
all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
180
all-no: all-no-@BUILD_INCLUDED_LIBINTL@
181
all-no-yes: libgnuintl.$la
184
libintl.a libgnuintl.a: $(OBJECTS)
186
$(AR) cru $@ $(OBJECTS)
189
libintl.la libgnuintl.la: $(OBJECTS)
190
$(LIBTOOL) --mode=link \
191
$(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
192
$(OBJECTS) @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(LIBS) @LTLIBTHREAD@ -lc \
193
-version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
197
# Libtool's library version information for libintl.
198
# Before making a gettext release, the gettext maintainer must change this
199
# according to the libtool documentation, section "Library interface versions".
200
# Maintainers of other packages that include the intl directory must *not*
201
# change these values.
207
.SUFFIXES: .c .y .o .lo .sin .sed
213
$(YACC) $(YFLAGS) --output $@ $<
216
bindtextdom.lo: $(srcdir)/bindtextdom.c
217
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
218
dcgettext.lo: $(srcdir)/dcgettext.c
219
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
220
dgettext.lo: $(srcdir)/dgettext.c
221
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
222
gettext.lo: $(srcdir)/gettext.c
223
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
224
finddomain.lo: $(srcdir)/finddomain.c
225
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
226
hash-string.lo: $(srcdir)/hash-string.c
227
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/hash-string.c
228
loadmsgcat.lo: $(srcdir)/loadmsgcat.c
229
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
230
localealias.lo: $(srcdir)/localealias.c
231
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
232
textdomain.lo: $(srcdir)/textdomain.c
233
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
234
l10nflist.lo: $(srcdir)/l10nflist.c
235
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
236
explodename.lo: $(srcdir)/explodename.c
237
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
238
dcigettext.lo: $(srcdir)/dcigettext.c
239
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
240
dcngettext.lo: $(srcdir)/dcngettext.c
241
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
242
dngettext.lo: $(srcdir)/dngettext.c
243
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
244
ngettext.lo: $(srcdir)/ngettext.c
245
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
246
plural.lo: $(srcdir)/plural.c
247
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
248
plural-exp.lo: $(srcdir)/plural-exp.c
249
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
250
localcharset.lo: $(srcdir)/localcharset.c
251
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
252
lock.lo: $(srcdir)/lock.c
253
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/lock.c
254
relocatable.lo: $(srcdir)/relocatable.c
255
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
256
langprefs.lo: $(srcdir)/langprefs.c
257
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/langprefs.c
258
localename.lo: $(srcdir)/localename.c
259
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
260
log.lo: $(srcdir)/log.c
261
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
262
printf.lo: $(srcdir)/printf.c
263
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
264
version.lo: $(srcdir)/version.c
265
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/version.c
266
osdep.lo: $(srcdir)/osdep.c
267
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
268
intl-compat.lo: $(srcdir)/intl-compat.c
269
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
271
ref-add.sed: $(srcdir)/ref-add.sin
272
sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
273
mv t-ref-add.sed ref-add.sed
274
ref-del.sed: $(srcdir)/ref-del.sin
275
sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
276
mv t-ref-del.sed ref-del.sed
278
INCLUDES = -I. -I$(srcdir) -I..
280
libgnuintl.h: $(srcdir)/libgnuintl.h.in
281
sed -e '/IN_LIBGLOCALE/d' \
282
-e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
283
-e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
284
-e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
285
-e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
286
< $(srcdir)/libgnuintl.h.in \
287
| if test '@WOE32DLL@' = yes; then \
288
sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/'; \
292
| sed -e 's/extern \([^"]\)/extern LIBINTL_DLL_EXPORTED \1/' \
293
-e "/#define _LIBINTL_H/r $(srcdir)/export.h" \
294
| sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \
297
libintl.h: $(srcdir)/libgnuintl.h.in
298
sed -e '/IN_LIBGLOCALE/d' \
299
-e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
300
-e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
301
-e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
302
-e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
303
< $(srcdir)/libgnuintl.h.in > libintl.h
305
charset.alias: $(srcdir)/config.charset
306
$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
311
# We must not install the libintl.h/libintl.a files if we are on a
312
# system which has the GNU gettext() function in its C library or in a
314
# If you want to use the one which comes with this version of the
315
# package, you have to use `configure --with-included-gettext'.
316
install: install-exec install-data
318
if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
319
&& test '@USE_INCLUDED_LIBINTL@' = yes; then \
320
$(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
321
$(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
322
$(LIBTOOL) --mode=install \
323
$(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
324
if test "@RELOCATABLE@" = yes; then \
325
dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
326
if test -n "$$dependencies"; then \
327
rm -f $(DESTDIR)$(libdir)/libintl.la; \
333
if test "$(PACKAGE)" = "gettext-tools" \
334
&& test '@USE_INCLUDED_LIBINTL@' = no \
335
&& test @GLIBC2@ != no; then \
336
$(mkdir_p) $(DESTDIR)$(libdir); \
337
$(LIBTOOL) --mode=install \
338
$(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
339
rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
340
$(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
341
$(LIBTOOL) --mode=uninstall \
342
rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
346
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
347
test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \
348
temp=$(DESTDIR)$(libdir)/t-charset.alias; \
349
dest=$(DESTDIR)$(libdir)/charset.alias; \
350
if test -f $(DESTDIR)$(libdir)/charset.alias; then \
351
orig=$(DESTDIR)$(libdir)/charset.alias; \
352
sed -f ref-add.sed $$orig > $$temp; \
353
$(INSTALL_DATA) $$temp $$dest; \
356
if test @GLIBC21@ = no; then \
357
orig=charset.alias; \
358
sed -f ref-add.sed $$orig > $$temp; \
359
$(INSTALL_DATA) $$temp $$dest; \
363
$(mkdir_p) $(DESTDIR)$(localedir); \
364
test -f $(DESTDIR)$(localedir)/locale.alias \
365
&& orig=$(DESTDIR)$(localedir)/locale.alias \
366
|| orig=$(srcdir)/locale.alias; \
367
temp=$(DESTDIR)$(localedir)/t-locale.alias; \
368
dest=$(DESTDIR)$(localedir)/locale.alias; \
369
sed -f ref-add.sed $$orig > $$temp; \
370
$(INSTALL_DATA) $$temp $$dest; \
376
if test "$(PACKAGE)" = "gettext-tools"; then \
377
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
378
$(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
379
$(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
380
dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
381
for file in $$dists; do \
382
$(INSTALL_DATA) $(srcdir)/$$file \
383
$(DESTDIR)$(gettextsrcdir)/$$file; \
385
chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
386
dists="$(DISTFILES.generated)"; \
387
for file in $$dists; do \
388
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
389
$(INSTALL_DATA) $$dir/$$file \
390
$(DESTDIR)$(gettextsrcdir)/$$file; \
392
dists="$(DISTFILES.obsolete)"; \
393
for file in $$dists; do \
394
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
400
install-strip: install
403
if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
404
&& test '@USE_INCLUDED_LIBINTL@' = yes; then \
405
$(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
409
if test "$(PACKAGE)" = "gettext-tools" \
410
&& test '@USE_INCLUDED_LIBINTL@' = no \
411
&& test @GLIBC2@ != no; then \
412
$(mkdir_p) $(DESTDIR)$(libdir); \
416
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
417
test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \
418
$(mkdir_p) $(DESTDIR)$(localedir); \
422
if test "$(PACKAGE)" = "gettext-tools"; then \
423
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
428
# Define this as empty until I found a useful application.
432
if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
433
&& test '@USE_INCLUDED_LIBINTL@' = yes; then \
434
rm -f $(DESTDIR)$(includedir)/libintl.h; \
435
$(LIBTOOL) --mode=uninstall \
436
rm -f $(DESTDIR)$(libdir)/libintl.$la; \
440
if test "$(PACKAGE)" = "gettext-tools" \
441
&& test '@USE_INCLUDED_LIBINTL@' = no \
442
&& test @GLIBC2@ != no; then \
443
rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
447
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
448
if test -f $(DESTDIR)$(libdir)/charset.alias; then \
449
temp=$(DESTDIR)$(libdir)/t-charset.alias; \
450
dest=$(DESTDIR)$(libdir)/charset.alias; \
451
sed -f ref-del.sed $$dest > $$temp; \
452
if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
455
$(INSTALL_DATA) $$temp $$dest; \
459
if test -f $(DESTDIR)$(localedir)/locale.alias; then \
460
temp=$(DESTDIR)$(localedir)/t-locale.alias; \
461
dest=$(DESTDIR)$(localedir)/locale.alias; \
462
sed -f ref-del.sed $$dest > $$temp; \
463
if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
466
$(INSTALL_DATA) $$temp $$dest; \
473
if test "$(PACKAGE)" = "gettext-tools"; then \
474
for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
475
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
481
info dvi ps pdf html:
483
$(OBJECTS): ../config.h libgnuintl.h
484
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
485
hash-string.$lo dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
486
explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
487
dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
488
dcigettext.$lo: $(srcdir)/eval-plural.h
489
localcharset.$lo: $(srcdir)/localcharset.h
490
bindtextdom.$lo dcigettext.$lo finddomain.$lo loadmsgcat.$lo localealias.$lo lock.$lo log.$lo: $(srcdir)/lock.h
491
localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
492
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
494
# A bison-2.1 generated plural.c includes <libintl.h> if ENABLE_NLS.
495
PLURAL_DEPS_yes = libintl.h
497
plural.$lo: $(PLURAL_DEPS_@USE_INCLUDED_LIBINTL@)
501
TAGS: $(HEADERS) $(SOURCES)
502
here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
506
CTAGS: $(HEADERS) $(SOURCES)
507
here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
511
ID: $(HEADERS) $(SOURCES)
512
here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
516
rm -f *.a *.la *.o *.obj *.lo core core.*
517
rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
523
rm -f Makefile ID TAGS
524
if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
525
rm -f ChangeLog.inst $(DISTFILES.normal); \
530
maintainer-clean: distclean
531
@echo "This command is intended for maintainers to use;"
532
@echo "it deletes files that may require special tools to rebuild."
535
# GNU gettext needs not contain the file `VERSION' but contains some
536
# other files which should not be distributed in other packages.
537
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
538
dist distdir: Makefile
539
if test "$(PACKAGE)" = "gettext-tools"; then \
542
if test "$(PACKAGE)" = "gettext-runtime"; then \
543
additional="$(DISTFILES.gettext)"; \
545
additional="$(DISTFILES.normal)"; \
547
$(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
548
for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
549
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
550
cp -p $$dir/$$file $(distdir) || test $$file = Makefile.in || exit 1; \
554
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
555
cd $(top_builddir) && $(SHELL) ./config.status
556
# This would be more efficient, but doesn't work any more with autoconf-2.57,
557
# when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
558
# cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
560
# Tell versions [3.59,3.63) of GNU make not to export all variables.
561
# Otherwise a system limit (for SysV at least) may be exceeded.