blob: 00fdb61266c76371ddd79cd1d47efbec51244e04 [file] [log] [blame]
Jari Aaltob80f6442004-07-27 13:29:18 +00001# Makefile for directory with message catalog handling library of GNU gettext
Jari Aalto31859422009-01-12 13:36:28 +00002# Copyright (C) 1995-1998, 2000-2003, 2008,2009 Free Software Foundation, Inc.
Jari Aaltob80f6442004-07-27 13:29:18 +00003#
Jari Aalto31859422009-01-12 13:36:28 +00004
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
Jari Aaltob80f6442004-07-27 13:29:18 +000017
18PACKAGE = @PACKAGE_NAME@
19VERSION = @PACKAGE_VERSION@
20
21SHELL = /bin/sh
22
23srcdir = @srcdir@
24top_srcdir = @top_srcdir@
25top_builddir = @BUILD_DIR@
26VPATH = $(srcdir)
27
28prefix = @prefix@
29exec_prefix = @exec_prefix@
30transform = @program_transform_name@
Jari Aalto31859422009-01-12 13:36:28 +000031
32datarootdir = @datarootdir@
33
Jari Aaltob80f6442004-07-27 13:29:18 +000034libdir = @libdir@
35includedir = @includedir@
36datadir = @datadir@
Jari Aalto31859422009-01-12 13:36:28 +000037localedir = @localedir@
38
Jari Aaltob80f6442004-07-27 13:29:18 +000039gettextsrcdir = $(datadir)/gettext/intl
40aliaspath = $(localedir)
41subdir = intl
42
Jari Aalto31859422009-01-12 13:36:28 +000043@SET_MAKE@
44
Jari Aaltob80f6442004-07-27 13:29:18 +000045INSTALL = @INSTALL@
46INSTALL_DATA = @INSTALL_DATA@
47MKINSTALLDIRS = @MKINSTALLDIRS@
48mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
49
50l = @INTL_LIBTOOL_SUFFIX_PREFIX@
51
Chet Rameyac50fba2014-02-26 09:36:43 -050052AR = @AR@
Jari Aaltob80f6442004-07-27 13:29:18 +000053CC = @CC@
54LIBTOOL = @LIBTOOL@
55RANLIB = @RANLIB@
56YACC = @INTLBISON@ -y -d
57YFLAGS = --name-prefix=__gettext
58
Chet Rameyac50fba2014-02-26 09:36:43 -050059ARFLAGS = @ARFLAGS@
60
Jari Aalto95732b42005-12-07 14:08:12 +000061LOCAL_DEFS = @LOCAL_DEFS@
62
Jari Aaltob80f6442004-07-27 13:29:18 +000063DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
64-DLIBDIR=\"$(prefix)/libdata\" -DIN_LIBINTL \
65-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
66-Dset_relocation_prefix=libintl_set_relocation_prefix \
67-Drelocate=libintl_relocate \
Jari Aalto31859422009-01-12 13:36:28 +000068-DDEPENDS_ON_LIBICONV=1 @DEFS@ ${LOCAL_DEFS}
Jari Aaltob80f6442004-07-27 13:29:18 +000069CPPFLAGS = @CPPFLAGS@
70CFLAGS = @CFLAGS@
71LDFLAGS = @LDFLAGS@
72LIBS = @LIBS@
73
74COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
75
76HEADERS = \
77 gmo.h \
78 gettextP.h \
79 hash-string.h \
80 loadinfo.h \
81 plural-exp.h \
82 eval-plural.h \
83 localcharset.h \
84 relocatable.h \
85 os2compat.h \
86 libgnuintl.h.in
87SOURCES = \
88 bindtextdom.c \
89 dcgettext.c \
90 dgettext.c \
91 gettext.c \
92 finddomain.c \
93 loadmsgcat.c \
94 localealias.c \
95 textdomain.c \
96 l10nflist.c \
97 explodename.c \
98 dcigettext.c \
99 dcngettext.c \
100 dngettext.c \
101 ngettext.c \
102 plural.y \
103 plural-exp.c \
104 localcharset.c \
105 relocatable.c \
106 localename.c \
107 log.c \
108 osdep.c \
109 os2compat.c \
110 intl-compat.c
111OBJECTS = \
112 bindtextdom.$lo \
113 dcgettext.$lo \
114 dgettext.$lo \
115 gettext.$lo \
116 finddomain.$lo \
117 loadmsgcat.$lo \
118 localealias.$lo \
119 textdomain.$lo \
120 l10nflist.$lo \
121 explodename.$lo \
122 dcigettext.$lo \
123 dcngettext.$lo \
124 dngettext.$lo \
125 ngettext.$lo \
126 plural.$lo \
127 plural-exp.$lo \
128 localcharset.$lo \
129 relocatable.$lo \
130 localename.$lo \
131 log.$lo \
132 osdep.$lo \
133 intl-compat.$lo
134DISTFILES.common = Makefile.in \
135config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
136DISTFILES.generated = plural.c
137DISTFILES.normal = VERSION
138DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
139Makefile.vms libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
140DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
141COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
142
143all: all-@USE_INCLUDED_LIBINTL@
144all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
145all-no: all-no-@BUILD_INCLUDED_LIBINTL@
146all-no-yes: libgnuintl.$la
147all-no-no:
148
149libintl.a libgnuintl.a: $(OBJECTS)
150 rm -f $@
Chet Rameyac50fba2014-02-26 09:36:43 -0500151 $(AR) $(ARFLAGS) $@ $(OBJECTS)
Jari Aaltob80f6442004-07-27 13:29:18 +0000152 $(RANLIB) $@
153
154libintl.la libgnuintl.la: $(OBJECTS)
155 $(LIBTOOL) --mode=link \
156 $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
157 $(OBJECTS) @LTLIBICONV@ $(LIBS) \
158 -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
159 -rpath $(libdir) \
160 -no-undefined
161
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.
167LTV_CURRENT=5
168LTV_REVISION=0
169LTV_AGE=3
170
171.SUFFIXES:
172.SUFFIXES: .c .y .o .lo .sin .sed
173
174.c.o:
175 $(COMPILE) $<
176
177.y.c:
178 $(YACC) $(YFLAGS) --output $@ $<
179 rm -f $*.h
180
181bindtextdom.lo: $(srcdir)/bindtextdom.c
182 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
183dcgettext.lo: $(srcdir)/dcgettext.c
184 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
185dgettext.lo: $(srcdir)/dgettext.c
186 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
187gettext.lo: $(srcdir)/gettext.c
188 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
189finddomain.lo: $(srcdir)/finddomain.c
190 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
191loadmsgcat.lo: $(srcdir)/loadmsgcat.c
192 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
193localealias.lo: $(srcdir)/localealias.c
194 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
195textdomain.lo: $(srcdir)/textdomain.c
196 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
197l10nflist.lo: $(srcdir)/l10nflist.c
198 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
199explodename.lo: $(srcdir)/explodename.c
200 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
201dcigettext.lo: $(srcdir)/dcigettext.c
202 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
203dcngettext.lo: $(srcdir)/dcngettext.c
204 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
205dngettext.lo: $(srcdir)/dngettext.c
206 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
207ngettext.lo: $(srcdir)/ngettext.c
208 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
209plural.lo: $(srcdir)/plural.c
210 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
211plural-exp.lo: $(srcdir)/plural-exp.c
212 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
213localcharset.lo: $(srcdir)/localcharset.c
214 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
215relocatable.lo: $(srcdir)/relocatable.c
216 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
217localename.lo: $(srcdir)/localename.c
218 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
219log.lo: $(srcdir)/log.c
220 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
221osdep.lo: $(srcdir)/osdep.c
222 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
223intl-compat.lo: $(srcdir)/intl-compat.c
224 $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
225
226ref-add.sed: $(srcdir)/ref-add.sin
227 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
228 mv t-ref-add.sed ref-add.sed
229ref-del.sed: $(srcdir)/ref-del.sin
230 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
231 mv t-ref-del.sed ref-del.sed
232
233INCLUDES = -I. -I$(srcdir) -I${top_builddir} -I${top_srcdir}
234
235libgnuintl.h: $(srcdir)/libgnuintl.h.in
236 cp $(srcdir)/libgnuintl.h.in libgnuintl.h
237
238libintl.h: libgnuintl.h
Jari Aalto31859422009-01-12 13:36:28 +0000239 cmp libgnuintl.h libintl.h || cp libgnuintl.h libintl.h
Jari Aaltob80f6442004-07-27 13:29:18 +0000240
241charset.alias: $(srcdir)/config.charset
242 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
243 mv t-$@ $@
244
245check: all
246
247# We must not install the libintl.h/libintl.a files if we are on a
248# system which has the GNU gettext() function in its C library or in a
249# separate library.
250# If you want to use the one which comes with this version of the
251# package, you have to use `configure --with-included-gettext'.
252install: install-exec install-data
253install-exec: all
254 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
255 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
256 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
257 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
258 $(LIBTOOL) --mode=install \
259 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
260 if test "@RELOCATABLE@" = yes; then \
261 dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
262 if test -n "$dependencies"; then \
263 rm -f $(DESTDIR)$(libdir)/libintl.la; \
264 fi; \
265 fi; \
266 else \
267 : ; \
268 fi
269 if test "$(PACKAGE)" = "gettext-tools" \
270 && test '@USE_INCLUDED_LIBINTL@' = no; then \
271 $(mkinstalldirs) $(DESTDIR)$(libdir); \
272 $(LIBTOOL) --mode=install \
273 $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
274 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
275 $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
276 $(LIBTOOL) --mode=uninstall \
277 rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
278 else \
279 : ; \
280 fi
281 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
282 $(mkinstalldirs) $(DESTDIR)$(localedir); \
283 test -f $(DESTDIR)$(localedir)/locale.alias \
284 && orig=$(DESTDIR)$(localedir)/locale.alias \
285 || orig=$(srcdir)/locale.alias; \
286 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
287 dest=$(DESTDIR)$(localedir)/locale.alias; \
288 sed -f ref-add.sed $$orig > $$temp; \
289 $(INSTALL_DATA) $$temp $$dest; \
290 rm -f $$temp; \
291 else \
292 : ; \
293 fi
294install-data: all
295 if test "$(PACKAGE)" = "gettext-tools"; then \
296 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
297 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
298 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
299 dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
300 for file in $$dists; do \
301 $(INSTALL_DATA) $(srcdir)/$$file \
302 $(DESTDIR)$(gettextsrcdir)/$$file; \
303 done; \
304 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
305 dists="$(DISTFILES.generated)"; \
306 for file in $$dists; do \
307 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
308 $(INSTALL_DATA) $$dir/$$file \
309 $(DESTDIR)$(gettextsrcdir)/$$file; \
310 done; \
311 dists="$(DISTFILES.obsolete)"; \
312 for file in $$dists; do \
313 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
314 done; \
315 else \
316 : ; \
317 fi
318
319install-strip: install
320
321installdirs:
322 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
323 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
324 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
325 else \
326 : ; \
327 fi
328 if test "$(PACKAGE)" = "gettext-tools" \
329 && test '@USE_INCLUDED_LIBINTL@' = no; then \
330 $(mkinstalldirs) $(DESTDIR)$(libdir); \
331 else \
332 : ; \
333 fi
334 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
335 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
336 $(mkinstalldirs) $(DESTDIR)$(localedir); \
337 else \
338 : ; \
339 fi
340 if test "$(PACKAGE)" = "gettext-tools"; then \
341 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
342 else \
343 : ; \
344 fi
345
346# Define this as empty until I found a useful application.
347installcheck:
348
349uninstall:
350 if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
351 && test '@USE_INCLUDED_LIBINTL@' = yes; then \
352 rm -f $(DESTDIR)$(includedir)/libintl.h; \
353 $(LIBTOOL) --mode=uninstall \
354 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
355 else \
356 : ; \
357 fi
358 if test "$(PACKAGE)" = "gettext-tools" \
359 && test '@USE_INCLUDED_LIBINTL@' = no; then \
360 rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
361 else \
362 : ; \
363 fi
364 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
365 if test -f $(DESTDIR)$(prefix)/libdata/charset.alias; then \
366 temp=$(DESTDIR)$(prefix)/libdata/t-charset.alias; \
367 dest=$(DESTDIR)$(prefix)/libdata/charset.alias; \
368 sed -f ref-del.sed $$dest > $$temp; \
369 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
370 rm -f $$dest; \
371 else \
372 $(INSTALL_DATA) $$temp $$dest; \
373 fi; \
374 rm -f $$temp; \
375 fi; \
376 if test -f $(DESTDIR)$(localedir)/locale.alias; then \
377 temp=$(DESTDIR)$(localedir)/t-locale.alias; \
378 dest=$(DESTDIR)$(localedir)/locale.alias; \
379 sed -f ref-del.sed $$dest > $$temp; \
380 if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
381 rm -f $$dest; \
382 else \
383 $(INSTALL_DATA) $$temp $$dest; \
384 fi; \
385 rm -f $$temp; \
386 fi; \
387 else \
388 : ; \
389 fi
390 if test "$(PACKAGE)" = "gettext-tools"; then \
391 for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
392 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
393 done; \
394 else \
395 : ; \
396 fi
397
398info dvi ps pdf html:
399
400$(OBJECTS): ${top_builddir}/config.h libgnuintl.h
401bindtextdom.$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
402dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
403explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
404dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
405dcigettext.$lo: $(srcdir)/eval-plural.h
406localcharset.$lo: $(srcdir)/localcharset.h
407localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
408
409tags: TAGS
410
411TAGS: $(HEADERS) $(SOURCES)
412 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
413
414ctags: CTAGS
415
416CTAGS: $(HEADERS) $(SOURCES)
417 here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
418
419id: ID
420
421ID: $(HEADERS) $(SOURCES)
422 here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
423
424
425mostlyclean:
426 rm -f *.a *.la *.o *.obj *.lo core core.*
427 rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
428 rm -f -r .libs _libs
429
430clean: mostlyclean
431
432distclean: clean
433 rm -f Makefile ID TAGS
434 if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
435 rm -f ChangeLog.inst $(DISTFILES.normal); \
436 else \
437 : ; \
438 fi
439
440maintainer-clean: distclean
441 @echo "This command is intended for maintainers to use;"
442 @echo "it deletes files that may require special tools to rebuild."
443
444
445# GNU gettext needs not contain the file `VERSION' but contains some
446# other files which should not be distributed in other packages.
447distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
448dist distdir: Makefile
449 if test "$(PACKAGE)" = "gettext-tools"; then \
450 : ; \
451 else \
452 if test "$(PACKAGE)" = "gettext-runtime"; then \
453 additional="$(DISTFILES.gettext)"; \
454 else \
455 additional="$(DISTFILES.normal)"; \
456 fi; \
457 $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
458 for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
459 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
460 cp -p $$dir/$$file $(distdir); \
461 done; \
462 fi
463
464Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
465 cd $(top_builddir) && $(SHELL) ./config.status
466# This would be more efficient, but doesn't work any more with autoconf-2.57,
467# when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
468# cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
469
470# Tell versions [3.59,3.63) of GNU make not to export all variables.
471# Otherwise a system limit (for SysV at least) may be exceeded.
472.NOEXPORT: