Change in osmo-gsm-manuals[master]: *filter.conf/*.sty: use symlinks to build, common

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Fri Nov 16 14:46:39 UTC 2018


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/11798


Change subject: *filter.conf/*.sty: use symlinks to build, common
......................................................................

*filter.conf/*.sty: use symlinks to build, common

$(OSMO_GSM_MANUALS_DIR) is used in most places to reference to the top
folder, which contains "build" and "common". But not in the asciidoc
mscgen filter configurations, and in the custom LaTeX style. They have
../common or ../build hardcoded, which won't work anymore when the
project specific files will be in another repository.

Update the Makefiles to create symlinks to "build" and "common" in the
folder where the build was started. Use ./common in the files that had
../common hardcoded, and do the same for ./build.

Update the Makefile.common.inc comment to refer to common targets in
general, so we don't need to list each single one there (like the new
'common' and 'build' targets).

I've also thought about using variables there, but this would only work
for the asciidoc files, not for the .sty file. We would need to
generate the latter from another file and replace the variable
dynamically. Having the symlinks instead seemed to be slightly easier.

(moving manuals to project repositories 6/16)

Related: OS#3385
Change-Id: I4cfd1a9ef482d382f10cdf060e8e2cba81852864
---
M .gitignore
M build/Makefile.asciidoc.inc
M build/Makefile.common.inc
M build/Makefile.docbook.inc
M build/custom-dblatex.sty
M build/mscgen-filter.conf
M build/python2-filter.conf
7 files changed, 25 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/98/11798/1

diff --git a/.gitignore b/.gitignore
index 30bc93e..bdf3212 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,7 @@
 *.pc
 Makefile.in
 Makefile
+
+# symlinks to shared folders (needed for out-of-tree builds)
+*/common
+*/build
diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc
index 2cd7d50..0d84b0b 100644
--- a/build/Makefile.asciidoc.inc
+++ b/build/Makefile.asciidoc.inc
@@ -52,7 +52,8 @@
 		$(ASCIIDOC_DEPS) \
 		$(ASCIIDOCSTYLE) \
 		$(OSMO_GSM_MANUALS_DIR)/common/*/*.adoc \
-		$(OSMO_GSM_MANUALS_DIR)/common/images/*
+		$(OSMO_GSM_MANUALS_DIR)/common/images/* \
+		build common
 	@test -n "$(BUILD_RELEASE)" && echo -e "\n\n\
 	  NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\
 	        and remove three lines starting with '% \"DRAFT\" on first page'\n" \
@@ -62,7 +63,11 @@
 
 check: $(ASCIIDOC_CHECKS)
 
-$(ASCIIDOC_CHECKS): %.check: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(OSMO_GSM_MANUALS_DIR)/common/chapters/*.adoc $(ASCIIDOC_DEPS)
+$(ASCIIDOC_CHECKS): %.check: %.adoc %-docinfo.xml \
+		$(ASCIIDOCSTYLE) \
+		$(OSMO_GSM_MANUALS_DIR)/common/chapters/*.adoc \
+		$(ASCIIDOC_DEPS) \
+		build common
 	asciidoc -v $(ASCIIDOC_OPTS) $< > $@ 2>&1
 	# Make absolutely sure that the %.check target is updated.
 	touch $@
diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc
index e624b5f..35a6236 100644
--- a/build/Makefile.common.inc
+++ b/build/Makefile.common.inc
@@ -3,9 +3,14 @@
 # Other makefiles like Makefile.asciidoc.inc and Makefile.vty-reference.inc add
 # entries to UPLOAD_FILES and CLEAN_FILES.
 #
-# Include this file at the end to have 'upload' and 'clean' targets.
+# Include this file at the end to have the common targets (upload, clean etc.).
 
 UPLOAD_PATH ?= generic at sysmocom-downloads:documents
+SYMLINKS = common build
+CLEAN_FILES += $(SYMLINKS)
+
+$(SYMLINKS):
+	ln -s $(OSMO_GSM_MANUALS_DIR)/$@ $@
 
 upload: $(UPLOAD_FILES)
 	rsync -avz $(UPLOAD_FILES) $(UPLOAD_PATH)/
diff --git a/build/Makefile.docbook.inc b/build/Makefile.docbook.inc
index acf410e..59dcdb2 100644
--- a/build/Makefile.docbook.inc
+++ b/build/Makefile.docbook.inc
@@ -30,6 +30,6 @@
 	xmllint --xinclude --postvalid --noout $<
 
 # Create a PDF file and lint it before
-%.pdf: %.xml %.xml-lint $(DOCBOOKS_DEPS)
+%.pdf: %.xml %.xml-lint $(DOCBOOKS_DEPS) build common
 	dblatex $(dblatex_quiet) -P draft.mode=no $<
 
diff --git a/build/custom-dblatex.sty b/build/custom-dblatex.sty
index 606b9ab..40fb7cf 100644
--- a/build/custom-dblatex.sty
+++ b/build/custom-dblatex.sty
@@ -1,5 +1,6 @@
 %%
 %% This style is derived from the docbook one.
+%% The "common" folder is symlinked to ./common when building.
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{asciidoc}[2008/06/05 AsciiDoc DocBook Style]
@@ -40,13 +41,13 @@
 \textsf{
 \vfill
 \begin{center}
-  \includegraphics{../common/images/sysmocom.pdf}
+  \includegraphics{./common/images/sysmocom.pdf}
   \ \\ %
   \huge{\Company}
 \end{center}
 \vspace{2.5cm}
 \begin{center}
-  \includegraphics{../common/images/osmocom.pdf}
+  \includegraphics{./common/images/osmocom.pdf}
   \ \\ %
   \vspace{0.5cm}
   \huge{\textbf{\DBKtitle}}\\ %
diff --git a/build/mscgen-filter.conf b/build/mscgen-filter.conf
index ce3cb3f..689fa7c 100644
--- a/build/mscgen-filter.conf
+++ b/build/mscgen-filter.conf
@@ -1,9 +1,10 @@
 #
 # AsciiDoc mscgen filter configuration file.
+# The "build" folder is symlinked to ./build when building.
 #
 
 [mscgen-filter-style]
-mscgen-style=template="mscgen-block",subs=(),posattrs=("style","target"),filter='../build/filter-wrapper.py mscgen -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -T{format={basebackend-docbook!png}{basebackend-docbook?png}} -'
+mscgen-style=template="mscgen-block",subs=(),posattrs=("style","target"),filter='./build/filter-wrapper.py mscgen -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -T{format={basebackend-docbook!png}{basebackend-docbook?png}} -'
 
 [blockdef-listing]
 template::[mscgen-filter-style]
diff --git a/build/python2-filter.conf b/build/python2-filter.conf
index ca2ddaf..8ca2faa 100644
--- a/build/python2-filter.conf
+++ b/build/python2-filter.conf
@@ -1,9 +1,10 @@
 #
 # AsciiDoc mscgen filter configuration file.
+# The "build" folder is symlinked to ./build when building.
 #
 
 [python2-filter-style]
-python2-style=template="python2-block",subs=(),posattrs=("style","target"),filter='../build/filter-wrapper.py python2 - --output="{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}"'
+python2-style=template="python2-block",subs=(),posattrs=("style","target"),filter='./build/filter-wrapper.py python2 - --output="{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}"'
 
 [blockdef-listing]
 template::[python2-filter-style]

-- 
To view, visit https://gerrit.osmocom.org/11798
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4cfd1a9ef482d382f10cdf060e8e2cba81852864
Gerrit-Change-Number: 11798
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181116/e88d7e11/attachment.htm>


More information about the gerrit-log mailing list