1 # Makefile for directory with message catalog handling library of GNU gettext
2 # Copyright (C) 1995-1998, 2000-2005 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@
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 \
133 DISTFILES.common = Makefile.in \
134 config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
135 DISTFILES.generated = plural.c
136 DISTFILES.normal = VERSION
137 DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
138 libgnuintl.h_vms Makefile.vms \
139 libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
140 DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
141 COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
143 all: all-@USE_INCLUDED_LIBINTL@
144 all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
145 all-no: all-no-@BUILD_INCLUDED_LIBINTL@
146 all-no-yes: libgnuintl.$la
149 libintl.a libgnuintl.a: $(OBJECTS)
151 $(AR) cru $@ $(OBJECTS)
154 libintl.la libgnuintl.la: $(OBJECTS)
155 $(LIBTOOL) --mode=link \
156 $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
157 $(OBJECTS) @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(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
178 $(YACC) $(YFLAGS) --output $@ $<
181 bindtextdom.lo: $(srcdir)/bindtextdom.c
182 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
183 dcgettext.lo: $(srcdir)/dcgettext.c
184 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
185 dgettext.lo: $(srcdir)/dgettext.c
186 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
187 gettext.lo: $(srcdir)/gettext.c
188 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
189 finddomain.lo: $(srcdir)/finddomain.c
190 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
191 loadmsgcat.lo: $(srcdir)/loadmsgcat.c
192 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
193 localealias.lo: $(srcdir)/localealias.c
194 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
195 textdomain.lo: $(srcdir)/textdomain.c
196 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
197 l10nflist.lo: $(srcdir)/l10nflist.c
198 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
199 explodename.lo: $(srcdir)/explodename.c
200 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
201 dcigettext.lo: $(srcdir)/dcigettext.c
202 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
203 dcngettext.lo: $(srcdir)/dcngettext.c
204 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
205 dngettext.lo: $(srcdir)/dngettext.c
206 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
207 ngettext.lo: $(srcdir)/ngettext.c
208 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
209 plural.lo: $(srcdir)/plural.c
210 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
211 plural-exp.lo: $(srcdir)/plural-exp.c
212 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
213 localcharset.lo: $(srcdir)/localcharset.c
214 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
215 relocatable.lo: $(srcdir)/relocatable.c
216 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
217 langprefs.lo: $(srcdir)/langprefs.c
218 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/langprefs.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 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 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
235 mv t-ref-del.sed ref-del.sed
237 INCLUDES = -I. -I$(srcdir) -I..
239 libintl.h: libgnuintl.h
240 cp libgnuintl.h libintl.h
242 charset.alias: $(srcdir)/config.charset
243 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
248 # We must not install the libintl.h/libintl.a files if we are on a
249 # system which has the GNU gettext() function in its C library or in a
251 # If you want to use the one which comes with this version of the
252 # package, you have to use `configure --with-included-gettext'.
253 install: install-exec install-data
255 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
256 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
257 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
258 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
259 $(LIBTOOL) --mode=install \
260 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
261 if test "@RELOCATABLE@" = yes; then \
262 dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
263 if test -n "$$dependencies"; then \
264 rm -f $(DESTDIR)$(libdir)/libintl.la; \
270 if test "$(PACKAGE)" = "gettext-tools" \
271 && test '@USE_INCLUDED_LIBINTL@' = no \
272 && test @GLIBC2@ != no; then \
273 $(mkinstalldirs) $(DESTDIR)$(libdir); \
274 $(LIBTOOL) --mode=install \
275 $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
276 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
277 $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
278 $(LIBTOOL) --mode=uninstall \
279 rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
283 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
284 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
285 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
286 dest=$(DESTDIR)$(libdir)/charset.alias; \
287 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
288 orig=$(DESTDIR)$(libdir)/charset.alias; \
289 sed -f ref-add.sed $$orig > $$temp; \
290 $(INSTALL_DATA) $$temp $$dest; \
293 if test @GLIBC21@ = no; then \
294 orig=charset.alias; \
295 sed -f ref-add.sed $$orig > $$temp; \
296 $(INSTALL_DATA) $$temp $$dest; \
300 $(mkinstalldirs) $(DESTDIR)$(localedir); \
301 test -f $(DESTDIR)$(localedir)/locale.alias \
302 && orig=$(DESTDIR)$(localedir)/locale.alias \
303 || orig=$(srcdir)/locale.alias; \
304 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
305 dest=$(DESTDIR)$(localedir)/locale.alias; \
306 sed -f ref-add.sed $$orig > $$temp; \
307 $(INSTALL_DATA) $$temp $$dest; \
313 if test "$(PACKAGE)" = "gettext-tools"; then \
314 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
315 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
316 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
317 dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
318 for file in $$dists; do \
319 $(INSTALL_DATA) $(srcdir)/$$file \
320 $(DESTDIR)$(gettextsrcdir)/$$file; \
322 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
323 dists="$(DISTFILES.generated)"; \
324 for file in $$dists; do \
325 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
326 $(INSTALL_DATA) $$dir/$$file \
327 $(DESTDIR)$(gettextsrcdir)/$$file; \
329 dists="$(DISTFILES.obsolete)"; \
330 for file in $$dists; do \
331 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
337 install-strip: install
340 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
341 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
342 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
346 if test "$(PACKAGE)" = "gettext-tools" \
347 && test '@USE_INCLUDED_LIBINTL@' = no \
348 && test @GLIBC2@ != no; then \
349 $(mkinstalldirs) $(DESTDIR)$(libdir); \
353 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
354 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
355 $(mkinstalldirs) $(DESTDIR)$(localedir); \
359 if test "$(PACKAGE)" = "gettext-tools"; then \
360 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
365 # Define this as empty until I found a useful application.
369 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
370 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
371 rm -f $(DESTDIR)$(includedir)/libintl.h; \
372 $(LIBTOOL) --mode=uninstall \
373 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
377 if test "$(PACKAGE)" = "gettext-tools" \
378 && test '@USE_INCLUDED_LIBINTL@' = no \
379 && test @GLIBC2@ != no; then \
380 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
384 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
385 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
386 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
387 dest=$(DESTDIR)$(libdir)/charset.alias; \
388 sed -f ref-del.sed $$dest > $$temp; \
389 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
392 $(INSTALL_DATA) $$temp $$dest; \
396 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
397 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
398 dest=$(DESTDIR)$(localedir)/locale.alias; \
399 sed -f ref-del.sed $$dest > $$temp; \
400 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
403 $(INSTALL_DATA) $$temp $$dest; \
410 if test "$(PACKAGE)" = "gettext-tools"; then \
411 for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
412 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
418 info dvi ps pdf html:
420 $(OBJECTS): ../config.h libgnuintl.h
421 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
422 dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
423 explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
424 dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
425 dcigettext.$lo: $(srcdir)/eval-plural.h
426 localcharset.$lo: $(srcdir)/localcharset.h
427 localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
428 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
432 TAGS: $(HEADERS) $(SOURCES)
433 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
437 CTAGS: $(HEADERS) $(SOURCES)
438 here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
442 ID: $(HEADERS) $(SOURCES)
443 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
447 rm -f *.a *.la *.o *.obj *.lo core core.*
448 rm -f libintl.h charset.alias ref-add.sed ref-del.sed
454 rm -f Makefile ID TAGS
455 if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
456 rm -f ChangeLog.inst $(DISTFILES.normal); \
461 maintainer-clean: distclean
462 @echo "This command is intended for maintainers to use;"
463 @echo "it deletes files that may require special tools to rebuild."
466 # GNU gettext needs not contain the file `VERSION' but contains some
467 # other files which should not be distributed in other packages.
468 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
469 dist distdir: Makefile
470 if test "$(PACKAGE)" = "gettext-tools"; then \
473 if test "$(PACKAGE)" = "gettext-runtime"; then \
474 additional="$(DISTFILES.gettext)"; \
476 additional="$(DISTFILES.normal)"; \
478 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
479 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
480 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
481 cp -p $$dir/$$file $(distdir) || test $$file = Makefile.in || exit 1; \
485 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
486 cd $(top_builddir) && $(SHELL) ./config.status
487 # This would be more efficient, but doesn't work any more with autoconf-2.57,
488 # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
489 # cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
491 # Tell versions [3.59,3.63) of GNU make not to export all variables.
492 # Otherwise a system limit (for SysV at least) may be exceeded.