Skip to content

Commit

Permalink
Remove separate POTFILES list and build potfile from real sources lists
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 15, 2012
1 parent a29253e commit 01cc808
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 31 deletions.
17 changes: 14 additions & 3 deletions Makefile.am
Expand Up @@ -20,6 +20,9 @@ openconnect_LDADD = libopenconnect.la $(SSL_LIBS) $(DTLS_SSL_LIBS) $(LIBXML2_LIB
library_srcs = ssl.c http.c auth.c library.c compat.c
lib_srcs_gnutls = gnutls.c gnutls_pkcs12.c gnutls_tpm.c
lib_srcs_openssl = openssl.c

POTFILES = $(openconnect_SOURCES) $(lib_srcs_openssl) $(lib_srcs_gnutls) $(library_srcs)

if OPENCONNECT_GNUTLS
library_srcs += $(lib_srcs_gnutls)
endif
Expand Down Expand Up @@ -105,7 +108,15 @@ update-translations:
tx pull -af ; git commit -s -m "Update translations from Transifex" -- po/ ; \
fi

upload-pot:
if [ ${abs_top_builddir} != $(abs_top_srcdir) ]; then \
upload-pot: po/$(PACKAGE).pot
@if [ ${abs_top_builddir} != $(abs_top_srcdir) ]; then \
ln -sf ${abs_top_srcdir}/.tx .tx; fi
@make -C po openconnect.pot && tx push -s
@tx push -s

po/$(PACKAGE).pot: $(POTFILES) Makefile
@echo "Regenerating $@" ; rm -f $@ && \
xgettext --directory=$(top_srcdir) --from-code=UTF-8 \
--add-comments --keyword=_ --keyword=N_ \
--package-name="@PACKAGE@" --package-version="@VERSION@" \
--msgid-bugs-address=openconnect-devel@lists.infradead.org \
-o $@ $(POTFILES)
16 changes: 5 additions & 11 deletions po/Makefile.am
Expand Up @@ -31,17 +31,11 @@ uninstall-hook:
fi ; \
done

# This is a GNUism but I don't care; it's not a default target.
POTFILESIN = $(shell grep -v '^\#' $(srcdir)/POTFILES.in)
POTFILES = $(POTFILESIN:%=$(top_srcdir)/%)

$(PACKAGE).pot: $(POTFILES) Makefile
rm -f $@ && \
xgettext --directory=$(top_srcdir) \
--add-comments --keyword=_ --keyword=N_ \
--files-from=$(srcdir)/POTFILES.in --from-code=UTF-8 \
--package-name="@PACKAGE@" --package-version="@VERSION@" \
--msgid-bugs-address=openconnect-devel@lists.infradead.org -o $@
# $(PACKAGE).pot is built by a rule in the parent directory Makefile
# This rule isn't needed but is here for convenience if manually invoked
.PHONY: $(PACKAGE).pot
$(PACKAGE).pot:
$(MAKE) -C .. po/$@

EXTRA_DIST = $(POFILES) LINGUAS POTFILES.in
DISTCLEANFILES=$(PACKAGE).pot
17 changes: 0 additions & 17 deletions po/POTFILES.in

This file was deleted.

0 comments on commit 01cc808

Please sign in to comment.