Change in osmo-gsm-manuals[master]: Makefile.vty-reference.inc: create 'generated' in this file

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/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Nov 2 09:29:59 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/20951 )

Change subject: Makefile.vty-reference.inc: create 'generated' in this file
......................................................................

Makefile.vty-reference.inc: create 'generated' in this file

Ideally, 'vty_reference_combine.sh' should not create any files
nor directories on its own; it should do exactly what its name
suggests - combine several XML files into a single one.

Let's first make the target directory ('generated') creation a
task of 'Makefile.vty-reference.inc', and then make it output
the results to stdout in a follow-up change.

Change-Id: Iabe729af22c235cf9c4b252acda99b43ebcae20c
Related: SYS#4937
---
M build/Makefile.vty-reference.inc
M build/vty_reference_combine.sh
2 files changed, 16 insertions(+), 12 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/build/Makefile.vty-reference.inc b/build/Makefile.vty-reference.inc
index c1db67b..9e22925 100644
--- a/build/Makefile.vty-reference.inc
+++ b/build/Makefile.vty-reference.inc
@@ -49,47 +49,52 @@
 
 DOCBOOKS = $(VTY_REFERENCE)
 
-# First VTY reference
-DOCBOOKS_DEPS = generated/docbook_vty.xml
+# Directory for intermediate results
+GEN_DIR = generated
 
-# Additional VTY references: prepend "generated/docbook_"
+# First VTY reference
+DOCBOOKS_DEPS = $(GEN_DIR)/docbook_vty.xml
+
+# Additional VTY references: prepend "$(GEN_DIR)/docbook_"
 # For example:
 # VTY_REFERENCE = osmosgsn-vty-reference.xml osmogbproxy-vty-reference.xml
-# DOCBOOK_DEPS = generated/docbook_vty.xml generated/docbook_osmogbproxy-vty-reference.xml
-DOCBOOKS_DEPS += $(patsubst %,generated/docbook_%,$(filter-out $(firstword $(VTY_REFERENCE)),$(VTY_REFERENCE)))
+# DOCBOOK_DEPS = $(GEN_DIR)/docbook_vty.xml $(GEN_DIR)/docbook_osmogbproxy-vty-reference.xml
+DOCBOOKS_DEPS += $(patsubst %,$(GEN_DIR)/docbook_%,$(filter-out $(firstword $(VTY_REFERENCE)),$(VTY_REFERENCE)))
 
 include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.docbook.inc
 
 MERGE_DOC = $(shell realpath $(OSMO_GSM_MANUALS_DIR)/merge_doc.xsl)
 
-CLEAN_FILES += generated
+CLEAN_FILES += $(GEN_DIR)
 CLEAN_FILES += $(BUILT_REFERENCE_XML)
 
 # First VTY reference
-generated/docbook_vty.xml: \
+$(GEN_DIR)/docbook_vty.xml: \
 			   $(srcdir)/vty/*xml \
 			   $(BUILT_REFERENCE_XML) \
 			   $(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \
 			   $(OSMO_GSM_MANUALS_DIR)/common/chapters/vty.xml \
 			   $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl
+	mkdir -p $(GEN_DIR)
 	$(OSMO_GSM_MANUALS_DIR)/build/vty_reference_combine.sh "$(MERGE_DOC)" \
 		$$($(OSMO_GSM_MANUALS_DIR)/build/find_existing_path.sh "vty/*reference.xml" $(builddir) $(srcdir)) \
 		$(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \
 		$(srcdir)/vty/*additions*.xml
-	xsltproc $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl generated/combined.xml \
-		> generated/docbook_vty.xml
+	xsltproc $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl $(GEN_DIR)/combined.xml \
+		> $(GEN_DIR)/docbook_vty.xml
 
 # Additional VTY references
-generated/docbook_%-vty-reference.xml: \
+$(GEN_DIR)/docbook_%-vty-reference.xml: \
 			 $(srcdir)/vty-%/*xml \
 			 $(BUILT_REFERENCE_XML) \
 			 $(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \
 			 $(OSMO_GSM_MANUALS_DIR)/common/chapters/vty.xml \
 			 $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl
-	export VTYDIR_NAME="vty-$(patsubst generated/docbook_%-vty-reference.xml,%,$@)" && \
+	export VTYDIR_NAME="vty-$(patsubst $(GEN_DIR)/docbook_%-vty-reference.xml,%,$@)" && \
 	export VTYDIR_SRC="$(srcdir)/$$VTYDIR_NAME" && \
 	export VTYDIR_BUILD="$(builddir)/$$VTYDIR_NAME" && \
 	export VTYGEN="$@_combine" && \
+	mkdir -p $$VTYGEN && \
 	$(OSMO_GSM_MANUALS_DIR)/build/vty_reference_combine.sh "$(MERGE_DOC)" \
 		$$($(OSMO_GSM_MANUALS_DIR)/build/find_existing_path.sh "*reference.xml" $$VTYDIR_BUILD $$VTYDIR_SRC) \
 		$(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \
diff --git a/build/vty_reference_combine.sh b/build/vty_reference_combine.sh
index 6ab279e..11e84c0 100755
--- a/build/vty_reference_combine.sh
+++ b/build/vty_reference_combine.sh
@@ -20,7 +20,6 @@
 combine_src="$VTYGEN/combine_src.xml"
 
 set -x
-mkdir -p "$VTYGEN"
 cp $reference "$combined"
 
 while [ -n "$1" ]; do

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/20951
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Change-Id: Iabe729af22c235cf9c4b252acda99b43ebcae20c
Gerrit-Change-Number: 20951
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201102/a8a540c6/attachment.htm>


More information about the gerrit-log mailing list