2007-10-07 17:14:02 +05:30
|
|
|
# Makefile for program source directory in GNU NLS utilities package.
|
2007-10-07 17:14:51 +05:30
|
|
|
# Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
2007-10-07 17:14:02 +05:30
|
|
|
#
|
|
|
|
# This file file be copied and used freely without restrictions. It can
|
|
|
|
# be used in projects which are not available under the GNU Public License
|
|
|
|
# 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@
|
|
|
|
|
2007-10-07 17:14:51 +05:30
|
|
|
# These two variables depend on the location of this directory.
|
|
|
|
subdir = po
|
|
|
|
top_builddir = ..
|
|
|
|
|
2007-10-07 17:14:02 +05:30
|
|
|
SHELL = /bin/sh
|
|
|
|
@SET_MAKE@
|
|
|
|
|
|
|
|
srcdir = @srcdir@
|
|
|
|
top_srcdir = @top_srcdir@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
|
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
2007-10-07 17:14:51 +05:30
|
|
|
datadir = @datadir@
|
2007-10-07 17:14:02 +05:30
|
|
|
localedir = $(datadir)/locale
|
2007-10-07 17:14:51 +05:30
|
|
|
gettextsrcdir = $(datadir)/gettext/po
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
INSTALL = @INSTALL@
|
|
|
|
INSTALL_DATA = @INSTALL_DATA@
|
2007-10-07 17:14:51 +05:30
|
|
|
MKINSTALLDIRS = @MKINSTALLDIRS@
|
|
|
|
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
CC = @CC@
|
2007-10-07 17:14:51 +05:30
|
|
|
GMSGFMT = @GMSGFMT@
|
2007-10-07 17:14:02 +05:30
|
|
|
MSGFMT = @MSGFMT@
|
2007-10-07 17:14:51 +05:30
|
|
|
XGETTEXT = @XGETTEXT@
|
|
|
|
MSGMERGE = msgmerge
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
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 \
|
2007-10-07 17:14:51 +05:30
|
|
|
$(POFILES) $(GMOFILES)
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
POTFILES = \
|
|
|
|
|
|
|
|
CATALOGS = @CATALOGS@
|
|
|
|
|
|
|
|
.SUFFIXES:
|
2007-10-07 17:14:51 +05:30
|
|
|
.SUFFIXES: .c .o .po .pox .gmo .mo
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
.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 \
|
2007-10-07 17:14:51 +05:30
|
|
|
&& rm -f $$file && $(GMSGFMT) --statistics -o $$file $<
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
|
|
|
|
all: all-@USE_NLS@
|
|
|
|
|
2007-10-07 17:14:51 +05:30
|
|
|
all-yes: $(CATALOGS)
|
2007-10-07 17:14:02 +05:30
|
|
|
all-no:
|
|
|
|
|
2007-10-07 17:14:51 +05:30
|
|
|
# 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
|
2007-10-07 17:14:02 +05:30
|
|
|
$(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@
|
2007-10-07 17:14:51 +05:30
|
|
|
if test "$(PACKAGE)" = "gettext"; then \
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
|
|
|
|
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
|
|
|
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
2007-10-07 17:14:02 +05:30
|
|
|
else \
|
2007-10-07 17:14:51 +05:30
|
|
|
: ; \
|
2007-10-07 17:14:02 +05:30
|
|
|
fi
|
2007-10-07 17:14:51 +05:30
|
|
|
install-data-no: all
|
|
|
|
install-data-yes: all
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(datadir)
|
2007-10-07 17:14:02 +05:30
|
|
|
@catalogs='$(CATALOGS)'; \
|
|
|
|
for cat in $$catalogs; do \
|
|
|
|
cat=`basename $$cat`; \
|
2007-10-07 17:14:51 +05:30
|
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
|
|
|
dir=$(localedir)/$$lang/LC_MESSAGES; \
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$$dir; \
|
2007-10-07 17:14:02 +05:30
|
|
|
if test -r $$cat; then \
|
2007-10-07 17:14:51 +05:30
|
|
|
$(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
|
|
|
|
echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
|
2007-10-07 17:14:02 +05:30
|
|
|
else \
|
2007-10-07 17:14:51 +05:30
|
|
|
$(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
|
2007-10-07 17:14:02 +05:30
|
|
|
echo "installing $(srcdir)/$$cat as" \
|
2007-10-07 17:14:51 +05:30
|
|
|
"$(DESTDIR)$$dir/$(PACKAGE).mo"; \
|
2007-10-07 17:14:02 +05:30
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
|
|
|
|
# Define this as empty until I found a useful application.
|
|
|
|
installcheck:
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
catalogs='$(CATALOGS)'; \
|
|
|
|
for cat in $$catalogs; do \
|
|
|
|
cat=`basename $$cat`; \
|
2007-10-07 17:14:51 +05:30
|
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
|
|
|
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
|
2007-10-07 17:14:02 +05:30
|
|
|
done
|
2007-10-07 17:14:51 +05:30
|
|
|
if test "$(PACKAGE)" = "gettext"; then \
|
|
|
|
rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
|
|
|
else \
|
|
|
|
: ; \
|
|
|
|
fi
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
check: all
|
|
|
|
|
|
|
|
dvi info tags TAGS ID:
|
|
|
|
|
|
|
|
mostlyclean:
|
2007-10-07 17:14:51 +05:30
|
|
|
rm -f core core.* *.pox $(PACKAGE).po *.new.po
|
2007-10-07 17:14:02 +05:30
|
|
|
rm -fr *.o
|
|
|
|
|
|
|
|
clean: mostlyclean
|
|
|
|
|
|
|
|
distclean: clean
|
2007-10-07 17:14:51 +05:30
|
|
|
rm -f Makefile Makefile.in POTFILES *.mo
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
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)
|
|
|
|
|
2007-10-07 17:14:51 +05:30
|
|
|
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
|
|
|
dist distdir:
|
|
|
|
$(MAKE) update-po
|
|
|
|
@$(MAKE) dist2
|
|
|
|
# This is a separate target because 'update-po' must be executed before.
|
|
|
|
dist2: $(DISTFILES)
|
2007-10-07 17:14:02 +05:30
|
|
|
dists="$(DISTFILES)"; \
|
|
|
|
for file in $$dists; do \
|
2007-10-07 17:14:51 +05:30
|
|
|
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
|
|
|
|
cp -p $$dir/$$file $(distdir); \
|
2007-10-07 17:14:02 +05:30
|
|
|
done
|
|
|
|
|
|
|
|
update-po: Makefile
|
|
|
|
$(MAKE) $(PACKAGE).pot
|
2007-10-07 17:14:51 +05:30
|
|
|
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
|
2007-10-07 17:14:02 +05:30
|
|
|
cd $(srcdir); \
|
2007-10-07 17:14:51 +05:30
|
|
|
catalogs='$(GMOFILES)'; \
|
2007-10-07 17:14:02 +05:30
|
|
|
for cat in $$catalogs; do \
|
|
|
|
cat=`basename $$cat`; \
|
2007-10-07 17:14:51 +05:30
|
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
2007-10-07 17:14:02 +05:30
|
|
|
echo "$$lang:"; \
|
2007-10-07 17:14:51 +05:30
|
|
|
if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
|
|
|
|
mv -f $$lang.new.po $$lang.po; \
|
2007-10-07 17:14:02 +05:30
|
|
|
else \
|
|
|
|
echo "msgmerge for $$cat failed!"; \
|
2007-10-07 17:14:51 +05:30
|
|
|
rm -f $$lang.new.po; \
|
2007-10-07 17:14:02 +05:30
|
|
|
fi; \
|
|
|
|
done
|
2007-10-07 17:14:51 +05:30
|
|
|
$(MAKE) update-gmo
|
2007-10-07 17:14:02 +05:30
|
|
|
|
2007-10-07 17:14:51 +05:30
|
|
|
update-gmo: Makefile $(GMOFILES)
|
|
|
|
@:
|
|
|
|
|
|
|
|
Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
|
|
|
|
cd $(top_builddir) \
|
2007-10-07 17:14:02 +05:30
|
|
|
&& 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:
|