From 77f3bf6270a37daef984a81b4ca37399d1fda0b1 Mon Sep 17 00:00:00 2001 From: "W. Kosior" Date: Sat, 29 Jun 2024 10:14:53 +0200 Subject: build: Fix doc generation in VPATH builds. * po/doc/local.mk: For every target make sure destination directory beneath $(top_builddir) exists. Don't write files beneath $(top_srcdir). * doc/local.mk: ditto. Change-Id: I18898edbf228fdf944646a72d278c3fc5daeafe4 --- doc/local.mk | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) (limited to 'doc') diff --git a/doc/local.mk b/doc/local.mk index b81172939b..38862bc28e 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -97,7 +97,7 @@ MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) # reference is not translated, which means it references a section that does not # exist. define xref_command -$(top_srcdir)/pre-inst-env $(GUILE) --no-auto-compile \ +$(top_builddir)/pre-inst-env $(GUILE) --no-auto-compile \ "$(top_srcdir)/build-aux/convert-xref.scm" \ $@.tmp $< endef @@ -106,40 +106,43 @@ endef # because the path extension is not 'pot'. dummy_pot = $(shell mktemp --suffix=.pot) -$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi guix/build/po.go +%D%: + $(AM_V_GEN)$(MKDIR_P) "$@" + +%D%/guix.%.texi: po/doc/guix-manual.%.po %D%/contributing.%.texi \ + guix/build/po.go | %D% -$(AM_V_PO4A)$(PO4A) --no-update \ --variable localized="$@.tmp" \ - --variable master="%D%/guix.texi" \ + --variable master="$(srcdir)/%D%/guix.texi" \ --variable po="$<" \ --variable pot=$(dummy_pot) \ - po/doc/po4a.cfg + $(srcdir)/po/doc/po4a.cfg -sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) -mv "$@.tmp" "$@" -$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po guix/build/po.go +%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po guix/build/po.go | %D% -$(AM_V_PO4A)$(PO4A) --no-update \ --variable localized="$@.tmp" \ - --variable master="%D%/guix-cookbook.texi" \ + --variable master="$(srcdir)/%D%/guix-cookbook.texi" \ --variable po="$<" \ --variable pot=$(dummy_pot) \ - po/doc/po4a.cfg + $(srcdir)/po/doc/po4a.cfg -sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) -mv "$@.tmp" "$@" -$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po guix/build/po.go +%D%/contributing.%.texi: po/doc/guix-manual.%.po guix/build/po.go | %D% -$(AM_V_PO4A)$(PO4A) --no-update \ --variable localized="$@.tmp" \ - --variable master="%D%/contributing.texi" \ + --variable master="$(srcdir)/%D%/contributing.texi" \ --variable po="$<" \ --variable pot=$(dummy_pot) \ - po/doc/po4a.cfg + $(srcdir)/po/doc/po4a.cfg -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) -mv "$@.tmp" "$@" -%D%/os-config-%.texi: gnu/system/examples/%.tmpl - $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ +%D%/os-config-%.texi: gnu/system/examples/%.tmpl | %D% cp "$<" "$@" infoimagedir = $(infodir)/images @@ -161,23 +164,27 @@ DOT_OPTIONS = \ -Nfontsize=9 -Nheight=.1 -Nwidth=.1 .dot.png: - $(AM_V_DOT)$(DOT) -Tpng $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp" - $(AM_V_at)mv "$(srcdir)/$@.tmp" "$(srcdir)/$@" + $(AM_V_GEN)$(MKDIR_P) "$$(dirname "$@")" + $(AM_V_DOT)$(DOT) -Tpng $(DOT_OPTIONS) < "$<" > "$@.tmp" + $(AM_V_at)mv "$@.tmp" "$@" .dot.pdf: + $(AM_V_GEN)$(MKDIR_P) "$$(dirname "$@")" $(AM_V_DOT)set -e; export TZ=UTC0; \ - $(DOT) -Tpdf $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp" + $(DOT) -Tpdf $(DOT_OPTIONS) < "$<" > "$@.tmp" $(AM_V_at)sed -ri \ -e 's,(/CreationDate \(D:).*\),\119700101000000),' \ - "$(srcdir)/$@.tmp" - $(AM_V_at)mv "$(srcdir)/$@.tmp" "$(srcdir)/$@" + "$@.tmp" + $(AM_V_at)mv "$@.tmp" "$@" .dot.eps: - $(AM_V_DOT)$(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp" - $(AM_v_at)! grep -q %%CreationDate "$(srcdir)/$@.tmp" - $(AM_V_at)mv "$(srcdir)/$@.tmp" "$@" + $(AM_V_GEN)$(MKDIR_P) "$$(dirname "$@")" + $(AM_V_DOT)$(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$@.tmp" + $(AM_v_at)! grep -q %%CreationDate "$@.tmp" + $(AM_V_at)mv "$@.tmp" "$@" .png.eps: + $(AM_V_GEN)$(MKDIR_P) "$$(dirname "$@")" $(AM_V_GEN)convert "$<" "$@-tmp.eps" $(AM_V_at)mv "$@-tmp.eps" "$@" -- cgit v1.2.3