[dpdk-dev] [PATCH 2/2] doc/api: track header files to rebuild docs on change

Bruce Richardson bruce.richardson at intel.com
Fri Jan 17 12:22:36 CET 2020


Generate a dependency file for the header files used in the API guide
so that the docs can be rebuilt if a header changes.

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 doc/api/generate_doxygen.sh | 5 ++++-
 doc/api/meson.build         | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/doc/api/generate_doxygen.sh b/doc/api/generate_doxygen.sh
index ab5766095..ee509e896 100755
--- a/doc/api/generate_doxygen.sh
+++ b/doc/api/generate_doxygen.sh
@@ -6,5 +6,8 @@ DOXYCONF=$1
 OUTDIR=$2
 SCRIPTCSS=$3
 
-doxygen "${DOXYCONF}"
+# run doxygen, capturing all the header files it processed
+doxygen "${DOXYCONF}" | tee doxygen.out
+echo "$OUTDIR: $(awk '/Preprocessing/ {printf("%s ", substr($2, 1, length($2) - 3))}' doxygen.out)" > $OUTDIR.d
+
 "${SCRIPTCSS}" "${OUTDIR}"/doxygen.css
diff --git a/doc/api/meson.build b/doc/api/meson.build
index 899e930fa..49d5b9a15 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -15,7 +15,7 @@ generate_doxygen = find_program('generate_doxygen.sh')
 generate_examples = find_program('generate_examples.sh')
 generate_css = find_program('doxy-html-custom.sh')
 
-htmldir = join_paths('share', 'doc', 'dpdk')
+htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk')
 
 # due to the following bug: https://github.com/mesonbuild/meson/issues/4107
 # if install is set to true it will override build_by_default and it will
@@ -46,6 +46,7 @@ doxy_build = custom_target('doxygen',
 	depends: example,
 	input: doxy_conf,
 	output: 'api',
+	depfile: 'api.d',
 	command: [generate_doxygen, '@INPUT@', '@OUTPUT@', generate_css],
 	install: get_option('enable_docs'),
 	install_dir: htmldir,
-- 
2.20.1



More information about the dev mailing list