summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorChris Luke <chrisy@flirble.org>2016-07-25 16:38:11 -0400
committerDave Barach <openvpp@barachs.net>2016-08-31 12:56:56 +0000
commit54ccf2261cb1f4afd966b7b1e92689183cb17836 (patch)
tree3f1aee6c70c4c5983828d1f53a2c46dd9bb28f8c /Makefile
parentd85590a00421a73f019a91c6c3cdd05b6b73f414 (diff)
VPP-221 CLI auto-documentation infrastructure
As a step before Doxygen, extract CLI-related struct initializers from the code and parse that into a summary of the CLI commands available with the provided help text, such as it is. At the moment this only renders this into an indexed Markdown file that Doxygen then picks up but later we can use this information to enrich the existing VLIB_CLI_COMMAND macro documentor as well as provide runtime documentation to VPP that is stored on disk outside the binary image. Additionally support a comment block immediately prior to VLIB_CLI_COMMAND CLI command definitions in the form /*? ... ?*/ that can be used to include long-form documentation without having it compiled into VPP. Examples of documenting CLI commands can be found in vlib/vlib/unix/cli.c which, whilst not perfect, should provide a starting point. Screen captures of sample output can be seen at https://chrisy.flirble.org/vpp/doxy-cli-example.png and https://chrisy.flirble.org/vpp/doxy-cli-index.png . Next, shift the Doxygen root makefile targets to their own Makefile. The primary reason for this is that the siphon targets do dependency tracking which means it needs to generate those dependencies whenever make is run; that is pointless if we're not going to generate any documentation. This includes the package dependencies since they since they sometimes unnecessarily interfere with the code build in some cases at the moment; later we will look to building a Python venv to host the Python modules we use. One final remark: In future we may consider deprecating .long_help in the VLIB_CLI_COMMAND structure entirely but add perhaps .usage_help. .short_help would be reserved for a summary of the command function and .usage_help provide the syntax of that command. These changes would provide great semantic value to the automaticly generated CLI documentation. I could also see having .long_help replaced by a mechanism that reads it from disk at runtime with a rudimentary Markdown/Doxygen filter so that we can use the same text that is used in the published documentation. Change-Id: I80d6fe349b47dce649fa77d21ffec0ddb45c7bbf Signed-off-by: Chris Luke <chrisy@flirble.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 18 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index f12a0da8fbf..5808a3336c1 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed
DEB_DEPENDS = curl build-essential autoconf automake bison libssl-dev ccache
DEB_DEPENDS += debhelper dkms git libtool libganglia1-dev libapr1-dev dh-systemd
DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope
-DEB_DEPENDS += doxygen graphviz python-dev
+DEB_DEPENDS += python-dev
ifeq ($(OS_VERSION_ID),14.04)
DEB_DEPENDS += openjdk-8-jdk-headless
else
@@ -40,7 +40,7 @@ endif
RPM_DEPENDS_GROUPS = 'Development Tools'
RPM_DEPENDS = redhat-lsb glibc-static java-1.8.0-openjdk-devel yum-utils
RPM_DEPENDS += openssl-devel https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm apr-devel
-RPM_DEPENDS += doxygen graphviz python-devel
+RPM_DEPENDS += python-devel
EPEL_DEPENDS = libconfuse-devel ganglia-devel
ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),)
@@ -54,7 +54,7 @@ endif
.PHONY: help bootstrap wipe wipe-release build build-release rebuild rebuild-release
.PHONY: run run-release debug debug-release build-vat run-vat pkg-deb pkg-rpm
-.PHONY: ctags cscope doxygen wipe-doxygen plugins plugins-release build-vpp-api
+.PHONY: ctags cscope plugins plugins-release build-vpp-api
help:
@echo "Make Targets:"
@@ -81,6 +81,7 @@ help:
@echo " gtags - (re)generate gtags database"
@echo " cscope - (re)generate cscope database"
@echo " doxygen - (re)generate documentation"
+ @echo " bootstrap-doxygen - setup Doxygen dependencies"
@echo " wipe-doxygen - wipe all generated documentation"
@echo ""
@echo "Make Arguments:"
@@ -237,24 +238,21 @@ cscope: cscope.files
# Build the documentation
#
-DOXY_INPUT ?= \
- README.md \
- vppinfra \
- svm \
- vlib \
- vlib-api \
- vnet \
- vpp \
- vpp-api
+# Doxygen configuration and our utility scripts
+export DOXY_DIR ?= $(WS_ROOT)/doxygen
+
+define make-doxy
+ @WS_ROOT="$(WS_ROOT)" BR="$(BR)" make -C $(DOXY_DIR) $@
+endef
+
+.PHONY: bootstrap-doxygen doxygen wipe-doxygen
+
+bootstrap-doxygen:
+ $(call make-doxy)
doxygen:
- @mkdir -p "$(BR)/docs"
- ROOT="$(WS_ROOT)" \
- BUILD_ROOT="$(BR)" \
- INPUT="$(addprefix $(WS_ROOT)/,$(DOXY_INPUT))" \
- HTML=YES \
- VERSION="`git describe --tags --dirty`" \
- doxygen doxygen/doxygen.cfg
+ $(call make-doxy)
wipe-doxygen:
- rm -rf "$(BR)/docs"
+ $(call make-doxy)
+