From 21e73c2597da30e6e5b0acb808cd27fb21e8bbbd Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 17 Aug 2011 19:33:06 +0200 Subject: [PATCH] Integrate doxygen documentation building into autoconf/automake process --- Makefile.am | 38 ++++++++++++++++++++++++++++++++++++++ configure.ac | 3 +++ doc/.empty | 0 3 files changed, 41 insertions(+) create mode 100644 doc/.empty diff --git a/Makefile.am b/Makefile.am index d7a8fb771..6cb39eaac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,3 +14,41 @@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version EXTRA_DIST = git-version-gen + +if HAVE_DOXYGEN + +docdir=$(datadir)/doc +pkgdocdir=$(docdir)/$(PACKAGE)-$(VERSION) +doc_htmldir=$(pkgdocdir)/html + +doc_html_DATA = $(top_builddir)/doc/html.tar + +$(doc_html_DATA): $(top_builddir)/doc/core/html/index.html \ + $(top_builddir)/doc/gsm/html/index.html \ + $(top_builddir)/doc/vty/html/index.html \ + $(top_builddir)/doc/codec/html/index.html + cd $(top_builddir)/doc && tar cf html.tar * + +$(top_builddir)/doc/core/html/index.html: $(SOURCES) Doxyfile + rm -rf doc/core + $(DOXYGEN) Doxyfile + +$(top_builddir)/doc/gsm/html/index.html: $(SOURCES) Doxyfile.gsm + rm -rf doc/gsm + $(DOXYGEN) Doxyfile.gsm + +$(top_builddir)/doc/vty/html/index.html: $(SOURCES) Doxyfile.vty + rm -rf doc/vty + $(DOXYGEN) Doxyfile.vty + +$(top_builddir)/doc/codec/html/index.html: $(SOURCES) Doxyfile.codec + rm -rf doc/vty + $(DOXYGEN) Doxyfile.codec + +install-data-hook: + cd $(DESTDIR)$(doc_htmldir) && tar xf html.tar && rm -f html.tar + +uninstall-hook: + cd $(DESTDIR)$(doc_htmldir) && rm -f * + +endif diff --git a/configure.ac b/configure.ac index b95c8cc0d..a77e3e89e 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,9 @@ dnl checks for header files AC_HEADER_STDC AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h) +AC_PATH_PROG(DOXYGEN,doxygen,false) +AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " diff --git a/doc/.empty b/doc/.empty new file mode 100644 index 000000000..e69de29bb