From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- src/spdk/dpdk/buildtools/call-sphinx-build.py | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 src/spdk/dpdk/buildtools/call-sphinx-build.py (limited to 'src/spdk/dpdk/buildtools/call-sphinx-build.py') diff --git a/src/spdk/dpdk/buildtools/call-sphinx-build.py b/src/spdk/dpdk/buildtools/call-sphinx-build.py new file mode 100755 index 000000000..b9a3994e1 --- /dev/null +++ b/src/spdk/dpdk/buildtools/call-sphinx-build.py @@ -0,0 +1,31 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2019 Intel Corporation +# + +import sys +import os +from os.path import join +from subprocess import run, PIPE +from distutils.version import StrictVersion + +(sphinx, src, dst) = sys.argv[1:] # assign parameters to variables + +# for sphinx version >= 1.7 add parallelism using "-j auto" +ver = run([sphinx, '--version'], stdout=PIPE).stdout.decode().split()[-1] +sphinx_cmd = [sphinx] +if StrictVersion(ver) >= StrictVersion('1.7'): + sphinx_cmd += ['-j', 'auto'] + +# find all the files sphinx will process so we can write them as dependencies +srcfiles = [] +for root, dirs, files in os.walk(src): + srcfiles.extend([join(root, f) for f in files]) + +# run sphinx, putting the html output in a "html" directory +process = run(sphinx_cmd + ['-b', 'html', src, join(dst, 'html')], check=True) +print(str(process.args) + ' Done OK') + +# create a gcc format .d file giving all the dependencies of this doc build +with open(join(dst, '.html.d'), 'w') as d: + d.write('html: ' + ' '.join(srcfiles) + '\n') -- cgit v1.2.3