Remove separate POTFILES list and build potfile from real sources lists
authorDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 15 Jun 2012 09:29:46 +0000 (10:29 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 15 Jun 2012 09:39:09 +0000 (10:39 +0100)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Makefile.am
po/Makefile.am
po/POTFILES.in [deleted file]

index 9b7f938..7e7c5de 100644 (file)
@@ -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
@@ -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)
index b12f9c9..4dc49fc 100644 (file)
@@ -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
diff --git a/po/POTFILES.in b/po/POTFILES.in
deleted file mode 100644 (file)
index da7d11e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# List of source files containing translatable strings.
-# Please keep this list in alphabetic order.
-auth.c
-compat.c
-cstp.c
-dtls.c
-http.c
-library.c
-main.c
-mainloop.c
-ssl.c
-openssl.c
-gnutls.c
-gnutls_pkcs12.c
-gnutls_tpm.c
-tun.c
-xml.c