| 1 | # Makefile for directory with message catalog handling in GNU NLS Utilities. |
|---|
| 2 | # Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. |
|---|
| 3 | # |
|---|
| 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) |
|---|
| 7 | # any later version. |
|---|
| 8 | # |
|---|
| 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. |
|---|
| 13 | # |
|---|
| 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, |
|---|
| 17 | # USA. |
|---|
| 18 | |
|---|
| 19 | PACKAGE = @PACKAGE@ |
|---|
| 20 | VERSION = @VERSION@ |
|---|
| 21 | |
|---|
| 22 | SHELL = /bin/sh |
|---|
| 23 | |
|---|
| 24 | srcdir = @srcdir@ |
|---|
| 25 | top_srcdir = @top_srcdir@ |
|---|
| 26 | top_builddir = .. |
|---|
| 27 | VPATH = @srcdir@ |
|---|
| 28 | |
|---|
| 29 | prefix = @prefix@ |
|---|
| 30 | exec_prefix = @exec_prefix@ |
|---|
| 31 | transform = @program_transform_name@ |
|---|
| 32 | libdir = @libdir@ |
|---|
| 33 | includedir = @includedir@ |
|---|
| 34 | datadir = @datadir@ |
|---|
| 35 | datarootdir = @datarootdir@ |
|---|
| 36 | localedir = $(datadir)/locale |
|---|
| 37 | gettextsrcdir = $(datadir)/gettext/intl |
|---|
| 38 | aliaspath = $(localedir) |
|---|
| 39 | subdir = intl |
|---|
| 40 | |
|---|
| 41 | INSTALL = @INSTALL@ |
|---|
| 42 | INSTALL_DATA = @INSTALL_DATA@ |
|---|
| 43 | MKINSTALLDIRS = @MKINSTALLDIRS@ |
|---|
| 44 | mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` |
|---|
| 45 | |
|---|
| 46 | l = @INTL_LIBTOOL_SUFFIX_PREFIX@ |
|---|
| 47 | |
|---|
| 48 | AR = ar |
|---|
| 49 | CC = @CC@ |
|---|
| 50 | LIBTOOL = @LIBTOOL@ |
|---|
| 51 | RANLIB = @RANLIB@ |
|---|
| 52 | YACC = @INTLBISON@ -y -d |
|---|
| 53 | YFLAGS = --name-prefix=__gettext |
|---|
| 54 | |
|---|
| 55 | DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ |
|---|
| 56 | -DLIBDIR=\"$(libdir)\" @DEFS@ |
|---|
| 57 | CPPFLAGS = @CPPFLAGS@ |
|---|
| 58 | CFLAGS = @CFLAGS@ |
|---|
| 59 | LDFLAGS = @LDFLAGS@ |
|---|
| 60 | |
|---|
| 61 | COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) |
|---|
| 62 | |
|---|
| 63 | HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h |
|---|
| 64 | COMHDRS = gettext.h gettextP.h hash-string.h |
|---|
| 65 | SOURCES = $(COMSRCS) intl-compat.c |
|---|
| 66 | COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ |
|---|
| 67 | finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \ |
|---|
| 68 | explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \ |
|---|
| 69 | localcharset.c |
|---|
| 70 | OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \ |
|---|
| 71 | finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \ |
|---|
| 72 | explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \ |
|---|
| 73 | plural.$lo localcharset.$lo |
|---|
| 74 | GETTOBJS = intl-compat.$lo |
|---|
| 75 | DISTFILES.common = Makefile.in \ |
|---|
| 76 | config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) |
|---|
| 77 | DISTFILES.generated = plural.c |
|---|
| 78 | DISTFILES.normal = VERSION |
|---|
| 79 | DISTFILES.gettext = COPYING.LIB-2 COPYING.LIB-2.1 libintl.glibc |
|---|
| 80 | DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c |
|---|
| 81 | |
|---|
| 82 | # Libtool's library version information for libintl. |
|---|
| 83 | # Before making a gettext release, the gettext maintainer must change this |
|---|
| 84 | # according to the libtool documentation, section "Library interface versions". |
|---|
| 85 | # Maintainers of other packages that include the intl directory must *not* |
|---|
| 86 | # change these values. |
|---|
| 87 | LTV_CURRENT=1 |
|---|
| 88 | LTV_REVISION=1 |
|---|
| 89 | LTV_AGE=0 |
|---|
| 90 | |
|---|
| 91 | .SUFFIXES: |
|---|
| 92 | .SUFFIXES: .c .y .o .lo .sin .sed |
|---|
| 93 | .c.o: |
|---|
| 94 | $(COMPILE) $< |
|---|
| 95 | .c.lo: |
|---|
| 96 | $(LIBTOOL) --mode=compile $(COMPILE) $< |
|---|
| 97 | |
|---|
| 98 | .y.c: |
|---|
| 99 | $(YACC) $(YFLAGS) --output $@ $< |
|---|
| 100 | rm -f $*.h |
|---|
| 101 | |
|---|
| 102 | .sin.sed: |
|---|
| 103 | sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@ |
|---|
| 104 | mv t-$@ $@ |
|---|
| 105 | |
|---|
| 106 | INCLUDES = -I.. -I. -I$(top_srcdir)/intl |
|---|
| 107 | |
|---|
| 108 | all: all-@USE_INCLUDED_LIBINTL@ |
|---|
| 109 | all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed |
|---|
| 110 | all-no: all-no-@BUILD_INCLUDED_LIBINTL@ |
|---|
| 111 | all-no-yes: libgnuintl.$la |
|---|
| 112 | all-no-no: |
|---|
| 113 | |
|---|
| 114 | libintl.a libgnuintl.a: $(OBJECTS) |
|---|
| 115 | rm -f $@ |
|---|
| 116 | $(AR) cru $@ $(OBJECTS) |
|---|
| 117 | $(RANLIB) $@ |
|---|
| 118 | |
|---|
| 119 | libintl.la libgnuintl.la: $(OBJECTS) |
|---|
| 120 | $(LIBTOOL) --mode=link \ |
|---|
| 121 | $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ |
|---|
| 122 | $(OBJECTS) @LIBICONV@ \ |
|---|
| 123 | -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ |
|---|
| 124 | -rpath $(libdir) \ |
|---|
| 125 | -no-undefined |
|---|
| 126 | |
|---|
| 127 | libintl.h: libgnuintl.h |
|---|
| 128 | cp $(srcdir)/libgnuintl.h libintl.h |
|---|
| 129 | |
|---|
| 130 | charset.alias: config.charset |
|---|
| 131 | $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ |
|---|
| 132 | mv t-$@ $@ |
|---|
| 133 | |
|---|
| 134 | check: all |
|---|
| 135 | |
|---|
| 136 | # This installation goal is only used in GNU gettext. Packages which |
|---|
| 137 | # only use the library should use install instead. |
|---|
| 138 | |
|---|
| 139 | # We must not install the libintl.h/libintl.a files if we are on a |
|---|
| 140 | # system which has the GNU gettext() function in its C library or in a |
|---|
| 141 | # separate library. |
|---|
| 142 | # If you want to use the one which comes with this version of the |
|---|
| 143 | # package, you have to use `configure --with-included-gettext'. |
|---|
| 144 | install: install-exec install-data |
|---|
| 145 | install-exec: all |
|---|
| 146 | if test "$(PACKAGE)" = "gettext" \ |
|---|
| 147 | && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ |
|---|
| 148 | $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ |
|---|
| 149 | $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ |
|---|
| 150 | $(LIBTOOL) --mode=install \ |
|---|
| 151 | $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ |
|---|
| 152 | else \ |
|---|
| 153 | : ; \ |
|---|
| 154 | fi |
|---|
| 155 | if test '@USE_INCLUDED_LIBINTL@' = yes; then \ |
|---|
| 156 | $(mkinstalldirs) $(DESTDIR)$(libdir); \ |
|---|
| 157 | temp=$(DESTDIR)$(libdir)/t-charset.alias; \ |
|---|
| 158 | dest=$(DESTDIR)$(libdir)/charset.alias; \ |
|---|
| 159 | if test -f $(DESTDIR)$(libdir)/charset.alias; then \ |
|---|
| 160 | orig=$(DESTDIR)$(libdir)/charset.alias; \ |
|---|
| 161 | sed -f ref-add.sed $$orig > $$temp; \ |
|---|
| 162 | $(INSTALL_DATA) $$temp $$dest; \ |
|---|
| 163 | rm -f $$temp; \ |
|---|
| 164 | else \ |
|---|
| 165 | if test @GLIBC21@ = no; then \ |
|---|
| 166 | orig=charset.alias; \ |
|---|
| 167 | sed -f ref-add.sed $$orig > $$temp; \ |
|---|
| 168 | $(INSTALL_DATA) $$temp $$dest; \ |
|---|
| 169 | rm -f $$temp; \ |
|---|
| 170 | fi; \ |
|---|
| 171 | fi; \ |
|---|
| 172 | $(mkinstalldirs) $(DESTDIR)$(localedir); \ |
|---|
| 173 | test -f $(DESTDIR)$(localedir)/locale.alias \ |
|---|
| 174 | && orig=$(DESTDIR)$(localedir)/locale.alias \ |
|---|
| 175 | || orig=$(srcdir)/locale.alias; \ |
|---|
| 176 | temp=$(DESTDIR)$(localedir)/t-locale.alias; \ |
|---|
| 177 | dest=$(DESTDIR)$(localedir)/locale.alias; \ |
|---|
| 178 | sed -f ref-add.sed $$orig > $$temp; \ |
|---|
| 179 | $(INSTALL_DATA) $$temp $$dest; \ |
|---|
| 180 | rm -f $$temp; \ |
|---|
| 181 | else \ |
|---|
| 182 | : ; \ |
|---|
| 183 | fi |
|---|
| 184 | install-data: all |
|---|
| 185 | if test "$(PACKAGE)" = "gettext"; then \ |
|---|
| 186 | $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ |
|---|
| 187 | $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ |
|---|
| 188 | $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ |
|---|
| 189 | dists="COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common)"; \ |
|---|
| 190 | for file in $$dists; do \ |
|---|
| 191 | $(INSTALL_DATA) $(srcdir)/$$file \ |
|---|
| 192 | $(DESTDIR)$(gettextsrcdir)/$$file; \ |
|---|
| 193 | done; \ |
|---|
| 194 | chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \ |
|---|
| 195 | dists="$(DISTFILES.generated)"; \ |
|---|
| 196 | for file in $$dists; do \ |
|---|
| 197 | if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ |
|---|
| 198 | $(INSTALL_DATA) $$dir/$$file \ |
|---|
| 199 | $(DESTDIR)$(gettextsrcdir)/$$file; \ |
|---|
| 200 | done; \ |
|---|
| 201 | dists="$(DISTFILES.obsolete)"; \ |
|---|
| 202 | for file in $$dists; do \ |
|---|
| 203 | rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ |
|---|
| 204 | done; \ |
|---|
| 205 | else \ |
|---|
| 206 | : ; \ |
|---|
| 207 | fi |
|---|
| 208 | |
|---|
| 209 | # Define this as empty until I found a useful application. |
|---|
| 210 | installcheck: |
|---|
| 211 | |
|---|
| 212 | uninstall: |
|---|
| 213 | if test "$(PACKAGE)" = "gettext" \ |
|---|
| 214 | && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ |
|---|
| 215 | rm -f $(DESTDIR)$(includedir)/libintl.h; \ |
|---|
| 216 | $(LIBTOOL) --mode=uninstall \ |
|---|
| 217 | rm -f $(DESTDIR)$(libdir)/libintl.$la; \ |
|---|
| 218 | else \ |
|---|
| 219 | : ; \ |
|---|
| 220 | fi |
|---|
| 221 | if test '@USE_INCLUDED_LIBINTL@' = yes; then \ |
|---|
| 222 | if test -f $(DESTDIR)$(libdir)/charset.alias; then \ |
|---|
| 223 | temp=$(DESTDIR)$(libdir)/t-charset.alias; \ |
|---|
| 224 | dest=$(DESTDIR)$(libdir)/charset.alias; \ |
|---|
| 225 | sed -f ref-del.sed $$dest > $$temp; \ |
|---|
| 226 | if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ |
|---|
| 227 | rm -f $$dest; \ |
|---|
| 228 | else \ |
|---|
| 229 | $(INSTALL_DATA) $$temp $$dest; \ |
|---|
| 230 | fi; \ |
|---|
| 231 | rm -f $$temp; \ |
|---|
| 232 | fi; \ |
|---|
| 233 | if test -f $(DESTDIR)$(localedir)/locale.alias; then \ |
|---|
| 234 | temp=$(DESTDIR)$(localedir)/t-locale.alias; \ |
|---|
| 235 | dest=$(DESTDIR)$(localedir)/locale.alias; \ |
|---|
| 236 | sed -f ref-del.sed $$dest > $$temp; \ |
|---|
| 237 | if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ |
|---|
| 238 | rm -f $$dest; \ |
|---|
| 239 | else \ |
|---|
| 240 | $(INSTALL_DATA) $$temp $$dest; \ |
|---|
| 241 | fi; \ |
|---|
| 242 | rm -f $$temp; \ |
|---|
| 243 | fi; \ |
|---|
| 244 | else \ |
|---|
| 245 | : ; \ |
|---|
| 246 | fi |
|---|
| 247 | if test "$(PACKAGE)" = "gettext"; then \ |
|---|
| 248 | for file in VERSION ChangeLog COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ |
|---|
| 249 | rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ |
|---|
| 250 | done; \ |
|---|
| 251 | else \ |
|---|
| 252 | : ; \ |
|---|
| 253 | fi |
|---|
| 254 | |
|---|
| 255 | info dvi: |
|---|
| 256 | |
|---|
| 257 | $(OBJECTS): ../config.h libgnuintl.h |
|---|
| 258 | bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h |
|---|
| 259 | dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h |
|---|
| 260 | |
|---|
| 261 | tags: TAGS |
|---|
| 262 | |
|---|
| 263 | TAGS: $(HEADERS) $(SOURCES) |
|---|
| 264 | here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) |
|---|
| 265 | |
|---|
| 266 | id: ID |
|---|
| 267 | |
|---|
| 268 | ID: $(HEADERS) $(SOURCES) |
|---|
| 269 | here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) |
|---|
| 270 | |
|---|
| 271 | |
|---|
| 272 | mostlyclean: |
|---|
| 273 | rm -f *.a *.la *.o *.lo core core.* |
|---|
| 274 | rm -f libintl.h charset.alias ref-add.sed ref-del.sed |
|---|
| 275 | rm -f -r .libs _libs |
|---|
| 276 | |
|---|
| 277 | clean: mostlyclean |
|---|
| 278 | |
|---|
| 279 | distclean: clean |
|---|
| 280 | rm -f Makefile ID TAGS |
|---|
| 281 | if test "$(PACKAGE)" = gettext; then \ |
|---|
| 282 | rm -f ChangeLog.inst $(DISTFILES.normal); \ |
|---|
| 283 | else \ |
|---|
| 284 | : ; \ |
|---|
| 285 | fi |
|---|
| 286 | |
|---|
| 287 | maintainer-clean: distclean |
|---|
| 288 | @echo "This command is intended for maintainers to use;" |
|---|
| 289 | @echo "it deletes files that may require special tools to rebuild." |
|---|
| 290 | |
|---|
| 291 | |
|---|
| 292 | # GNU gettext needs not contain the file `VERSION' but contains some |
|---|
| 293 | # other files which should not be distributed in other packages. |
|---|
| 294 | distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) |
|---|
| 295 | dist distdir: Makefile |
|---|
| 296 | if test "$(PACKAGE)" = gettext; then \ |
|---|
| 297 | additional="$(DISTFILES.gettext)"; \ |
|---|
| 298 | else \ |
|---|
| 299 | additional="$(DISTFILES.normal)"; \ |
|---|
| 300 | fi; \ |
|---|
| 301 | $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ |
|---|
| 302 | for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ |
|---|
| 303 | if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ |
|---|
| 304 | ln $$dir/$$file $(distdir) 2> /dev/null \ |
|---|
| 305 | || cp -p $$dir/$$file $(distdir); \ |
|---|
| 306 | done |
|---|
| 307 | |
|---|
| 308 | Makefile: Makefile.in ../config.status |
|---|
| 309 | cd .. \ |
|---|
| 310 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status |
|---|
| 311 | |
|---|
| 312 | # Tell versions [3.59,3.63) of GNU make not to export all variables. |
|---|
| 313 | # Otherwise a system limit (for SysV at least) may be exceeded. |
|---|
| 314 | .NOEXPORT: |
|---|