2000-06-06 09:53:49 +04:00
|
|
|
# Makefile for program source directory in GNU NLS utilities package.
|
2001-04-18 21:15:17 +04:00
|
|
|
# Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
2000-06-06 09:53:49 +04:00
|
|
|
#
|
|
|
|
# This file file be copied and used freely without restrictions. It can
|
2001-07-15 20:07:23 +04:00
|
|
|
# be used in projects which are not available under the GNU General Public License
|
2000-06-06 09:53:49 +04:00
|
|
|
# but which still want to provide support for the GNU gettext functionality.
|
|
|
|
# Please note that the actual code is *not* freely available.
|
|
|
|
|
|
|
|
PACKAGE = @PACKAGE@
|
|
|
|
VERSION = @VERSION@
|
|
|
|
|
2001-07-15 20:07:23 +04:00
|
|
|
# These two variables depend on the location of this directory.
|
|
|
|
subdir = po
|
|
|
|
top_builddir = ..
|
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
SHELL = /bin/sh
|
|
|
|
@SET_MAKE@
|
|
|
|
|
|
|
|
srcdir = @srcdir@
|
|
|
|
top_srcdir = @top_srcdir@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
|
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
2001-07-15 20:07:23 +04:00
|
|
|
datadir = @datadir@
|
2000-06-06 09:53:49 +04:00
|
|
|
localedir = $(datadir)/locale
|
2001-07-15 20:07:23 +04:00
|
|
|
gettextsrcdir = $(datadir)/gettext/po
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
INSTALL = @INSTALL@
|
|
|
|
INSTALL_DATA = @INSTALL_DATA@
|
2001-04-18 21:15:17 +04:00
|
|
|
MKINSTALLDIRS = @MKINSTALLDIRS@
|
|
|
|
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
CC = @CC@
|
2001-04-18 21:15:17 +04:00
|
|
|
GMSGFMT = @GMSGFMT@
|
2000-06-06 09:53:49 +04:00
|
|
|
MSGFMT = @MSGFMT@
|
2001-04-18 21:15:17 +04:00
|
|
|
XGETTEXT = @XGETTEXT@
|
|
|
|
MSGMERGE = msgmerge
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
DEFS = @DEFS@
|
|
|
|
CFLAGS = @CFLAGS@
|
|
|
|
CPPFLAGS = @CPPFLAGS@
|
|
|
|
|
|
|
|
INCLUDES = -I.. -I$(top_srcdir)/intl
|
|
|
|
|
|
|
|
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
|
|
|
|
|
|
|
POFILES = @POFILES@
|
|
|
|
GMOFILES = @GMOFILES@
|
|
|
|
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
|
2001-04-18 21:15:17 +04:00
|
|
|
$(POFILES) $(GMOFILES)
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
POTFILES = \
|
|
|
|
|
|
|
|
CATALOGS = @CATALOGS@
|
|
|
|
|
|
|
|
.SUFFIXES:
|
2001-04-18 21:15:17 +04:00
|
|
|
.SUFFIXES: .c .o .po .pox .gmo .mo
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(COMPILE) $<
|
|
|
|
|
|
|
|
.po.pox:
|
|
|
|
$(MAKE) $(PACKAGE).pot
|
|
|
|
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
|
|
|
|
|
|
|
|
.po.mo:
|
|
|
|
$(MSGFMT) -o $@ $<
|
|
|
|
|
|
|
|
.po.gmo:
|
|
|
|
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
|
2001-04-18 21:15:17 +04:00
|
|
|
&& rm -f $$file && $(GMSGFMT) --statistics -o $$file $<
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
|
|
|
|
all: all-@USE_NLS@
|
|
|
|
|
2001-04-18 21:15:17 +04:00
|
|
|
all-yes: $(CATALOGS)
|
2000-06-06 09:53:49 +04:00
|
|
|
all-no:
|
|
|
|
|
2001-04-18 21:15:17 +04:00
|
|
|
# Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
|
|
|
|
# otherwise packages like GCC can not be built if only parts of the source
|
|
|
|
# have been downloaded.
|
|
|
|
|
|
|
|
$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
|
2000-06-06 09:53:49 +04:00
|
|
|
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
|
|
|
--add-comments --keyword=_ --keyword=N_ \
|
|
|
|
--files-from=$(srcdir)/POTFILES.in \
|
|
|
|
&& test ! -f $(PACKAGE).po \
|
|
|
|
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
|
|
|
|
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
|
|
|
|
|
|
|
|
|
|
|
|
install: install-exec install-data
|
|
|
|
install-exec:
|
|
|
|
install-data: install-data-@USE_NLS@
|
2001-04-18 21:15:17 +04:00
|
|
|
if test "$(PACKAGE)" = "gettext"; then \
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
|
|
|
|
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
|
|
|
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
2000-06-06 09:53:49 +04:00
|
|
|
else \
|
2001-04-18 21:15:17 +04:00
|
|
|
: ; \
|
2000-06-06 09:53:49 +04:00
|
|
|
fi
|
2001-04-18 21:15:17 +04:00
|
|
|
install-data-no: all
|
|
|
|
install-data-yes: all
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(datadir)
|
2000-06-06 09:53:49 +04:00
|
|
|
@catalogs='$(CATALOGS)'; \
|
|
|
|
for cat in $$catalogs; do \
|
|
|
|
cat=`basename $$cat`; \
|
2001-04-18 21:15:17 +04:00
|
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
|
|
|
dir=$(localedir)/$$lang/LC_MESSAGES; \
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$$dir; \
|
2000-06-06 09:53:49 +04:00
|
|
|
if test -r $$cat; then \
|
2001-04-18 21:15:17 +04:00
|
|
|
$(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
|
|
|
|
echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
|
2000-06-06 09:53:49 +04:00
|
|
|
else \
|
2001-04-18 21:15:17 +04:00
|
|
|
$(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
|
2000-06-06 09:53:49 +04:00
|
|
|
echo "installing $(srcdir)/$$cat as" \
|
2001-04-18 21:15:17 +04:00
|
|
|
"$(DESTDIR)$$dir/$(PACKAGE).mo"; \
|
2000-06-06 09:53:49 +04:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
|
|
|
|
# Define this as empty until I found a useful application.
|
|
|
|
installcheck:
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
catalogs='$(CATALOGS)'; \
|
|
|
|
for cat in $$catalogs; do \
|
|
|
|
cat=`basename $$cat`; \
|
2001-04-18 21:15:17 +04:00
|
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
|
|
|
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
|
2000-06-06 09:53:49 +04:00
|
|
|
done
|
2001-04-18 21:15:17 +04:00
|
|
|
if test "$(PACKAGE)" = "gettext"; then \
|
|
|
|
rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
|
|
|
else \
|
|
|
|
: ; \
|
|
|
|
fi
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
check: all
|
|
|
|
|
|
|
|
dvi info tags TAGS ID:
|
|
|
|
|
|
|
|
mostlyclean:
|
2001-04-18 21:15:17 +04:00
|
|
|
rm -f core core.* *.pox $(PACKAGE).po *.new.po
|
2000-06-06 09:53:49 +04:00
|
|
|
rm -fr *.o
|
|
|
|
|
|
|
|
clean: mostlyclean
|
|
|
|
|
|
|
|
distclean: clean
|
2001-04-18 21:15:17 +04:00
|
|
|
rm -f Makefile Makefile.in POTFILES *.mo
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
maintainer-clean: distclean
|
|
|
|
@echo "This command is intended for maintainers to use;"
|
|
|
|
@echo "it deletes files that may require special tools to rebuild."
|
|
|
|
rm -f $(GMOFILES)
|
|
|
|
|
2001-07-15 20:07:23 +04:00
|
|
|
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
2001-04-18 21:15:17 +04:00
|
|
|
dist distdir:
|
|
|
|
$(MAKE) update-po
|
|
|
|
@$(MAKE) dist2
|
|
|
|
# This is a separate target because 'update-po' must be executed before.
|
|
|
|
dist2: $(DISTFILES)
|
2000-06-06 09:53:49 +04:00
|
|
|
dists="$(DISTFILES)"; \
|
|
|
|
for file in $$dists; do \
|
2001-07-15 20:07:23 +04:00
|
|
|
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
|
|
|
|
cp -p $$dir/$$file $(distdir); \
|
2000-06-06 09:53:49 +04:00
|
|
|
done
|
|
|
|
|
|
|
|
update-po: Makefile
|
|
|
|
$(MAKE) $(PACKAGE).pot
|
2001-04-18 21:15:17 +04:00
|
|
|
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
|
2000-06-06 09:53:49 +04:00
|
|
|
cd $(srcdir); \
|
2001-04-18 21:15:17 +04:00
|
|
|
catalogs='$(GMOFILES)'; \
|
2000-06-06 09:53:49 +04:00
|
|
|
for cat in $$catalogs; do \
|
|
|
|
cat=`basename $$cat`; \
|
2001-04-18 21:15:17 +04:00
|
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
2000-06-06 09:53:49 +04:00
|
|
|
echo "$$lang:"; \
|
2001-04-18 21:15:17 +04:00
|
|
|
if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
|
|
|
|
mv -f $$lang.new.po $$lang.po; \
|
2000-06-06 09:53:49 +04:00
|
|
|
else \
|
|
|
|
echo "msgmerge for $$cat failed!"; \
|
2001-04-18 21:15:17 +04:00
|
|
|
rm -f $$lang.new.po; \
|
2000-06-06 09:53:49 +04:00
|
|
|
fi; \
|
|
|
|
done
|
2001-04-18 21:15:17 +04:00
|
|
|
$(MAKE) update-gmo
|
|
|
|
|
|
|
|
update-gmo: Makefile $(GMOFILES)
|
|
|
|
@:
|
2000-06-06 09:53:49 +04:00
|
|
|
|
2001-07-15 20:07:23 +04:00
|
|
|
Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
|
|
|
|
cd $(top_builddir) \
|
2000-06-06 09:53:49 +04:00
|
|
|
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
|
|
|
|
$(SHELL) ./config.status
|
|
|
|
|
|
|
|
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
|
|
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
|
|
.NOEXPORT:
|