* Build the documentation the autotools way. If doxygen is not present, then do nothing.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
diff --git a/configure.ac b/configure.ac
index 0e99ac4..e1646b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,10 +38,8 @@ AC_CHECK_FUNCS([memset])
AC_PROG_INSTALL
-AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen])
-if test -z "$DOXYGEN" ; then
- DOXYGEN=:
-fi
+AC_PATH_PROG(DOXYGEN, doxygen, no)
+AM_CONDITIONAL(HAVE_DOXYGEN, test "$DOXYGEN" != "no")
AC_CONFIG_FILES([
ftgl.pc
diff --git a/docs/Makefile.am b/docs/Makefile.am
index dbf2128..8b864cc 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1,20 +1,32 @@
-DOXYFILE = ftgl_dox
-DOCDIRS = html
+if HAVE_DOXYGEN
+htmldocdir = $(datadir)/doc/ftgl/html
+htmldoc_DATA = html/doxygen.css
+endif
-all: doc
-
-doc: doc-stamp
-doc-stamp: $(DOXYFILE)
- sed 's,^INPUT[ ].*,INPUT=../../src,' $^ | $(DOXYGEN) -
+html/doxygen.css: doc-stamp
+doc-stamp: ftgl_dox
+ $(DOXYGEN) $^
touch $@
-install-data-local: doc
- $(INSTALL) -d -m 0755 $(DESTDIR)$(datadir)/doc/$(PACKAGE_NAME)/html
- $(INSTALL) -m 0644 html/* $(DESTDIR)$(datadir)/doc/$(PACKAGE_NAME)/html/
-
-distclean-local:
- $(RM) -r $(DOCDIRS)
+clean: clean-local
+clean-local:
+ $(RM) -rf html
$(RM) doc-stamp
-.PHONY: all doc
+if HAVE_DOXYGEN
+install-data-local: html/doxygen.css
+ $(mkinstalldirs) $(DESTDIR)$(datadir)/doc/$(PACKAGE_NAME)/html
+ $(INSTALL) -m 0644 \
+ `find html -name '*.html' -o -name '*.gif' -o -name '*.png'` \
+ $(DESTDIR)$(datadir)/doc/$(PACKAGE_NAME)/html/
+endif
+
+EXTRA_DIST = \
+ ftgl_dox \
+ FTGL.html \
+ FTGL_1_3.gif \
+ images/ftgldemo.jpg \
+ images/metrics.png \
+ html.tar.gz \
+ $(NULL)