[cheese/build-system-rewrite: 6/8] Convert documentation to build non-recursively



commit daa4a571d052bfb73e8fee8b1d2d4f356125fc29
Author: David King <amigadave amigadave com>
Date:   Sun Oct 16 14:34:43 2011 +0200

    Convert documentation to build non-recursively

 Makefile.am                   |   36 ++++++++++++++++++++++++++++++++++--
 configure.ac                  |    1 -
 docs/reference/Makefile.am    |   13 ++++++-------
 docs/reference/version.xml.in |    2 +-
 4 files changed, 41 insertions(+), 11 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index c3b99c5..600e9fa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
-SUBDIRS = src po help docs
+SUBDIRS = src po help
 
 marshal_data = \
 	libcheese/cheese-marshal.c \
@@ -330,12 +330,42 @@ dist_pixmaps_DATA = \
 	data/pixmaps/cheese-2.svg \
 	data/pixmaps/cheese-3.svg
 
+# gtk-doc
+gtkdoc_builddir = $(top_builddir)/docs/reference
+gtkdoc_distdir = $(top_distdir)/docs/reference
+gtkdoc_srcdir = $(top_srcdir)/docs/reference
+
+all-local: $(bin_PROGRAMS)
+	cd $(gtkdoc_builddir) && $(MAKE) $(AM_MAKEFLAGS) all
+clean-local:
+	cd $(gtkdoc_builddir) && $(MAKE) $(AM_MAKEFLAGS) clean
+distclean-local:
+	cd $(gtkdoc_builddir) && $(MAKE) $(AM_MAKEFLAGS) distclean
+docs: $(lib_LTLIBRARIES)
+	cd $(gtkdoc_builddir) && $(MAKE) $(AM_MAKEFLAGS) docs
+install-data-local:
+	cd $(gtkdoc_builddir) && $(MAKE) $(AM_MAKEFLAGS) install-data
+uninstall-local:
+	cd $(gtkdoc_builddir) && $(MAKE) $(AM_MAKEFLAGS) uninstall
+
+dist-hook: git-changelog-hook
+	$(MKDIR_P) $(gtkdoc_distdir)
+	cp $(gtkdoc_srcdir)/Makefile.am $(gtkdoc_srcdir)/Makefile.in $(gtkdoc_distdir)
+	cd $(gtkdoc_builddir) && $(MAKE) $(AM_MAKEFLAGS) \
+	  distdir="../../$(gtkdoc_distdir)" \
+	  top_distdir="../../$(top_distdir)" \
+	  dist-hook
+
 dist_noinst_DATA = \
 	build-aux/gnome-doc-utils.make \
 	ChangeLog.pre-git \
 	$(desktop_in_files) \
 	$(gsettings_in_file) \
 	$(service_in_files) \
+	$(gtkdoc_srcdir)/cheese-docs.xml \
+	$(gtkdoc_srcdir)/cheese-sections.txt \
+	$(gtkdoc_srcdir)/version.xml.in \
+	gtk-doc.make \
 	intltool-extract.in \
 	intltool-merge.in \
 	intltool-update.in \
@@ -383,7 +413,7 @@ DISTCHECK_CONFIGURE_FLAGS = --disable-schemas-install --disable-scrollkeeper --e
 
 CHANGELOG_START = 2.26.0
 
-dist-hook:
+git-changelog-hook:
 	$(AM_V_at)if test -d "$(srcdir)/.git"; \
 	then \
 		echo Creating ChangeLog && \
@@ -398,3 +428,5 @@ dist-hook:
 	else \
 		echo A git clone is required to generate a ChangeLog >&2; \
 	fi
+
+.PHONY: docs
diff --git a/configure.ac b/configure.ac
index a5867db..595cb4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -170,7 +170,6 @@ GLIB_GSETTINGS
 
 AC_CONFIG_FILES([
 Makefile
-docs/Makefile
 docs/reference/Makefile
 docs/reference/version.xml
 data/cheese.pc
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 4e5940c..d03c282 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -18,18 +18,18 @@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
 # gtk-doc will search all .c & .h files beneath here for inline comments
 # documenting the functions and macros.
 # e.g. DOC_SOURCE_DIR=../../../gtk
-DOC_SOURCE_DIR=../../libcheese
+DOC_SOURCE_DIR=$(top_srcdir)/libcheese
 
 # Extra options to pass to gtkdoc-scangobj. Not normally needed.
 SCANGOBJ_OPTIONS=
 
 # Extra options to supply to gtkdoc-scan.
 # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" 
-SCAN_OPTIONS=--rebuild-types
+SCAN_OPTIONS=--source-dir=$(top_srcdir)/libcheese --rebuild-types
 
 # Extra options to supply to gtkdoc-mkdb.
 # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
-MKDB_OPTIONS=--sgml-mode --output-format=xml --name-space=cheese
+MKDB_OPTIONS=--source-dir=$(top_srcdir)/libcheese --sgml-mode --output-format=xml --name-space=cheese
 
 # Extra options to supply to gtkdoc-mktmpl
 # e.g. MKTMPL_OPTIONS=--only-section-tmpl
@@ -57,7 +57,7 @@ IGNORE_HFILES=					\
 	cheese-fileutil.h			\
 	cheese-flash.h				\
 	cheese-widget-private.h			\
-	cheese-enum-types.h                     \
+	cheese-enums.h \
 	um-crop-area.h
 
 # Images to copy into HTML directory.
@@ -81,15 +81,14 @@ expand_content_files=
 AM_CPPFLAGS=-I$(top_srcdir) -I$(top_builddir) $(CHEESE_CFLAGS)
 GTKDOC_LIBS=\
 	$(CHEESE_LIBS) \
-	$(top_builddir)/libcheese/libcheese.la \
-	$(top_builddir)/libcheese/libcheese-gtk.la
+	$(top_builddir)/libcheese.la \
+	$(top_builddir)/libcheese-gtk.la
 
 # This includes the standard gtk-doc make rules, copied by gtkdocize.
 include $(top_srcdir)/gtk-doc.make
 
 # Other files to distribute
 # e.g. EXTRA_DIST += version.xml.in
-EXTRA_DIST += version.xml.in
 
 #if ENABLE_GTK_DOC
 #TESTS_ENVIRONMENT = cd $(srcdir) &&
diff --git a/docs/reference/version.xml.in b/docs/reference/version.xml.in
index d78bda9..a24f987 100644
--- a/docs/reference/version.xml.in
+++ b/docs/reference/version.xml.in
@@ -1 +1 @@
- VERSION@
+ PACKAGE_VERSION@



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]