summaryrefslogtreecommitdiffstats
path: root/gettext-tools/examples/hello-sh/po/Makefile.am
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-sh/po/Makefile.am
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-sh/po/Makefile.am')
-rw-r--r--gettext-tools/examples/hello-sh/po/Makefile.am25
1 files changed, 20 insertions, 5 deletions
diff --git a/gettext-tools/examples/hello-sh/po/Makefile.am b/gettext-tools/examples/hello-sh/po/Makefile.am
index 5841d97..b6e44af 100644
--- a/gettext-tools/examples/hello-sh/po/Makefile.am
+++ b/gettext-tools/examples/hello-sh/po/Makefile.am
@@ -90,6 +90,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 $(GMOFILES) 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,
@@ -99,10 +105,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 "$(GMOFILES)" || $(MAKE) $(GMOFILES)
- @echo "touch stamp-po"
- @echo timestamp > stamp-poT
- @mv stamp-poT stamp-po
+ test ! -f $(srcdir)/$(DOMAIN).pot || \
+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+ @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
@@ -257,12 +266,18 @@ DISTCLEANFILES = *.mo
MAINTAINERCLEANFILES = stamp-po $(GMOFILES)
-EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES)
+EXTRA_DIST = remove-potcdate.sin LINGUAS $(POFILES) $(GMOFILES)
# 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