build: 'guix-manual.*.po' no longer depends on 'guix-manual.pot'.

That dependency was causing a failure when building from a fresh
checkout since commit d60225d5ca because
'guix-manual.pot' was no longer around and there's no rule to make it.

This commit replaces the 'guix-manual.%.po' target by a phony target,
'doc-po-update-%', without any dependency.

* po/doc/local.mk ($(srcdir)/po/doc/guix-manual.%.po): Rename to...
(doc-po-update-%): ... this.  Remove dependencies.
Change how 'lang' is computed; compute $output and $input, and replace
occurrences of $@ and $< with those.
(doc-po-update): Adjust accordingly.
This commit is contained in:
Ludovic Courtès 2019-04-30 17:32:52 +02:00
parent e4b2866cd0
commit 81824af6a4
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -30,22 +30,24 @@ POT_OPTIONS = --package-name "guix" --package-version "$(VERSION)" \
--copyright-holder "Ludovic Courtès" \ --copyright-holder "Ludovic Courtès" \
--msgid-bugs-address "ludo@gnu.org" --msgid-bugs-address "ludo@gnu.org"
$(srcdir)/po/doc/guix-manual.%.po: $(srcdir)/po/doc/guix-manual.pot doc-po-update-%:
@lang=`echo $$(basename "$@") | sed -e 's|^guix-manual.||' -e 's|.po$$||'` ;\ @lang=`echo "$@" | sed -e's/^doc-po-update-//'` ; \
if test -f "$@"; then \ output="$(srcdir)/po/doc/guix-manual.$$lang.po" ; \
input="$(srcdir)/po/doc/guix-manual.pot" ; \
if test -f "$$output"; then \
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $@ $<"; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $$output $$input"; \
cd $(srcdir) \ cd $(srcdir) \
&& { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $@ $<;; \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) "$$output" "$$input";; \
*) \ *) \
$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $@ $<;; \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} "$$output" "$$input";; \
esac; \ esac; \
}; \ }; \
touch "$@"; \ touch "$$output"; \
else \ else \
echo "File $@ does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ echo "File $$output does not exist. If you are a translator, you can create it with 'msginit'." 1>&2; \
exit 1; \ exit 1; \
fi fi
@ -65,8 +67,9 @@ doc-pot-update:
rm -f $(addprefix $(srcdir)/po/doc/, $(TMP_POT_FILES)) rm -f $(addprefix $(srcdir)/po/doc/, $(TMP_POT_FILES))
doc-po-update: doc-pot-update doc-po-update: doc-pot-update
for f in $(DOC_PO_FILES); do \ for f in $(DOC_PO_FILES); do \
$(MAKE) "$$f"; \ lang="`echo "$$f" | $(SED) -es'|.*/guix-manual\.\(.*\)\.po$$|\1|g'`"; \
$(MAKE) "doc-po-update-$$lang"; \
done done
.PHONY: doc-po-update doc-pot-update .PHONY: doc-po-update doc-pot-update