build: change doxygen target to be properly dependency-based
authorRan Benita <ran234@gmail.com>
Fri, 28 Jul 2017 15:19:40 +0000 (18:19 +0300)
committerRan Benita <ran234@gmail.com>
Mon, 31 Jul 2017 12:55:48 +0000 (15:55 +0300)
This hackery (thanks libinput) is clearer and more precise than the
previous hackery.

Signed-off-by: Ran Benita <ran234@gmail.com>
Makefile.am
doc/.gitignore
doc/Doxyfile.in

index a22bd7a..d46481b 100644 (file)
@@ -149,18 +149,29 @@ src/xkbcomp/parser.h: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xk
 
 if ENABLE_DOCS
 if HAVE_DOXYGEN
-doc: doc/stamp-doxygen
+doxygen_input = \
+       $(top_srcdir)/README.md \
+       $(top_srcdir)/doc/quick-guide.md \
+       $(top_srcdir)/doc/compat.md \
+       $(top_srcdir)/xkbcommon/xkbcommon.h \
+       $(top_srcdir)/xkbcommon/xkbcommon-names.h \
+       $(top_srcdir)/xkbcommon/xkbcommon-x11.h \
+       $(top_srcdir)/xkbcommon/xkbcommon-compose.h
+
+doc/html: doc/Doxyfile $(doxygen_input)
+       $(AM_V_GEN)(\
+           cat $<; \
+           echo "INPUT = $(doxygen_input)"; \
+           echo "OUTPUT_DIRECTORY = $(abs_top_builddir)/doc"; \
+       ) | $(DOXYGEN) -
+clean-doxygen:
+       rm -rf doc/html
+
+doc: doc/html
 clean-doc: clean-doxygen
 all-local:: doc
 clean-local:: clean-doc
 
-doc/stamp-doxygen: $(top_srcdir)/xkbcommon/*.h
-       $(AM_V_GEN)(cd $(top_srcdir) && $(DOXYGEN) $(abs_top_builddir)/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)
index 3e70371..63b767d 100644 (file)
@@ -1,3 +1,2 @@
 Doxyfile
 html/
-stamp-doxygen
index 36d517d..04a2991 100644 (file)
@@ -2,8 +2,6 @@ PROJECT_NAME           = @PACKAGE_NAME@
 
 PROJECT_NUMBER         = @PACKAGE_VERSION@
 
-OUTPUT_DIRECTORY       = @abs_top_builddir@/doc
-
 BRIEF_MEMBER_DESC      = NO
 
 JAVADOC_AUTOBRIEF      = YES
@@ -18,13 +16,7 @@ QUIET                  = YES
 
 WARN_IF_UNDOCUMENTED   = NO
 
-INPUT                  = README.md \
-                         doc/quick-guide.md \
-                         doc/compat.md \
-                         xkbcommon/xkbcommon.h \
-                         xkbcommon/xkbcommon-names.h \
-                         xkbcommon/xkbcommon-x11.h \
-                         xkbcommon/xkbcommon-compose.h \
+INPUT                  = @INPUT@
 
 FILE_PATTERNS          = *.c \
                          *.h
@@ -40,7 +32,7 @@ ALPHABETICAL_INDEX     = NO
 IGNORE_PREFIX          = xkb_ \
                          XKB_
 
-HTML_EXTRA_STYLESHEET  = doc/doxygen-extra.css
+HTML_EXTRA_STYLESHEET  = @abs_top_srcdir@/doc/doxygen-extra.css
 
 HTML_TIMESTAMP         = NO