[gtkmm-documentation] Distribute generated HTML files of the tutorial
- From: Daniel Elstner <daniel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation] Distribute generated HTML files of the tutorial
- Date: Sun, 23 Aug 2009 16:42:57 +0000 (UTC)
commit ae1af8ec1fc9ca098de291cbdf4348c188eb4554
Author: Daniel Elstner <daniel kitta gmail com>
Date: Sun Aug 23 12:06:29 2009 +0200
Distribute generated HTML files of the tutorial
* configure.ac (AC_CONFIG_FILES): Remove output files docs/Makefile,
docs/images/Makefile and docs/tutorial/icons/Makefile from the list.
* Makefile.am (doc_subdirs): Recurse directly into the docs/FAQ/
and docs/tutorial/ subdirectories, skipping docs/.
(dist_images_DATA): Distribute and install image files in the
docs/images/ subdirectory from here.
* docs/tutorial/Makefile.am (SUBDIRS): Do not recurse into icons/.
(vpath_listall): Copy VPATH listing function from doc-reference.am
in mm-common.
(DISTCLEANFILES): Only clean generated HTML files.
(MAINTAINERCLEANFILES): Clean distributed HTML in the source tree.
(dist_noinst_DATA): Distribute generated HTML.
(tutorial_figures_DATA): Use Automake constructs to install the
figures into a subdirectory of the HTML installation directory.
The distribution is taken care of by gnome-doc-utils.make.
(dist_tutorial_icons_DATA): Likewise for the icons, but distribute
them via Automake as well.
(install-tutorial): Simplify and cut down on shell commands. Use
GNU make features to produce the list of files at the make level.
Only install the HTML files and style.css manually.
(uninstall-tutorial): Simplify. Limit the deletion to HTML files
and style.css.
(html/index.html): Remove dependency on Makefile.am, mainly because
it is not consistent with the behavior of other targets or modules.
(html/%): Declare html/index.html as order-only prerequisite of any
file in the html/ subdirectory.
(all-local): Remove target.
(pdf), (post-html), (doc-clean): Disable targets for now.
* docs{,/images,/tutorial/icons}/Makefile.am: Delete obsolete files.
ChangeLog | 34 +++++
Makefile.am | 6 +-
configure.ac | 5 +-
docs/Makefile.am | 31 -----
docs/images/Makefile.am | 16 ---
docs/tutorial/Makefile.am | 263 +++++++++++++++++++++++---------------
docs/tutorial/icons/Makefile.am | 8 --
7 files changed, 199 insertions(+), 164 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index df44057..069f5b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2009-08-23 Daniel Elstner <daniel kitta gmail com>
+
+ Distribute generated HTML files of the tutorial
+
+ * configure.ac (AC_CONFIG_FILES): Remove output files docs/Makefile,
+ docs/images/Makefile and docs/tutorial/icons/Makefile from the list.
+ * Makefile.am (doc_subdirs): Recurse directly into the docs/FAQ/
+ and docs/tutorial/ subdirectories, skipping docs/.
+ (dist_images_DATA): Distribute and install image files in the
+ docs/images/ subdirectory from here.
+ * docs/tutorial/Makefile.am (SUBDIRS): Do not recurse into icons/.
+ (vpath_listall): Copy VPATH listing function from doc-reference.am
+ in mm-common.
+ (DISTCLEANFILES): Only clean generated HTML files.
+ (MAINTAINERCLEANFILES): Clean distributed HTML in the source tree.
+ (dist_noinst_DATA): Distribute generated HTML.
+ (tutorial_figures_DATA): Use Automake constructs to install the
+ figures into a subdirectory of the HTML installation directory.
+ The distribution is taken care of by gnome-doc-utils.make.
+ (dist_tutorial_icons_DATA): Likewise for the icons, but distribute
+ them via Automake as well.
+ (install-tutorial): Simplify and cut down on shell commands. Use
+ GNU make features to produce the list of files at the make level.
+ Only install the HTML files and style.css manually.
+ (uninstall-tutorial): Simplify. Limit the deletion to HTML files
+ and style.css.
+ (html/index.html): Remove dependency on Makefile.am, mainly because
+ it is not consistent with the behavior of other targets or modules.
+ (html/%): Declare html/index.html as order-only prerequisite of any
+ file in the html/ subdirectory.
+ (all-local): Remove target.
+ (pdf), (post-html), (doc-clean): Disable targets for now.
+ * docs{,/images,/tutorial/icons}/Makefile.am: Delete obsolete files.
+
2009-08-21 Daniel Elstner <daniel kitta gmail com>
Get tutorial build to distcheck correctly
diff --git a/Makefile.am b/Makefile.am
index 591176b..020212b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,11 +4,15 @@ ACLOCAL_AMFLAGS = -I build ${ACLOCAL_FLAGS}
DISTCHECK_CONFIGURE_FLAGS = --enable-warnings=fatal
if HAVE_GNOME_DOC_UTILS
-doc_subdirs = docs
+doc_subdirs = docs/FAQ docs/tutorial
else
doc_subdirs =
endif
SUBDIRS = examples $(doc_subdirs)
+gtkmm_docdir = $(datadir)/doc/gtkmm-2.4
+imagesdir = $(gtkmm_docdir)/images
+dist_images_DATA = docs/images/gtkmm_logo.gif docs/images/top.gif
+
dist_noinst_DATA = COPYING.examples README.SUN
dist_noinst_SCRIPTS = autogen.sh
diff --git a/configure.ac b/configure.ac
index 47af08b..3149c14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,9 +34,6 @@ GNOME_DOC_INIT([0.9.0],,
AC_CONFIG_FILES([Makefile
examples/Makefile
- docs/Makefile
docs/FAQ/Makefile
- docs/images/Makefile
- docs/tutorial/Makefile
- docs/tutorial/icons/Makefile])
+ docs/tutorial/Makefile])
AC_OUTPUT
diff --git a/docs/tutorial/Makefile.am b/docs/tutorial/Makefile.am
index 6567e80..f251bbd 100644
--- a/docs/tutorial/Makefile.am
+++ b/docs/tutorial/Makefile.am
@@ -2,82 +2,170 @@ include $(top_srcdir)/docs/Makefile_web.am_fragment
gtkmm_tut_path = $(web_path_docs)tutorial
-SUBDIRS = icons
-
DOCBOOK_PHPWEBNOTES_TRANSFORM = docbook_phpwebnotes.xsl
-EXTRA_DIST = README insert_example_code.pl C/gtkmm-tut.xml C/gtkmm-tut-with-examples.xml style.css $(DOCBOOK_PHPWEBNOTES_TRANSFORM)
+# Function: $(call vpath_listall,PATTERN ...)
+# Get all filenames which match a PATTERN from the list. Look for files
+# relative to either the current directory or $(srcdir). Strip $(srcdir)/
+# again before returning and remove any duplicates.
+vpath_srclist = $(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/,$(1))))
+vpath_listall = $(sort $(wildcard $(1)) $(if $(srcdir:.=),$(vpath_srclist)))
+
+EXTRA_DIST = README insert_example_code.pl C/gtkmm-tut.xml C/gtkmm-tut-with-examples.xml $(DOCBOOK_PHPWEBNOTES_TRANSFORM)
DOCBOOK_STYLESHEET ?= http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
XMLLINT = xmllint
XSLTPROC = xsltproc
DB2PDF = docbook2pdf
-# Create a DocBook source file that doesn't have the examples' comments blocks:
-C/gtkmm-tut-with-examples.xml: C/gtkmm-tut.xml insert_example_code.pl
- $(PERL) $(srcdir)/insert_example_code.pl $(top_srcdir)/examples/book $< >$@
-
-
include $(top_srcdir)/build/gnome-doc-utils.make
+
dist-hook: doc-dist-hook
DOC_MODULE = gtkmm-tut-with-examples
DOC_ENTITIES =
DOC_INCLUDES =
-DOC_FIGURES = \
- figures/alignment.png figures/aspectframe.png \
- figures/box_packing1.png figures/box_packing2.png figures/box_packing3.png \
- figures/buttonbox.png figures/buttons.png figures/checkbutton.png \
- figures/clipboard_simple.png figures/clipboard_ideal.png \
- figures/combo.png figures/combobox_complex.png figures/combobox_text.png figures/comboboxentry_complex.png figures/comboboxentry_text.png figures/custom_container.png \
- figures/dialogs_about.png figures/dialogs_colorselectiondialog.png figures/dialogs_filechooser.png figures/dialogs_fontselectiondialog.png \
- figures/dialogs_messagedialog.png figures/dialogs_simple.png \
- figures/drag_and_drop.png figures/drawingarea_arcs.png figures/drawingarea_curve.png figures/drawingarea_lines.png figures/drawingarea_text.png \
- figures/entry.png figures/eventbox.png figures/expander.png figures/filechooserbutton.png figures/frame.png \
- figures/helloworld.png figures/helloworld2.png figures/idle.png figures/label.png \
- figures/main_menu.png figures/menu_popup.png \
- figures/menus_menubar.png figures/menus_menu.png figures/menus_and_toolbars.png \
- figures/notebook.png \
- figures/paned.png printing.png figures/progressbar.png figures/radiobuttons.png \
- figures/range_widgets.png figures/recentchooserdialog.png \
- figures/scrolledwindow.png figures/socket.png socket-fail.png figures/spinbutton.png \
- figures/table.png toolbar.png figures/textview.png \
- figures/treeview_list.png figures/treeview_tree.png figures/treeview_editablecells.png figures/treeview_combo_renderer.png \
- figures/treeview_draganddrop.png figures/treeview_popup.png \
- figures/devcpp_project_options.png figures/cairo_clock.png figures/cairo_joins.png \
- figures/update_ui.png
+DOC_FIGURES = \
+ figures/alignment.png \
+ figures/aspectframe.png \
+ figures/box_packing1.png \
+ figures/box_packing2.png \
+ figures/box_packing3.png \
+ figures/buttonbox.png \
+ figures/buttons.png \
+ figures/cairo_clock.png \
+ figures/cairo_joins.png \
+ figures/checkbutton.png \
+ figures/clipboard_ideal.png \
+ figures/clipboard_simple.png \
+ figures/combo.png \
+ figures/combobox_complex.png \
+ figures/combobox_text.png \
+ figures/comboboxentry_complex.png \
+ figures/comboboxentry_text.png \
+ figures/custom_container.png \
+ figures/dialogs_about.png \
+ figures/dialogs_colorselectiondialog.png\
+ figures/dialogs_filechooser.png \
+ figures/dialogs_fontselectiondialog.png \
+ figures/dialogs_messagedialog.png \
+ figures/dialogs_simple.png \
+ figures/drag_and_drop.png \
+ figures/drawingarea_arcs.png \
+ figures/drawingarea_curve.png \
+ figures/drawingarea_lines.png \
+ figures/drawingarea_text.png \
+ figures/entry.png \
+ figures/eventbox.png \
+ figures/expander.png \
+ figures/filechooserbutton.png \
+ figures/frame.png \
+ figures/helloworld.png \
+ figures/helloworld2.png \
+ figures/idle.png \
+ figures/label.png \
+ figures/main_menu.png \
+ figures/menu_popup.png \
+ figures/menus_and_toolbars.png \
+ figures/menus_menu.png \
+ figures/menus_menubar.png \
+ figures/notebook.png \
+ figures/paned.png \
+ figures/printing.png \
+ figures/progressbar.png \
+ figures/radiobuttons.png \
+ figures/range_widgets.png \
+ figures/recentchooserdialog.png \
+ figures/scrolledwindow.png \
+ figures/socket-fail.png \
+ figures/socket.png \
+ figures/spinbutton.png \
+ figures/table.png \
+ figures/textview.png \
+ figures/toolbar.png \
+ figures/treeview_combo_renderer.png \
+ figures/treeview_draganddrop.png \
+ figures/treeview_editablecells.png \
+ figures/treeview_list.png \
+ figures/treeview_popup.png \
+ figures/treeview_tree.png \
+ figures/update_ui.png
DOC_LINGUAS = de
-DISTCLEANFILES = html/figures/*.png html/icons/*.png html/*.css html/*.html
+DISTCLEANFILES = html/*.html
+MAINTAINERCLEANFILES = $(srcdir)/html/*.html
+
+xslt_params = $(strip \
+ --param toc.section.depth 1 \
+ --stringparam html.stylesheet 'style.css' \
+ --stringparam admon.graphics '1' \
+ --stringparam admon.graphics.path 'icons/' \
+ --stringparam admon.graphics.extension '.png' \
+ --stringparam chunker.output.indent 'yes' \
+ --stringparam chunker.output.encoding 'UTF-8' \
+ --stringparam navig.graphics 'yes' \
+ --stringparam navig.graphics.extension '.png' \
+ --stringparam navig.graphics.path 'icons/' \
+ --stringparam toc.list.type 'ul' \
+ --stringparam use.id.as.filename '1' \
+ )
+
+tutorialdir = $(gtkmm_docdir)/tutorial
+tutorial_htmldir = $(tutorialdir)/html
+tutorial_figuresdir = $(tutorialdir)/figures
+tutorial_iconsdir = $(tutorialdir)/icons
+
+tutorial_html_files = $(call vpath_listall,html/*.html) style.css
+tutorial_html_inst = $(foreach\
+ file,$(tutorial_html_files),$(or $(wildcard $(file)),$(srcdir)/$(file)))
+
+dist_noinst_DATA = $(tutorial_html_files)
+
+tutorial_figures_DATA = $(addprefix C/,$(DOC_FIGURES))
+dist_tutorial_icons_DATA = \
+ icons/caution.png \
+ icons/home.png \
+ icons/important.png \
+ icons/next.png \
+ icons/note.png \
+ icons/prev.png \
+ icons/tip.png \
+ icons/up.png \
+ icons/warning.png
+
+install-data-local: install-tutorial
+
+uninstall-local: uninstall-tutorial
+
+install-tutorial: html/index.html
+ @$(NORMAL_INSTALL)
+ $(MKDIR_P) '$(DESTDIR)$(tutorial_htmldir)'
+ $(INSTALL_DATA) $(tutorial_html_inst) '$(DESTDIR)$(tutorial_htmldir)/'
+
+uninstall-tutorial:
+ @$(NORMAL_UNINSTALL)
+ rm -f '$(DESTDIR)$(tutorial_htmldir)'/*.html
+ rm -f '$(DESTDIR)$(tutorial_htmldir)/style.css'
+ -test ! -r '$(DESTDIR)$(tutorial_htmldir)' || rmdir '$(DESTDIR)$(tutorial_htmldir)'
# Create a html generation of the C locale's version of the DocBook,
# using our custom stylesheet and graphics:
# Set the use.id.as.filename param so that we don't use the chapter / section
# number as the filename, otherwise the url will change every time anything is
# re-ordered or inserted in the documentation
-html/index.html: C/gtkmm-tut-with-examples.xml Makefile.am
+html/index.html: C/gtkmm-tut-with-examples.xml
rm -fr html
- $(MKDIR_P) html/figures
- $(MKDIR_P) html/icons
- cp -f $(srcdir)/style.css html/style.css
- cp -f $(srcdir)/C/figures/*.png html/figures/
- cp -f $(srcdir)/icons/*.png html/icons/
- $(XSLTPROC) \
- --param toc.section.depth 1 \
- --stringparam html.stylesheet "style.css" \
- --stringparam admon.graphics 1 \
- --stringparam admon.graphics.path "icons/" \
- --stringparam admon.graphics.extension ".png" \
- --stringparam chunker.output.indent yes \
- --stringparam chunker.output.encoding UTF-8 \
- --stringparam navig.graphics yes \
- --stringparam navig.graphics.extension ".png" \
- --stringparam navig.graphics.path "icons/" \
- --stringparam toc.list.type "ul" \
- --stringparam use.id.as.filename "1" \
- -o html/ --xinclude --catalogs $(DOCBOOK_STYLESHEET) \
- $<
+ $(MKDIR_P) html
+ $(XSLTPROC) $(xslt_params) -o html/ --xinclude --catalogs '$(DOCBOOK_STYLESHEET)' $<
+
+# Make sure that the documentation will always have been generated before
+# executing the commands of a rule that depends on files in html/.
+html/%: | html/index.html
+
+# Create a DocBook source file that doesn't have the examples' comments blocks:
+C/gtkmm-tut-with-examples.xml: C/gtkmm-tut.xml $(srcdir)/insert_example_code.pl
+ $(PERL) -- $(srcdir)/insert_example_code.pl $(top_srcdir)/examples/book $< >$@
validate_original: C/gtkmm-tut.xml
$(XMLLINT) --xinclude --postvalid --noout $<
@@ -85,69 +173,36 @@ validate_original: C/gtkmm-tut.xml
validate: C/gtkmm-tut-with-examples.xml
$(XMLLINT) --xinclude --postvalid --noout $<
-gtkmm-tut-html.tar.gz: html/index.html
- tar cf - C/figures html | gzip -c --best >$@
+#gtkmm-tut-html.tar.gz: html/index.html
+# tar cf - C/figures html | gzip -c --best >$@
-post-html: html/index.html html/style.css pdf
- rsync $(rsync_args) C/figures/*.png $$USER $(web_host):$(gtkmm_tut_path)/figures/
- rsync $(rsync_args) icons/*.png $$USER $(web_host):$(gtkmm_tut_path)/icons/
- rsync $(rsync_args) -r html/ $$USER $(web_host):$(gtkmm_tut_path)/html/
- rsync $(rsync_args) *.css $$USER $(web_host):$(gtkmm_tut_path)/html/
- rsync $(rsync_args) -r pdf/ $$USER $(web_host):$(gtkmm_tut_path)/pdf/
+#post-html: html/index.html html/style.css pdf
+# rsync $(rsync_args) C/figures/*.png $$USER $(web_host):$(gtkmm_tut_path)/figures/
+# rsync $(rsync_args) icons/*.png $$USER $(web_host):$(gtkmm_tut_path)/icons/
+# rsync $(rsync_args) -r html/ $$USER $(web_host):$(gtkmm_tut_path)/html/
+# rsync $(rsync_args) *.css $$USER $(web_host):$(gtkmm_tut_path)/html/
+# rsync $(rsync_args) -r pdf/ $$USER $(web_host):$(gtkmm_tut_path)/pdf/
# we need to produce a full examples with all of the XIncludes done so that it
# can processed for PDF
-C/programming-with-gtkmm-pdf.xml: C/gtkmm-tut-with-examples.xml html/index.html
+C/programming-with-gtkmm-pdf.xml: C/gtkmm-tut-with-examples.xml
$(XMLLINT) --xinclude --postvalid $< -o $@
# We have to generate the pdf in a subdirectory (e.g. pdf/) because the tutorial
# specifies the path to the figures as '../figures' so if we build it in this
# directory, it won't find the images.
pdf/programming-with-gtkmm-pdf.pdf: C/programming-with-gtkmm-pdf.xml
- $(DB2PDF) --output pdf $<
-
-pdf : pdf/programming-with-gtkmm-pdf.pdf
+ $(MKDIR_P) pdf
+ $(DB2PDF) --output pdf/ $<
-doc-clean:
- -rm -f C/gtkmm-tut-with-examples.xml gtkmm-tut-html.tar.gz C/programming-with-gtkmm-pdf.xml
- -rm -rf pdf
-
-tutorialdir = $(gtkmm_docdir)/tutorial/html
-
-install-tutorial: html/index.html
- @$(NORMAL_INSTALL)
- $(MKDIR_P) "$(DESTDIR)$(tutorialdir)/icons"
- $(MKDIR_P) "$(DESTDIR)$(tutorialdir)/figures"
- @dir='$(<D)'; for p in $$dir/*.css $$dir/*.html ; do \
- f=`echo "$$p" | sed -e 's|^.*/||'`; \
- echo " $(INSTALL_DATA) $$p $(DESTDIR)$(tutorialdir)/$$f"; \
- $(INSTALL_DATA) "$$p" "$(DESTDIR)$(tutorialdir)/$$f"; \
- done
- @dir='$(<D)/icons'; for p in $$dir/*.png ; do \
- f=`echo "$$p" | sed -e 's|^.*/||'`; \
- echo " $(INSTALL_DATA) $$p $(DESTDIR)$(tutorialdir)/icons/$$f"; \
- $(INSTALL_DATA) "$$p" "$(DESTDIR)$(tutorialdir)/icons/$$f"; \
- done
- @dir='$(<D)/figures'; for p in $$dir/*.png ; do \
- f=`echo "$$p" | sed -e 's|^.*/||'`; \
- echo " $(INSTALL_DATA) $$p $(DESTDIR)$(tutorialdir)/figures/$$f"; \
- $(INSTALL_DATA) "$$p" "$(DESTDIR)$(tutorialdir)/figures/$$"; \
- done
+#pdf: pdf/programming-with-gtkmm-pdf.pdf
-uninstall-tutorial:
- @$(NORMAL_UNINSTALL)
- (cd '$(DESTDIR)$(tutorialdir)' 2>/dev/null || exit 0; \
- find . -type f \( -name '*.html' -o -name '*.css' -o -name '*.png' \) -exec rm -f '{}' '+')
- -test ! -r '$(DESTDIR)$(tutorialdir)/icons' || rmdir '$(DESTDIR)$(tutorialdir)/icons'
- -test ! -r '$(DESTDIR)$(tutorialdir)/figures' || rmdir '$(DESTDIR)$(tutorialdir)/figures'
- -test ! -r '$(DESTDIR)$(tutorialdir)' || rmdir '$(DESTDIR)$(tutorialdir)'
-
-all-local: html/index.html
-
-install-data-local: install-tutorial
-
-uninstall-local: uninstall-tutorial
+#doc-clean:
+# -rm -f C/gtkmm-tut-with-examples.xml gtkmm-tut-html.tar.gz C/programming-with-gtkmm-pdf.xml
+# -rm -rf pdf
-maintainer-clean-local: doc-clean
+.PHONY: install-tutorial uninstall-tutorial
-.PHONY: post-html doc-clean install-tutorial uninstall-tutorial
+# Instruct GNU make to delete the targets of a rule after it failed, in
+# order to avoid the complication of handling that situation manually.
+.DELETE_ON_ERROR:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]