summaryrefslogtreecommitdiffstats
path: root/docs/scripts/sphinx-make.sh
blob: 532225e488e78a4ce903a0958611ad37f3f69132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash -ex

# Not refactored to root Makefile because CI calls this from
# makefile in /docs (as if 'make -C docs').
if [ -z "$PYTHON" ]
then
PYTHON_INTERP=python3
else
PYTHON_INTERP=$(PYTHON)
fi

# Get the OS
OS_ID=$(grep '^ID=' /etc/os-release  | cut -f2- -d= | sed -e 's/\"//g')
OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release  | cut -f2- -d= | sed -e 's/\"//g')
PIP_VERSION=$(grep 'PIP_VERSION=' $WS_ROOT/test/Makefile | cut -d'=' -f2)
PIP_TOOLS_VERSION=$(grep 'PIP_TOOLS_VERSION=' $WS_ROOT/test/Makefile | cut -d'=' -f2)

if [ "$1" == "venv" ]
then

    # Install the virtual environment
    $PYTHON_INTERP -m venv $VENV_DIR
    source $VENV_DIR/bin/activate;
    $PYTHON_INTERP -m pip install pip==$PIP_VERSION
    $PYTHON_INTERP -m pip install pip-tools==$PIP_TOOLS_VERSION
    $PYTHON_INTERP -m pip install -r $WS_ROOT/test/requirements-3.txt
else
    [ -n "$(declare -f deactivate)" ] && deactivate
    source $VENV_DIR/bin/activate;
    VERSION=`source $WS_ROOT/src/scripts/version`
    TM=`TZ=GMT date`
    sed -ie "s/**VPP Version:\*\* .*/**VPP Version:** $VERSION/" $DOCS_DIR/about.rst
    sed -ie "s/**Built on:\*\* .*/**Built on:** $TM/" $DOCS_DIR/about.rst
    rm $DOCS_DIR/about.rste
    make -C $DOCS_DIR $1
fi

deactivate
"se">\ DIR_EXCLUDE="examples" ; \ GREP_TIME=`time (grep -wIr "\.path = " $$DIR_SEARCH --exclude-dir=$$DIR_EXCLUDE \ | cut -d '"' -f2 | sort -u > $(srcdir)/scripts/vppctl-cmd-list) 2>&1` ; \ GREP_TIME=`echo $$GREP_TIME | awk '{print $$2}'` ; \ echo "Command list built, Time taken: $$GREP_TIME" ############################################################################### # Components ############################################################################### include vppinfra.am include vppapigen.am if ENABLE_PERFTOOL include perftool.am endif if ENABLE_G2 include g2.am endif if ENABLE_SVM include svm.am endif if ENABLE_VLIB include vlib.am endif if ENABLE_SVM if ENABLE_VLIB include vlib-api.am include vnet.am include vpp.am include vpp-api-test.am include vcl.am SUBDIRS += plugins SUBDIRS += vpp-api/vapi if ENABLE_PAPI include vpp-api.am SUBDIRS += vpp-api/python endif if ENABLE_JAPI SUBDIRS += vpp-api/java endif if ENABLE_VOM SUBDIRS += vpp-api/vom endif ############################################################################### # API ############################################################################### include suffix-rules.mk # Set the suffix list apidir = $(prefix)/share/vpp/api/core api_DATA = \ $(patsubst %.api,%.api.json,$(API_FILES)) BUILT_SOURCES += \ $(patsubst %.api,%.api.h,$(API_FILES)) endif # if ENABLE_VLIB endif # if ENABLE_SVM CLEANFILES += $(BUILT_SOURCES) $(api_DATA)