docs: convert plugins doc md->rst
[vpp.git] / test / doc / Makefile
1 # Makefile for VPP Test documentation
2 #
3
4 SPHINXOPTS    =
5 SRC_DOC_DIR = $(TEST_DIR)/doc
6 SPHINXBUILD = sphinx-build
7 HTML_DOC_GEN_DIR = $(TEST_DOC_BR)/html
8 API_DOC_GEN_DIR = $(TEST_DOC_BR)/api
9
10 # Internal variables.
11 ALLSPHINXOPTS   = -d $(TEST_DOC_BR)/.sphinx-cache $(SPHINXOPTS) $(API_DOC_GEN_DIR) -c $(SRC_DOC_DIR)
12 IN_VENV:=$(shell if pip -V | grep "venv" 2>&1 > /dev/null; then echo 1; else echo 0; fi)
13
14 .PHONY: verify-virtualenv
15 verify-virtualenv:
16 ifndef TEST_DIR
17         $(error TEST_DIR is not set)
18 endif
19 ifndef TEST_DOC_BR
20         $(error TEST_DOC_BR is not set)
21 endif
22 ifeq ($(IN_VENV),0)
23         $(error "Not running inside virtualenv (are you running 'make test-doc' from root?)")
24 endif
25
26 .PHONY: regen-api-doc
27 regen-api-doc: verify-virtualenv
28         @mkdir -p $(API_DOC_GEN_DIR)
29         @cp $(SRC_DOC_DIR)/index.rst $(API_DOC_GEN_DIR)
30         @cp $(SRC_DOC_DIR)/indices.rst $(API_DOC_GEN_DIR)
31         @cp $(SRC_DOC_DIR)/overview.rst $(API_DOC_GEN_DIR)
32         sphinx-apidoc -o $(API_DOC_GEN_DIR) -H "Module documentation" $(TEST_DIR)
33
34 .PHONY: html
35 html: regen-api-doc verify-virtualenv
36         $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(HTML_DOC_GEN_DIR)