<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11803">View Change</a></p><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 srcdir andbuilddir.<br><br>Makefile.vty-reference.inc: use $(srcdir) in references to vty/*.xml<br>files.<br><br>(moving manuals to project repositories 11/16)<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, 20 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/03/11803/1</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 4cad1f3..0d5c497 100644</span><br><span>--- a/build/Makefile.asciidoc.inc</span><br><span>+++ b/build/Makefile.asciidoc.inc</span><br><span>@@ -54,12 +54,18 @@</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, so we symlink the file to the</span><br><span style="color: hsl(120, 100%, 40%);">+    # build folder in case of an out-of-tree build</span><br><span style="color: hsl(120, 100%, 40%);">+        [ -f $(notdir $<) ] || ln -s $< $(notdir $<)</span><br><span style="color: hsl(120, 100%, 40%);">+</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>@@ -68,7 +74,14 @@</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%);">+       [ -f $(notdir $<) ] || ln -s $< $(notdir $<)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       asciidoc -v $(ASCIIDOC_OPTS) $(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>   touch $@</span><br><span>     # Do print the WARNING output but return error if any was found</span><br><span>diff --git a/build/Makefile.docbook.inc b/build/Makefile.docbook.inc</span><br><span>index e746d58..96d9073 100644</span><br><span>--- a/build/Makefile.docbook.inc</span><br><span>+++ b/build/Makefile.docbook.inc</span><br><span>@@ -31,5 +31,6 @@</span><br><span> </span><br><span> # Create a PDF file and lint it before</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 $(OSMO_GSM_MANUALS_DIR)/common/chapters:$$PWD/generated" \</span><br><span style="color: hsl(120, 100%, 40%);">+              $(dblatex_quiet) -P draft.mode=no -o $@ $<</span><br><span> </span><br><span>diff --git a/build/Makefile.vty-reference.inc b/build/Makefile.vty-reference.inc</span><br><span>index 32c98b8..855d8aa 100644</span><br><span>--- a/build/Makefile.vty-reference.inc</span><br><span>+++ b/build/Makefile.vty-reference.inc</span><br><span>@@ -30,13 +30,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: newchange </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: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>