From a75b402f55bc9d951f897600c1314a3613e73679 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Mon, 26 Oct 2020 01:24:58 +0700 Subject: doc/manuals: generate XML VTY reference at build-time Unfortunately, we cannot re-use the existing Makefile rules from: $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc because they do not allow to generate the list of $(DOCBOOKS) from a template, and require the project to store everything in separate folders with specific names. Also, those rules expect that the target PDFs contain only a single word in their names (for example, 'osmoapp-vty-reference', not 'osmo-app-vty-reference'), while in a project with multiple similarly named targets this would reduce readability (imagine 'osmotrxuhd-vty-reference'). Change-Id: Idba84164b90e3d183a20b5eb69cbfe15745e447c Depends: I6aac73d998c5937894233631e654a160d5623198 Related: SYS#4937, SYS#4910, OS#3036 --- doc/manuals/Makefile.am | 27 +- doc/manuals/osmobts-vty-reference.xml | 11 +- doc/manuals/vty/Makefile.vty-reference.inc | 37 + doc/manuals/vty/bts_vty_reference.xml | 2018 ---------------------------- 4 files changed, 71 insertions(+), 2022 deletions(-) create mode 100644 doc/manuals/vty/Makefile.vty-reference.inc delete mode 100644 doc/manuals/vty/bts_vty_reference.xml (limited to 'doc') diff --git a/doc/manuals/Makefile.am b/doc/manuals/Makefile.am index e8018d57..2fd21e6b 100644 --- a/doc/manuals/Makefile.am +++ b/doc/manuals/Makefile.am @@ -18,8 +18,31 @@ if BUILD_MANUALS osmobts-abis.pdf: $(srcdir)/abis/*.adoc $(srcdir)/abis/*.msc rtp-amr.pdf: $(srcdir)/dtx.dot - VTY_REFERENCE = osmobts-vty-reference.xml - include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc + VARIANTS = $(NULL) + +if ENABLE_SYSMOBTS + VARIANTS += sysmo +endif + +if ENABLE_TRX + VARIANTS += trx +endif + +if ENABLE_OCTPHY + VARIANTS += octphy +endif + +if ENABLE_LC15BTS + VARIANTS += lc15 +endif + +if ENABLE_OC2GBTS + VARIANTS += oc2g +endif + + # This is a significantly modified, multi-target adopted copy of + # $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc + include $(srcdir)/vty/Makefile.vty-reference.inc OSMO_REPOSITORY = osmo-bts include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc diff --git a/doc/manuals/osmobts-vty-reference.xml b/doc/manuals/osmobts-vty-reference.xml index b7c8a596..a38eb059 100644 --- a/doc/manuals/osmobts-vty-reference.xml +++ b/doc/manuals/osmobts-vty-reference.xml @@ -6,7 +6,7 @@ - + ]> @@ -18,12 +18,19 @@ hw Initial + + v2 + @@REV_DATE@@ + s.f.m.c. + Automatic build (@@REV_NUMBER@@) + OsmoBTS VTY Reference + @@VARIANT@@ - 2016 + @@CR_YEAR@@ diff --git a/doc/manuals/vty/Makefile.vty-reference.inc b/doc/manuals/vty/Makefile.vty-reference.inc new file mode 100644 index 00000000..f27506bd --- /dev/null +++ b/doc/manuals/vty/Makefile.vty-reference.inc @@ -0,0 +1,37 @@ +DOCBOOKS = $(foreach v,$(VARIANTS),vty/osmobts-$(v)-vty-reference.xml) +DOCBOOKS_DEPS = $(DOCBOOKS) $(addsuffix .inc,$(DOCBOOKS)) +INC_DIR = $(abspath $(builddir)/vty) + +include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.docbook.inc + +CLEAN_FILES += $(DOCBOOKS_DEPS) +CLEAN_FILES += $(addsuffix .inc.gen,$(DOCBOOKS)) +CLEAN_FILES += $(addsuffix .inc.merged,$(DOCBOOKS)) + +$(INC_DIR): + mkdir -p $@ + +vty/osmobts-%-vty-reference.xml: $(top_srcdir)/src/osmo-bts-% $(INC_DIR) + sed -e "s|@@GENERATED@@|$@.inc|" \ + -e "s|@@VARIANT@@|$(notdir $<)|" \ + -e "s|@@REV_NUMBER@@|$(VERSION)|" \ + -e "s|@@REV_DATE@@|$(shell date +"%dth %B %Y")|" \ + -e "s|@@CR_YEAR@@|$(shell date +"%Y")|" \ + $(srcdir)/osmobts-vty-reference.xml > $@ + +vty/osmobts-%-vty-reference.xml.inc: $(top_builddir)/src/osmo-bts-*/osmo-bts-% \ + $(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \ + $(OSMO_GSM_MANUALS_DIR)/common/chapters/vty.xml \ + $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl \ + $(srcdir)/vty/*.xml $(INC_DIR) + # a) Invoke osmo-bts-% to generate the list of commands first + $< --vty-ref-mode default --vty-ref-xml > "$@.gen" + # ... filter garbage potentially printed by libraries to stdout + sed -i '/^ "$@.merged" + # c) Convert the result of b) into a valid docbook + xsltproc $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl "$@.merged" > $@ diff --git a/doc/manuals/vty/bts_vty_reference.xml b/doc/manuals/vty/bts_vty_reference.xml deleted file mode 100644 index a4c4be6d..00000000 --- a/doc/manuals/vty/bts_vty_reference.xml +++ /dev/null @@ -1,2018 +0,0 @@ - - - Common Commands - These commands are available on all VTY nodes. They are listed here only once, to unclutter the VTY reference. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - view - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enable - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - config - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - config-log - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - config-stats - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - config-line - - - - - - - - - - - - - - - - - - - - - config-e1_input - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - config-ctrl - - - - - - - - - phy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - phy-inst - - - bts - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - trx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3