From e3f449c617b496a55cf5bd51c7463028b1faa12a Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Sat, 8 Aug 2020 11:59:41 +0200 Subject: [PATCH] doc: use autotoolized Doxyfile This has several advantages: * More simplified Makefile.am * Actually used doxygen config is available as a file * Building doc out-of-tree is possible Signed-off-by: Alexander Stein [Bartosz: add a dependency on Doxygen to the doc target in Makefile] Signed-off-by: Bartosz Golaszewski --- .gitignore | 1 + Doxyfile => Doxyfile.in | 3 ++- Makefile.am | 6 ++---- configure.ac | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) rename Doxyfile => Doxyfile.in (95%) diff --git a/.gitignore b/.gitignore index 488d9d6..a77efde 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ doc # autotools stuff .deps/ .libs/ +Doxyfile Makefile Makefile.in aclocal.m4 diff --git a/Doxyfile b/Doxyfile.in similarity index 95% rename from Doxyfile rename to Doxyfile.in index b194095..8c6d591 100644 --- a/Doxyfile +++ b/Doxyfile.in @@ -10,6 +10,7 @@ # General configuration PROJECT_NAME = libgpiod +PROJECT_NUMBER = @VERSION_STR@ OUTPUT_DIRECTORY = doc OUTPUT_LANGUAGE = English EXTRACT_ALL = NO @@ -48,7 +49,7 @@ WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_FORMAT = WARN_LOGFILE = -INPUT = include/gpiod.h +INPUT = @top_srcdir@/include/gpiod.h @top_srcdir@/bindings/cxx/gpiod.hpp SOURCE_BROWSER = YES INLINE_SOURCES = NO REFERENCED_BY_RELATION = YES diff --git a/Makefile.am b/Makefile.am index d3f57b2..b67312f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,10 +28,8 @@ SUBDIRS += bindings if HAS_DOXYGEN -doc: - @(cat Doxyfile; \ - echo PROJECT_NUMBER = $(VERSION_STR); \ - echo INPUT += bindings/cxx/gpiod.hpp) | doxygen - +doc: Doxyfile + @doxygen Doxyfile .PHONY: doc clean-local: diff --git a/configure.ac b/configure.ac index 008499d..c2d9f99 100644 --- a/configure.ac +++ b/configure.ac @@ -207,6 +207,7 @@ if test "x$has_doxygen" = xfalse then AC_MSG_NOTICE([doxygen not found - documentation cannot be generated]) fi +AM_COND_IF([HAS_DOXYGEN], [AC_CONFIG_FILES([Doxyfile])]) if test "x$cross_compiling" = xno then -- 2.30.2