Move nls targets to the top level Makefile so the paths in

the pot file are saner
This commit is contained in:
Todd C. Miller
2011-06-04 18:27:13 -04:00
parent e8064e25dd
commit e66169b3ed
10 changed files with 78 additions and 148 deletions

View File

@@ -28,8 +28,6 @@ incdir = $(top_srcdir)/include
# Compiler & tools to use
CC = @CC@
LIBTOOL = @LIBTOOL@ @LT_STATIC@
ECHO_N = @ECHO_N@
ECHO_C = @ECHO_C@
# Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
@@ -82,20 +80,6 @@ LIBOBJDIR = $(top_builddir)/@ac_config_libobj_dir@/
VERSION = @PACKAGE_VERSION@
# Message catalog support
LINGUAS = @LINGUAS@
POTFILE = $(srcdir)/po/sudo.pot
MSGFMT = msgfmt
MSGMERGE = msgmerge
XGETTEXT = xgettext
XGETTEXT_OPTS = -k_ -kN_ -dsudo --copyright-holder="Todd C. Miller" \
"--msgid-bugs-address=http://www.sudo.ws/bugs" \
--package-name=@PACKAGE_NAME@ --package-version=$(VERSION) \
--flag warning:1:c-format --flag warningx:1:c-format \
--flag error:2:c-format --flag errorx:2:c-format \
--flag easprintf:3:c-format --flag lbuf_append:2:c-format \
--flag lbuf_append_quoted:3:c-format --foreign-user
all: $(PROGS)
Makefile: $(srcdir)/Makefile.in
@@ -118,30 +102,9 @@ libsudo_noexec.la: sudo_noexec.lo
sesh: sesh.o
$(CC) -o $@ sesh.o
update-po:
@echo "Updating $(POTFILE)"; \
$(XGETTEXT) $(XGETTEXT_OPTS) $(top_srcdir)/src/*c $(top_srcdir)/common/*c $(top_srcdir)/compat/*c -o $(POTFILE)
@set -- $(LINGUAS); \
while test $$# != 0; do \
echo $(ECHO_N) "Updating \"$$1\" message catalog$(ECHO_C)"; \
$(MSGMERGE) --update $(srcdir)/po/$$1.po $(POTFILE); \
$(MSGFMT) --output /dev/null --check-format $(srcdir)/po/$$1.po || exit 1; \
shift; \
done
compile-po:
@if test -n "$(LINGUAS)"; then \
set -- $(LINGUAS); \
while test $$# != 0; do \
echo "Compiling \"$$1\" message catalog."; \
$(MSGFMT) --statistics -c -o $(srcdir)/po/$$1.mo $(srcdir)/po/$$1.po; \
shift; \
done; \
fi
pre-install:
install: install-dirs install-binaries @INSTALL_NOEXEC@ install-nls
install: install-dirs install-binaries @INSTALL_NOEXEC@
install-dirs:
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \
@@ -164,20 +127,6 @@ install-noexec: install-dirs libsudo_noexec.la
install-plugin:
install-nls:
@if test -n "$(LINGUAS)"; then \
echo $(ECHO_N) "Installing sudo message catalogs:$(ECHO_C)"; \
fi; \
set -- $(LINGUAS); \
while test $$# != 0; do \
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(localedir)/$$1/LC_MESSAGES; \
$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0644 $(srcdir)/po/$$1.mo $(DESTDIR)$(localedir)/$$1/LC_MESSAGES/sudo.mo; \
shift; \
done; \
if test -n "$(LINGUAS)"; then \
echo ""; \
fi
uninstall:
-rm -f $(DESTDIR)$(bindir)/sudo $(DESTDIR)$(bindir)/sudoedit \
$(DESTDIR)$(libexecdir)/sesh \