[2/2] doc/api: track header files to rebuild docs on change
diff mbox series

Message ID 20200117112236.5225-3-bruce.richardson@intel.com
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • Do proper dependency tracking for doxygen
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/travis-robot warning Travis build: failed
ci/checkpatch warning coding style issues

Commit Message

Bruce Richardson Jan. 17, 2020, 11:22 a.m. UTC
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@intel.com>
---
 doc/api/generate_doxygen.sh | 5 ++++-
 doc/api/meson.build         | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Luca Boccassi Jan. 17, 2020, 11:51 a.m. UTC | #1
On Fri, 2020-01-17 at 11:22 +0000, Bruce Richardson wrote:
> 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@intel.com
> >
> ---
>  doc/api/generate_doxygen.sh | 5 ++++-
>  doc/api/meson.build         | 3 ++-
>  2 files changed, 6 insertions(+), 2 deletions(-)

Acked-by: Luca Boccassi <bluca@debian.org>

Patch
diff mbox series

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,