summaryrefslogtreecommitdiffstats
path: root/gettext-tools/examples/hello-csharp-forms
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2005-03-07 19:54:46 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:12:21 +0200
commit7c52a0d9333c47f3b422f20104f687e6bfa25de3 (patch)
treed0f8aca52801b7b60f3b04aa5b8f6dd254d8d063 /gettext-tools/examples/hello-csharp-forms
parentdfec052a8a6d92d3491f90d1fb24c803bdaeea31 (diff)
downloadexternal_gettext-7c52a0d9333c47f3b422f20104f687e6bfa25de3.zip
external_gettext-7c52a0d9333c47f3b422f20104f687e6bfa25de3.tar.gz
external_gettext-7c52a0d9333c47f3b422f20104f687e6bfa25de3.tar.bz2
If $(DOMAIN).pot does not exist, make stamp-po a nop and don't distribute
$(DOMAIN).pot and stamp-po.
Diffstat (limited to 'gettext-tools/examples/hello-csharp-forms')
-rw-r--r--gettext-tools/examples/hello-csharp-forms/po/Makefile.am25
1 files changed, 20 insertions, 5 deletions
diff --git a/gettext-tools/examples/hello-csharp-forms/po/Makefile.am b/gettext-tools/examples/hello-csharp-forms/po/Makefile.am
index d2fe4a3..51d2b84 100644
--- a/gettext-tools/examples/hello-csharp-forms/po/Makefile.am
+++ b/gettext-tools/examples/hello-csharp-forms/po/Makefile.am
@@ -76,6 +76,12 @@ all-local: all-local-@USE_NLS@
all-local-yes: stamp-po
all-local-no:
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(RESOURCESDLLFILES) are
+# empty. In this case, stamp-po is a nop (i.e. a phony target).
+
# stamp-po is a timestamp denoting the last time at which the CATALOGS have
# been loosely updated. Its purpose is that when a developer or translator
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
@@ -85,10 +91,13 @@ all-local-no:
# $(POFILES) has been designed to not touch files that don't need to be
# changed.
stamp-po: $(srcdir)/$(DOMAIN).pot
- test -z "$(RESOURCESDLLFILES)" || $(MAKE) $(RESOURCESDLLFILES)
- @echo "touch stamp-po"
- @echo timestamp > stamp-poT
- @mv stamp-poT stamp-po
+ test ! -f $(srcdir)/$(DOMAIN).pot || \
+ test -z "$(RESOURCESDLLFILES)" || $(MAKE) $(RESOURCESDLLFILES)
+ @test ! -f $(srcdir)/$(DOMAIN).pot || { \
+ echo "touch stamp-po" && \
+ echo timestamp > stamp-poT && \
+ mv stamp-poT stamp-po; \
+ }
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
# otherwise packages like GCC can not be built if only parts of the source
@@ -179,12 +188,18 @@ MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.p
MAINTAINERCLEANFILES = stamp-po $(RESOURCESDLLFILES)
-EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(RESOURCESDLLFILES)
+EXTRA_DIST = remove-potcdate.sin LINGUAS $(POFILES) $(RESOURCESDLLFILES)
# Hidden from automake, but really activated. Works around an automake-1.5 bug.
#distdir: distdir1
distdir1:
$(MAKE) update-po
+ if test -f $(srcdir)/$(DOMAIN).pot; then
+ for file in $(DOMAIN).pot stamp-po; do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ cp -p $$d/$$file $(distdir)/$$file || exit 1; \
+ done; \
+ fi
update-po: Makefile
$(MAKE) $(DOMAIN).pot-update