<p>osmith <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/11803">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Makefile.*.inc: adjust to out-of-tree building<br><br>Makefile.asciidoc.inc: create a symlink for the root adoc file, from<br>which a PDF gets generated, from the srcdir to the builddir. This file<br>may include other adoc files, which do not get symlinked. We need to do<br>this, because a2x (the program generating the PDF file) does not have a<br>parameter for the output file, and will otherwise generate the PDF in<br>the srcdir instead of the builddir. Do the same in the check target, so<br>the relative include paths work the same.<br><br>Makefile.asciidoc.inc, Makefile.docbook.inc: set the include paths for<br>the xstl parser, as well as the LaTeX compiler, so they can find the<br>files they need from both OSMO_GSM_MANUALS_DIR and builddir.<br><br>Makefile.asciidoc.inc, Makefile.docbook.inc: refer to the output file<br>$@ with $(notdir $@). This removes the path from the file, like<br>basename from coreutils. The output file will then be placed in the<br>builddir instead of the srcdir.<br><br>Makefile.vty-reference.inc: use $(srcdir) in references to vty/*.xml<br>files.<br><br>(moving manuals to project repositories 12/19)<br><br>Related: OS#3385<br>Change-Id: Ie6b212a6518f0fc29fae610a37ae6c533189278d<br>---<br>M build/Makefile.asciidoc.inc<br>M build/Makefile.docbook.inc<br>M build/Makefile.vty-reference.inc<br>3 files changed, 31 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc</span><br><span>index cff47f6..2e3db86 100644</span><br><span>--- a/build/Makefile.asciidoc.inc</span><br><span>+++ b/build/Makefile.asciidoc.inc</span><br><span>@@ -56,12 +56,24 @@</span><br><span>               $(OSMO_GSM_MANUALS_DIR)/common/*/*.adoc \</span><br><span>            $(OSMO_GSM_MANUALS_DIR)/common/images/* \</span><br><span>            build common</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        # a2x can't use a different output file. To support out-of-tree builds,</span><br><span style="color: hsl(120, 100%, 40%);">+   # we create a symlink at $(builddir)/srcfile.adoc pointing at</span><br><span style="color: hsl(120, 100%, 40%);">+ # $(srcdir)/srcfile.adoc. $< is the $(srcdir)/srcfile.adoc,</span><br><span style="color: hsl(120, 100%, 40%);">+        # $(notdir) is like basename from coreutils, and $(builddir) is $PWD.</span><br><span style="color: hsl(120, 100%, 40%);">+ if ! [ -f $(notdir $<) ]; then \</span><br><span style="color: hsl(120, 100%, 40%);">+           ln -s $< $(notdir $<); \</span><br><span style="color: hsl(120, 100%, 40%);">+        fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  # TEXINPUTS: find LaTeX includes like \includegraphics{./common/images/sysmocom.pdf}</span><br><span style="color: hsl(120, 100%, 40%);">+  # in $(OSMO_GSM_MANUALS_DIR).</span><br><span>        @test -n "$(BUILD_RELEASE)" && echo -e "\n\n\</span><br><span>           NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\</span><br><span>           and remove three lines starting with '% \"DRAFT\" on first page'\n" \</span><br><span>           || true</span><br><span style="color: hsl(0, 100%, 40%);">-       a2x $(A2X_OPTS) $< || (echo "ERROR: a2x failed! Running asciidoc to get verbose errors..."; \</span><br><span style="color: hsl(0, 100%, 40%);">-              asciidoc -v $(ASCIIDOC_OPTS) $<; exit 1)</span><br><span style="color: hsl(120, 100%, 40%);">+   TEXINPUTS="$(OSMO_GSM_MANUALS_DIR)" \</span><br><span style="color: hsl(120, 100%, 40%);">+               a2x $(A2X_OPTS) $(notdir $<) || (echo "ERROR: a2x failed! Running asciidoc to get verbose errors..."; \</span><br><span style="color: hsl(120, 100%, 40%);">+                  asciidoc -v $(ASCIIDOC_OPTS) $(notdir $<); exit 1)</span><br><span> </span><br><span> check: $(ASCIIDOC_CHECKS)</span><br><span> </span><br><span>@@ -70,9 +82,18 @@</span><br><span>              $(OSMO_GSM_MANUALS_DIR)/common/chapters/*.adoc \</span><br><span>             $(ASCIIDOC_DEPS) \</span><br><span>           build common</span><br><span style="color: hsl(0, 100%, 40%);">-    asciidoc -v $(ASCIIDOC_OPTS) $< > $@ 2>&1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      # out-of-tree building: use a symlink to the output file like done in</span><br><span style="color: hsl(120, 100%, 40%);">+ # the non-check build above, so the relative include paths work the</span><br><span style="color: hsl(120, 100%, 40%);">+   # same.</span><br><span style="color: hsl(120, 100%, 40%);">+       if ! [ -f $(notdir $<) ]; then \</span><br><span style="color: hsl(120, 100%, 40%);">+           ln -s $< $(notdir $<); \</span><br><span style="color: hsl(120, 100%, 40%);">+        fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  asciidoc -v $(ASCIIDOC_OPTS) $(notdir $<) > $(notdir $@) 2>&1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>         # Make absolutely sure that the %.check target is updated.</span><br><span style="color: hsl(0, 100%, 40%);">-      touch $@</span><br><span style="color: hsl(120, 100%, 40%);">+      touch $(notdir $@)</span><br><span>   # Do print the WARNING output but return error if any was found</span><br><span>      # (grep -v would omit the WARNING output from the log).</span><br><span style="color: hsl(0, 100%, 40%);">- @grep WARNING $@ && exit 1 || exit 0</span><br><span style="color: hsl(120, 100%, 40%);">+  @grep WARNING $(notdir $@) && exit 1 || exit 0</span><br><span>diff --git a/build/Makefile.docbook.inc b/build/Makefile.docbook.inc</span><br><span>index 7b9969a..373db7d 100644</span><br><span>--- a/build/Makefile.docbook.inc</span><br><span>+++ b/build/Makefile.docbook.inc</span><br><span>@@ -32,6 +32,8 @@</span><br><span>      xmllint --xinclude --postvalid --noout $<</span><br><span> </span><br><span> # Create a PDF file and lint it before</span><br><span style="color: hsl(120, 100%, 40%);">+# xslt path: find includes in both $(OSMO_GSM_MANUALS_DIR)/common/chapters and $(builddir)/generated</span><br><span> %.pdf: %.xml %.xml-lint $(DOCBOOKS_DEPS) build common</span><br><span style="color: hsl(0, 100%, 40%);">-       dblatex $(dblatex_quiet) -P draft.mode=no $<</span><br><span style="color: hsl(120, 100%, 40%);">+       dblatex --xslt-opts="--path $(realpath $(OSMO_GSM_MANUALS_DIR))/common/chapters:$$PWD/generated" \</span><br><span style="color: hsl(120, 100%, 40%);">+          $(dblatex_quiet) -P draft.mode=no -o $(notdir $@) $<</span><br><span> </span><br><span>diff --git a/build/Makefile.vty-reference.inc b/build/Makefile.vty-reference.inc</span><br><span>index cb00648..9d8f127 100644</span><br><span>--- a/build/Makefile.vty-reference.inc</span><br><span>+++ b/build/Makefile.vty-reference.inc</span><br><span>@@ -32,13 +32,13 @@</span><br><span> CLEAN_FILES += generated</span><br><span> </span><br><span> generated/docbook_vty.xml: \</span><br><span style="color: hsl(0, 100%, 40%);">-                     vty/*xml \</span><br><span style="color: hsl(120, 100%, 40%);">+                    $(srcdir)/vty/*xml \</span><br><span>                         $(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \</span><br><span>                           $(OSMO_GSM_MANUALS_DIR)/common/chapters/vty.xml \</span><br><span>                            $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl</span><br><span>         $(OSMO_GSM_MANUALS_DIR)/build/vty_reference_combine.sh "$(MERGE_DOC)" \</span><br><span>            $(srcdir)/vty/*reference.xml \</span><br><span>               $(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \</span><br><span style="color: hsl(0, 100%, 40%);">-              vty/*additions*.xml</span><br><span style="color: hsl(120, 100%, 40%);">+           $(srcdir)/vty/*additions*.xml</span><br><span>        xsltproc $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl generated/combined.xml \</span><br><span>          > generated/docbook_vty.xml</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11803">change 11803</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/11803"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-gsm-manuals </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ie6b212a6518f0fc29fae610a37ae6c533189278d </div>
<div style="display:none"> Gerrit-Change-Number: 11803 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>