Add support for building doxygen API documentation
[platform/upstream/libxkbcommon.git] / Makefile.am
index 2f16144..26646fb 100644 (file)
@@ -98,6 +98,32 @@ src/ks_tables.h: $(top_builddir)/makekeys/makekeys$(EXEEXT)
 $(top_builddir)/makekeys/makekeys$(EXEEXT): $(top_srcdir)/makekeys/makekeys.c
        $(MAKE) -C makekeys
 
+# Documentation
+
+if ENABLE_DOCS
+if HAVE_DOXYGEN
+doc: doc/stamp-doxygen
+clean-doc: clean-doxygen
+all-local:: doc
+clean-local:: clean-doc
+
+doc/stamp-doxygen: $(top_srcdir)/xkbcommon/*.h
+       $(AM_V_GEN)$(DOXYGEN) doc/Doxyfile
+       touch $@
+
+clean-doxygen:
+       rm -rf doc/html doc/stamp-doxygen
+
+install-data-local:: doc
+       $(MKDIR_P) $(DESTDIR)$(htmldir)
+       $(INSTALL_DATA) doc/html/* $(DESTDIR)$(htmldir)
+
+uninstall-local::
+       rm -rf $(DESTDIR)$(htmldir)
+
+endif HAVE_DOXYGEN
+endif ENABLE_DOCS
+
 # Tests
 
 # Some tests need to use unexported symbols, so we link them against