1999-09-27 18:44:28 +00:00
|
|
|
# Makefile for program source directory in GNU NLS utilities package.
|
2001-07-04 10:29:40 +00:00
|
|
|
# Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
1999-09-27 18:44:28 +00:00
|
|
|
#
|
2000-01-08 21:02:58 +00:00
|
|
|
# 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.
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
PACKAGE = @PACKAGE@
|
|
|
|
VERSION = @VERSION@
|
|
|
|
|
2001-07-04 10:29:40 +00:00
|
|
|
# These two variables depend on the location of this directory.
|
|
|
|
subdir = po
|
|
|
|
top_builddir = ..
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
SHELL = /bin/sh
|
|
|
|
@SET_MAKE@
|
|
|
|
|
|
|
|
srcdir = @srcdir@
|
|
|
|
top_srcdir = @top_srcdir@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
|
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
2001-07-04 10:29:40 +00:00
|
|
|
datadir = @datadir@
|
1999-09-27 18:44:28 +00:00
|
|
|
localedir = $(datadir)/locale
|
2001-07-04 10:29:40 +00:00
|
|
|
gettextsrcdir = $(datadir)/gettext/po
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
INSTALL = @INSTALL@
|
|
|
|
INSTALL_DATA = @INSTALL_DATA@
|
2001-07-04 10:29:40 +00:00
|
|
|
MKINSTALLDIRS = @MKINSTALLDIRS@
|
|
|
|
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
CC = @CC@
|
2001-07-04 10:29:40 +00:00
|
|
|
GMSGFMT = @GMSGFMT@
|
1999-09-27 18:44:28 +00:00
|
|
|
MSGFMT = @MSGFMT@
|
2001-07-04 10:29:40 +00:00
|
|
|
XGETTEXT = @XGETTEXT@
|
|
|
|
MSGMERGE = msgmerge
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
DEFS = @DEFS@
|
|
|
|
CFLAGS = @CFLAGS@
|
|
|
|
CPPFLAGS = @CPPFLAGS@
|
|
|
|
|
2000-01-08 21:02:58 +00:00
|
|
|
INCLUDES = -I.. -I$(top_srcdir)/intl
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
|
|
|
|
|
|
|
POFILES = @POFILES@
|
|
|
|
GMOFILES = @GMOFILES@
|
|
|
|
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
|
2001-07-04 10:29:40 +00:00
|
|
|
$(POFILES) $(GMOFILES)
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-01-13 06:05:25 +00:00
|
|
|
POTFILE_IN_DEPS = $(shell find $(top_srcdir)/src -name Makefile.am)
|
2000-10-05 07:57:00 +00:00
|
|
|
|
2000-10-06 06:13:46 +00:00
|
|
|
POTFILES = \
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
CATALOGS = @CATALOGS@
|
|
|
|
|
|
|
|
.SUFFIXES:
|
2001-07-04 10:29:40 +00:00
|
|
|
.SUFFIXES: .c .o .po .pox .gmo .mo
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(COMPILE) $<
|
|
|
|
|
|
|
|
.po.pox:
|
2002-04-04 06:30:34 +00:00
|
|
|
$(MAKE) $(srcdir)/$(PACKAGE).pot
|
1999-09-27 18:44:28 +00:00
|
|
|
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
|
|
|
|
|
|
|
|
.po.mo:
|
|
|
|
$(MSGFMT) -o $@ $<
|
|
|
|
|
|
|
|
.po.gmo:
|
|
|
|
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
|
2001-07-04 10:29:40 +00:00
|
|
|
&& case "$(GMSGFMT)" in \
|
|
|
|
*/msgfmt) rm -f $$file && $(GMSGFMT) --statistics -o $$file $<;; \
|
1999-09-27 18:44:28 +00:00
|
|
|
*) touch $$file ;; \
|
2001-07-04 10:29:40 +00:00
|
|
|
esac
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
all: all-@USE_NLS@
|
|
|
|
|
2001-07-04 10:29:40 +00:00
|
|
|
all-yes: $(CATALOGS)
|
1999-09-27 18:44:28 +00:00
|
|
|
all-no:
|
|
|
|
|
2001-07-04 10:29:40 +00: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.
|
|
|
|
|
2002-12-09 00:45:06 +00:00
|
|
|
$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in $(top_srcdir)/src/ext_l10n.h l10n_pots
|
|
|
|
$(XGETTEXT) --join-existing --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
2002-04-16 21:59:48 +00:00
|
|
|
--escape --add-comments --keyword=_ --keyword=N_ \
|
2000-01-08 21:02:58 +00:00
|
|
|
--files-from=$(srcdir)/POTFILES.in \
|
|
|
|
&& test ! -f $(PACKAGE).po \
|
|
|
|
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
|
|
|
|
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
install: install-exec install-data
|
|
|
|
install-exec:
|
|
|
|
install-data: install-data-@USE_NLS@
|
2001-07-04 10:29:40 +00:00
|
|
|
if test "$(PACKAGE)" = "gettext"; then \
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
|
|
|
|
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
|
|
|
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
1999-09-27 18:44:28 +00:00
|
|
|
else \
|
2001-07-04 10:29:40 +00:00
|
|
|
: ; \
|
1999-09-27 18:44:28 +00:00
|
|
|
fi
|
2001-07-04 10:29:40 +00:00
|
|
|
install-data-no: all
|
|
|
|
install-data-yes: all
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(datadir)
|
1999-09-27 18:44:28 +00:00
|
|
|
@catalogs='$(CATALOGS)'; \
|
|
|
|
for cat in $$catalogs; do \
|
|
|
|
cat=`basename $$cat`; \
|
2001-07-04 10:29:40 +00:00
|
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
|
|
|
dir=$(localedir)/$$lang/LC_MESSAGES; \
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$$dir; \
|
1999-09-27 18:44:28 +00:00
|
|
|
if test -r $$cat; then \
|
2001-07-04 10:29:40 +00:00
|
|
|
$(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
|
|
|
|
echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
|
1999-09-27 18:44:28 +00:00
|
|
|
else \
|
2001-07-04 10:29:40 +00:00
|
|
|
$(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
|
1999-09-27 18:44:28 +00:00
|
|
|
echo "installing $(srcdir)/$$cat as" \
|
2001-07-04 10:29:40 +00:00
|
|
|
"$(DESTDIR)$$dir/$(PACKAGE).mo"; \
|
1999-09-27 18:44:28 +00: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-07-04 10:29:40 +00:00
|
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
|
|
|
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
|
1999-09-27 18:44:28 +00:00
|
|
|
done
|
2001-07-04 10:29:40 +00:00
|
|
|
if test "$(PACKAGE)" = "gettext"; then \
|
|
|
|
rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
|
|
|
else \
|
|
|
|
: ; \
|
|
|
|
fi
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
check: all
|
|
|
|
|
|
|
|
dvi info tags TAGS ID:
|
|
|
|
|
|
|
|
mostlyclean:
|
2001-07-04 10:29:40 +00:00
|
|
|
rm -f core core.* *.pox $(PACKAGE).po *.new.po
|
1999-09-27 18:44:28 +00:00
|
|
|
rm -fr *.o
|
|
|
|
|
|
|
|
clean: mostlyclean
|
|
|
|
|
|
|
|
distclean: clean
|
2001-07-04 10:29:40 +00:00
|
|
|
rm -f Makefile Makefile.in POTFILES *.mo
|
1999-09-27 18:44:28 +00: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-04 10:29:40 +00:00
|
|
|
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)
|
1999-09-27 18:44:28 +00:00
|
|
|
dists="$(DISTFILES)"; \
|
|
|
|
for file in $$dists; do \
|
2001-07-04 10:29:40 +00:00
|
|
|
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
|
|
|
|
cp -p $$dir/$$file $(distdir); \
|
1999-09-27 18:44:28 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
update-po: Makefile
|
|
|
|
$(MAKE) $(PACKAGE).pot
|
2001-07-04 10:29:40 +00:00
|
|
|
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
|
1999-09-27 18:44:28 +00:00
|
|
|
cd $(srcdir); \
|
2001-07-04 10:29:40 +00:00
|
|
|
catalogs='$(GMOFILES)'; \
|
1999-09-27 18:44:28 +00:00
|
|
|
for cat in $$catalogs; do \
|
|
|
|
cat=`basename $$cat`; \
|
2001-07-04 10:29:40 +00:00
|
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
1999-09-27 18:44:28 +00:00
|
|
|
echo "$$lang:"; \
|
2001-07-04 10:29:40 +00:00
|
|
|
if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
|
|
|
|
mv -f $$lang.new.po $$lang.po; \
|
1999-09-27 18:44:28 +00:00
|
|
|
else \
|
|
|
|
echo "msgmerge for $$cat failed!"; \
|
2001-07-04 10:29:40 +00:00
|
|
|
rm -f $$lang.new.po; \
|
1999-09-27 18:44:28 +00:00
|
|
|
fi; \
|
|
|
|
done
|
2001-07-04 10:29:40 +00:00
|
|
|
$(MAKE) update-gmo
|
|
|
|
|
|
|
|
update-gmo: Makefile $(GMOFILES)
|
|
|
|
@:
|
|
|
|
|
|
|
|
Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
|
|
|
|
cd $(top_builddir) \
|
|
|
|
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
|
|
|
|
$(SHELL) ./config.status
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-01-14 04:43:42 +00:00
|
|
|
${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS)
|
2000-10-06 06:13:46 +00:00
|
|
|
rm -f $@-t \
|
|
|
|
&& ( cd $(top_srcdir); \
|
2001-07-28 13:03:22 +00:00
|
|
|
grep -l "_(\".*\")" `find src -name \*.[hHC] -print` |\
|
2000-10-06 06:13:46 +00:00
|
|
|
sed -e '/xforms.forms/d' | \
|
2001-09-09 22:02:19 +00:00
|
|
|
sort -f -n | uniq ) > $@-t \
|
2001-01-14 04:43:42 +00:00
|
|
|
&& echo "src/ext_l10n.h" >> $@-t \
|
2000-10-17 12:55:45 +00:00
|
|
|
&& mv $@-t $@
|
2000-10-05 07:57:00 +00:00
|
|
|
|
2002-12-09 00:45:06 +00:00
|
|
|
|
|
|
|
l10n_pots: xforms_l10n.pot qt_l10n.pot layouts_l10n.pot
|
|
|
|
cat xforms_l10n.pot qt_l10n.pot layouts_l10n.pot | \
|
|
|
|
msguniq -o $(PACKAGE).po
|
|
|
|
|
|
|
|
xforms_l10n.pot: $(top_srcdir)/src/frontends/xforms/forms/*.fd
|
|
|
|
awk ' \
|
|
|
|
BEGIN { \
|
|
|
|
print "msgid \"\""; \
|
|
|
|
print "msgstr \"\""; \
|
|
|
|
print "\"Content-Type: text/plain; charset=ISO-8859-1\\n\""; \
|
|
|
|
} \
|
|
|
|
/label: / { \
|
|
|
|
if (NF > 1) { \
|
|
|
|
line=$$0;\
|
|
|
|
sub(/label: /,"",line);\
|
|
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", FILENAME, FNR, line);\
|
|
|
|
}\
|
|
|
|
}' \
|
|
|
|
`find $(top_srcdir)/src/frontends/xforms/forms -name \*.fd` > $@
|
|
|
|
|
|
|
|
qt_l10n.pot: $(top_srcdir)/src/frontends/qt2/ui/*.ui
|
|
|
|
awk ' \
|
|
|
|
/<string>/ { \
|
|
|
|
if (NF > 1) { \
|
|
|
|
line=$$0; \
|
|
|
|
sub(/.*<string>/, "", line); \
|
|
|
|
sub(/<\/string>.*/, "", line); \
|
|
|
|
gsub(/&/, "\\&", line); \
|
|
|
|
gsub(/</, "<", line); \
|
|
|
|
gsub(/>/, ">", line); \
|
|
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n",\
|
|
|
|
FILENAME, FNR, line); \
|
|
|
|
} \
|
|
|
|
}' \
|
|
|
|
`find $(top_srcdir)/src/frontends/qt2/ui -name \*.ui` > $@
|
|
|
|
|
|
|
|
layouts_l10n.pot: $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc
|
|
|
|
awk ' \
|
|
|
|
/^Style / { \
|
|
|
|
line=$$0; \
|
|
|
|
sub(/Style /, "", line); \
|
|
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
|
|
|
|
FILENAME, FNR, line); \
|
|
|
|
} \
|
|
|
|
/GuiName/ { \
|
|
|
|
line=$$0; \
|
|
|
|
sub(/[[:space:]]*GuiName[[:space:]]*/, "", line); \
|
|
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
|
|
|
|
FILENAME, FNR, line); \
|
|
|
|
} \
|
|
|
|
' `find $(top_srcdir)/lib/layouts -regex ".*\.\(layout\|inc\)"` > $@
|
|
|
|
|
|
|
|
$(top_srcdir)/src/ext_l10n.h: $(top_srcdir)/lib/ui/default.ui $(top_srcdir)/lib/languages
|
2001-01-14 04:43:42 +00:00
|
|
|
sed < $(top_srcdir)/lib/ui/default.ui -n \
|
|
|
|
-e 's/.*[sS]ub[mM]enu[^"]*\("[^"]*"\).*/_(\1);/p' \
|
|
|
|
-e 's/.*[iI]tem[^"]*\("[^"]*"\).*/_(\1);/p' \
|
|
|
|
> $@
|
|
|
|
sed < $(top_srcdir)/lib/languages -e '/^#/d' -e 's/[^"]*\("[A-Za-z0-9][^"]*"\).*/_(\1);/' >> $@
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
# 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:
|