vxlan: vxlan/vxlan.api API cleanup
[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 ifndef BUILD_TEST_SRC
23         $(error BUILD_TEST_SRC is not set)
24 endif
25 ifeq ($(IN_VENV),0)
26         $(error "Not running inside virtualenv (are you running 'make test-doc' from root?)")
27 endif
28
29 .PHONY: regen-api-doc
30 regen-api-doc: verify-virtualenv
31         @mkdir -p $(API_DOC_GEN_DIR)
32         @cp $(SRC_DOC_DIR)/index.rst $(API_DOC_GEN_DIR)
33         @cp $(SRC_DOC_DIR)/indices.rst $(API_DOC_GEN_DIR)
34         @cp $(SRC_DOC_DIR)/overview.rst $(API_DOC_GEN_DIR)
35         sphinx-apidoc -o $(API_DOC_GEN_DIR) -H "Module documentation" $(BUILD_TEST_SRC)
36
37 .PHONY: html
38 html: regen-api-doc verify-virtualenv
39         $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(HTML_DOC_GEN_DIR)