From b2d0615481db11304d89d582655a908d783216a9 Mon Sep 17 00:00:00 2001 From: Christian Feld <c.feld@fz-juelich.de> Date: Sat, 6 Nov 2021 14:54:16 +0100 Subject: [PATCH] Customize distribution and installation doxygen creates documentation at make dist, copies it to tarball and extracts it at make install. Thus user doens't need to have (specific version) of doxygen. --- Makefile.am | 25 +++++++++++++++++++++++++ configure.ac | 4 ++++ doc/doxyfile.in | 15 +++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 doc/doxyfile.in diff --git a/Makefile.am b/Makefile.am index be48b7f..24c9db5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,3 +26,28 @@ libfoo_la_SOURCES = src/foo.c include_HEADERS = src/foo.h EXTRA_DIST += doc/documentation.md + +dist-hook: doxygen-2-dist +if HAVE_DOXYGEN +doxygen-2-dist: + $(DOXYGEN) doc/doxyfile + tar czf doxygen.tar.gz doxygen/ + cp doxygen.tar.gz $(distdir)/doc + rm -rf doxygen doxygen.tar.gz +else !HAVE_DOXYGEN +doxygen-2-dist: +endif !HAVE_DOXYGEN + +install-data-hook: doxygen-install +doxygen-install: + if test -e $(srcdir)/doc/doxygen.tar.gz; then \ + $(MKDIR_P) $(DESTDIR)$(docdir); \ + $(INSTALL_DATA) $(srcdir)/doc/doxygen.tar.gz $(DESTDIR)$(docdir)/; \ + cd $(DESTDIR)$(docdir); \ + tar xzf doxygen.tar.gz; \ + rm -f doxygen.tar.gz; \ + fi + +uninstall-hook: doxygen-uninstall +doxygen-uninstall: + rm -rf $(DESTDIR)$(docdir)/doxygen diff --git a/configure.ac b/configure.ac index a7f82ae..9bd0f83 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,10 @@ LT_INIT LIBPAPI +AC_CHECK_PROG([DOXYGEN], [doxygen], [`which doxygen`]) +AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) +AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/doxyfile])]) + AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/doc/doxyfile.in b/doc/doxyfile.in new file mode 100644 index 0000000..d032f51 --- /dev/null +++ b/doc/doxyfile.in @@ -0,0 +1,15 @@ +# @configure_input@ + +# Doxyfile 1.8.10 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# ... + +PROJECT_NAME = "@PACKAGE@" +PROJECT_NUMBER = @PACKAGE_VERSION@ +INPUT = @abs_top_srcdir@ +OUTPUT_DIRECTORY = doxygen +QUIET = YES + +# ... -- GitLab