From b796e3bd8da504afa2bad17ad0c4b0d620fe1025 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Tue, 15 Oct 2019 21:01:52 +0200 Subject: Automate building of doc both from GIT and dist tarball From both GIT and dist tarball: - Build html and man automatically if enabled and doxygen is available - Install html and man if enabled and built successfully, skip otherwise Signed-off-by: Joachim Nilsson --- configure.ac | 1 + doc/Makefile.am | 5 +++++ doc/man/man3/Makefile.am | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index a7e5f97..83dd967 100644 --- a/configure.ac +++ b/configure.ac @@ -165,6 +165,7 @@ DX_MAN_FEATURE(ON) DX_INIT_DOXYGEN(${PACKAGE_NAME}, [${top_builddir}/Doxyfile], [doc]) AM_CONDITIONAL(ENABLE_DOXYGEN,[test "x${DX_FLAG_doc}" = x1]) AM_CONDITIONAL(ENABLE_HTML,[test "x${DX_FLAG_html}" = x1]) +AM_CONDITIONAL(ENABLE_MAN,[test "x${DX_FLAG_man}" = x1]) # Check for sample building AC_MSG_CHECKING([whether to build sample programs]) diff --git a/doc/Makefile.am b/doc/Makefile.am index 255c143..203497e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -7,6 +7,11 @@ DISTCLEANFILES = libnet.tag if ENABLE_HTML pkgdata_DATA = html/* +all-local: doc + clean-local: -rm -rf html + +doc: + $(MAKE) -C @top_builddir@ $@ endif diff --git a/doc/man/man3/Makefile.am b/doc/man/man3/Makefile.am index c5902f6..39ba9c8 100644 --- a/doc/man/man3/Makefile.am +++ b/doc/man/man3/Makefile.am @@ -3,3 +3,10 @@ man3_MANS = $(srcdir)/libnet.3 \ $(srcdir)/libnet-macros.3 DISTCLEANFILES = libnet.3 libnet-functions.3 libnet-macros.3 EXTRA_DIST = $(man3_MANS) + +if ENABLE_MAN +$(man3_MANS): doc + +doc: + $(MAKE) -C @top_builddir@ $@ +endif -- cgit v1.2.1