manuals: generate vty reference xml at build time

Move 'doc' subdir further down to "make sure" the osmo-bsc binary is built
before the docs.

Remove bsc_vty_reference.xml from the source tree.

In manuals/Makefile.am use the new BUILT_REFERENCE_XML feature recently added
to osmo-gsm-manuals, and add a build target to generate the XML using the new
osmo-bsc --vty-ref-xml cmdline switch.

Depends: I613d692328050a036d05b49a436ab495fc2087ba (osmo-gsm-manuals)
Change-Id: I5dc872149154e1a949bb6a2b9bbc1461e0fc51f6
diff --git a/doc/manuals/Makefile.am b/doc/manuals/Makefile.am
index 6542393..c86f215 100644
--- a/doc/manuals/Makefile.am
+++ b/doc/manuals/Makefile.am
@@ -19,6 +19,12 @@
   aoip-mgw-options.pdf: $(srcdir)/aoip-mgw-options.adoc $(srcdir)/mgw/*.msc
 
   VTY_REFERENCE = osmobsc-vty-reference.xml
+
+  BUILT_REFERENCE_XML = $(builddir)/vty/bsc_vty_reference.xml
+  $(builddir)/vty/bsc_vty_reference.xml: $(top_builddir)/src/osmo-bsc/osmo-bsc
+	mkdir -p $(builddir)/vty
+	$(top_builddir)/src/osmo-bsc/osmo-bsc --vty-ref-xml > $@
+
   include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc
 
   OSMO_REPOSITORY = osmo-bsc