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@
34 datarootdir = @datarootdir@
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)
150 $(AR) cru $@ $(OBJECTS)
153 libintl.la libgnuintl.la: $(OBJECTS)
154 $(LIBTOOL) --mode=link \
155 $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
156 $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \
157 -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
161 # Libtool's library version information for libintl.
162 # Before making a gettext release, the gettext maintainer must change this
163 # according to the libtool documentation, section "Library interface versions".
164 # Maintainers of other packages that include the intl directory must *not*
165 # change these values.
171 .SUFFIXES: .c .y .o .lo .sin .sed
177 $(YACC) $(YFLAGS) --output $@ $<
180 bindtextdom.lo: $(srcdir)/bindtextdom.c
181 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
182 dcgettext.lo: $(srcdir)/dcgettext.c
183 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
184 dgettext.lo: $(srcdir)/dgettext.c
185 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
186 gettext.lo: $(srcdir)/gettext.c
187 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
188 finddomain.lo: $(srcdir)/finddomain.c
189 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
190 loadmsgcat.lo: $(srcdir)/loadmsgcat.c
191 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
192 localealias.lo: $(srcdir)/localealias.c
193 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
194 textdomain.lo: $(srcdir)/textdomain.c
195 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
196 l10nflist.lo: $(srcdir)/l10nflist.c
197 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
198 explodename.lo: $(srcdir)/explodename.c
199 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
200 dcigettext.lo: $(srcdir)/dcigettext.c
201 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
202 dcngettext.lo: $(srcdir)/dcngettext.c
203 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
204 dngettext.lo: $(srcdir)/dngettext.c
205 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
206 ngettext.lo: $(srcdir)/ngettext.c
207 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
208 plural.lo: $(srcdir)/plural.c
209 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
210 plural-exp.lo: $(srcdir)/plural-exp.c
211 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
212 localcharset.lo: $(srcdir)/localcharset.c
213 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
214 relocatable.lo: $(srcdir)/relocatable.c
215 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
216 localename.lo: $(srcdir)/localename.c
217 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
218 log.lo: $(srcdir)/log.c
219 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
220 printf.lo: $(srcdir)/printf.c
221 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
222 osdep.lo: $(srcdir)/osdep.c
223 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
224 intl-compat.lo: $(srcdir)/intl-compat.c
225 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
227 ref-add.sed: $(srcdir)/ref-add.sin
228 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
229 mv t-ref-add.sed ref-add.sed
230 ref-del.sed: $(srcdir)/ref-del.sin
231 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
232 mv t-ref-del.sed ref-del.sed
234 INCLUDES = -I. -I$(srcdir) -I../src
236 libgnuintl.h: $(srcdir)/libgnuintl.h.in
237 sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
238 -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
239 -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
240 -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
241 < $(srcdir)/libgnuintl.h.in > libgnuintl.h
243 libintl.h: libgnuintl.h
244 cp libgnuintl.h libintl.h
246 charset.alias: $(srcdir)/config.charset
247 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
252 # We must not install the libintl.h/libintl.a files if we are on a
253 # system which has the GNU gettext() function in its C library or in a
255 # If you want to use the one which comes with this version of the
256 # package, you have to use `configure --with-included-gettext'.
257 install: install-exec install-data
259 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
260 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
261 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
262 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
263 $(LIBTOOL) --mode=install \
264 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
265 if test "@RELOCATABLE@" = yes; then \
266 dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
267 if test -n "$$dependencies"; then \
268 rm -f $(DESTDIR)$(libdir)/libintl.la; \
274 if test "$(PACKAGE)" = "gettext-tools" \
275 && test '@USE_INCLUDED_LIBINTL@' = no; then \
276 $(mkinstalldirs) $(DESTDIR)$(libdir); \
277 $(LIBTOOL) --mode=install \
278 $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
279 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
280 $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
281 $(LIBTOOL) --mode=uninstall \
282 rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
286 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
287 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
288 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
289 dest=$(DESTDIR)$(libdir)/charset.alias; \
290 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
291 orig=$(DESTDIR)$(libdir)/charset.alias; \
292 sed -f ref-add.sed $$orig > $$temp; \
293 $(INSTALL_DATA) $$temp $$dest; \
296 if test @GLIBC21@ = no; then \
297 orig=charset.alias; \
298 sed -f ref-add.sed $$orig > $$temp; \
299 $(INSTALL_DATA) $$temp $$dest; \
303 $(mkinstalldirs) $(DESTDIR)$(localedir); \
304 test -f $(DESTDIR)$(localedir)/locale.alias \
305 && orig=$(DESTDIR)$(localedir)/locale.alias \
306 || orig=$(srcdir)/locale.alias; \
307 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
308 dest=$(DESTDIR)$(localedir)/locale.alias; \
309 sed -f ref-add.sed $$orig > $$temp; \
310 $(INSTALL_DATA) $$temp $$dest; \
316 if test "$(PACKAGE)" = "gettext-tools"; then \
317 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
318 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
319 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
320 dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
321 for file in $$dists; do \
322 $(INSTALL_DATA) $(srcdir)/$$file \
323 $(DESTDIR)$(gettextsrcdir)/$$file; \
325 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
326 dists="$(DISTFILES.generated)"; \
327 for file in $$dists; do \
328 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
329 $(INSTALL_DATA) $$dir/$$file \
330 $(DESTDIR)$(gettextsrcdir)/$$file; \
332 dists="$(DISTFILES.obsolete)"; \
333 for file in $$dists; do \
334 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
340 install-strip: install
343 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
344 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
345 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
349 if test "$(PACKAGE)" = "gettext-tools" \
350 && test '@USE_INCLUDED_LIBINTL@' = no; then \
351 $(mkinstalldirs) $(DESTDIR)$(libdir); \
355 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
356 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
357 $(mkinstalldirs) $(DESTDIR)$(localedir); \
361 if test "$(PACKAGE)" = "gettext-tools"; then \
362 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
367 # Define this as empty until I found a useful application.
371 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
372 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
373 rm -f $(DESTDIR)$(includedir)/libintl.h; \
374 $(LIBTOOL) --mode=uninstall \
375 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
379 if test "$(PACKAGE)" = "gettext-tools" \
380 && test '@USE_INCLUDED_LIBINTL@' = no; then \
381 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
385 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
386 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
387 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
388 dest=$(DESTDIR)$(libdir)/charset.alias; \
389 sed -f ref-del.sed $$dest > $$temp; \
390 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
393 $(INSTALL_DATA) $$temp $$dest; \
397 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
398 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
399 dest=$(DESTDIR)$(localedir)/locale.alias; \
400 sed -f ref-del.sed $$dest > $$temp; \
401 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
404 $(INSTALL_DATA) $$temp $$dest; \
411 if test "$(PACKAGE)" = "gettext-tools"; then \
412 for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
413 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
419 info dvi ps pdf html:
421 $(OBJECTS): ../src/config.h libgnuintl.h
422 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
423 dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
424 explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
425 dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
426 dcigettext.$lo: $(srcdir)/eval-plural.h
427 localcharset.$lo: $(srcdir)/localcharset.h
428 localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
429 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
433 TAGS: $(HEADERS) $(SOURCES)
434 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
438 CTAGS: $(HEADERS) $(SOURCES)
439 here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
443 ID: $(HEADERS) $(SOURCES)
444 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
448 rm -f *.a *.la *.o *.obj *.lo core core.*
449 rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
455 rm -f Makefile ID TAGS
456 if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
457 rm -f ChangeLog.inst $(DISTFILES.normal); \
462 maintainer-clean: distclean
463 @echo "This command is intended for maintainers to use;"
464 @echo "it deletes files that may require special tools to rebuild."
467 # GNU gettext needs not contain the file `VERSION' but contains some
468 # other files which should not be distributed in other packages.
469 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
470 dist distdir: Makefile
471 if test "$(PACKAGE)" = "gettext-tools"; then \
474 if test "$(PACKAGE)" = "gettext-runtime"; then \
475 additional="$(DISTFILES.gettext)"; \
477 additional="$(DISTFILES.normal)"; \
479 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
480 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
481 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
482 cp -p $$dir/$$file $(distdir); \
486 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
487 cd $(top_builddir) && $(SHELL) ./config.status
488 # This would be more efficient, but doesn't work any more with autoconf-2.57,
489 # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
490 # cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
492 # Tell versions [3.59,3.63) of GNU make not to export all variables.
493 # Otherwise a system limit (for SysV at least) may be exceeded.