-# To allow "make distcheck" to succeed, lib-version.texi must either
-# be cleaned or be included in the distribution. Or both - and in
-# fact both are good. There's no point forcing a distribution build
-# to regenerate lib-version.texi, because it can't possibly be
-# different on the build machine than where the distribution was
-# generated, so we might as well include it in the distribution.
-EXTRA_DIST += lib-version.texi
-# But when we want to get back to a clean tree, lib-version.texi
-# should be cleaned.
-CLEANFILES = lib-version.texi
+# Support for snarfing docs out of Scheme modules.
+snarf_doc = standard-library
+
+$(snarf_doc).am: $(snarf_doc).scm
+ GUILE_AUTO_COMPILE=0 ; \
+ variable="`echo $(snarf_doc) | tr - _`_scm_files" ; \
+ "$(top_builddir_absolute)/meta/guile" -l "$(srcdir)/$(snarf_doc).scm" \
+ -c " \
+ (format #t \"# Automatically generated, do not edit.~%\") \
+ (format #t \"$$variable = \") \
+ (for-each (lambda (m) \
+ (format #t \"$$""(top_srcdir)/module/~a.scm \" \
+ (string-join (map symbol->string m) \"/\"))) \
+ (map car *modules*))" > "$@.tmp"
+ mv "$@.tmp" "$@"
+
+# The following line leads to the definition of $(standard_library_scm_files).
+include standard-library.am
+
+$(snarf_doc).texi: $(standard_library_scm_files)
+ GUILE_AUTO_COMPILE=0 \
+ "$(top_builddir_absolute)/meta/guile" "$(srcdir)/make-texinfo.scm" \
+ "$(abs_srcdir)/$(snarf_doc).scm" > "$@.tmp"
+ mv "$@.tmp" "$@"
+
+DISTCLEANFILES = $(snarf_doc).texi
+EXTRA_DIST += $(snarf_doc).scm make-texinfo.scm $(snarf_doc).texi $(snarf_doc).am
+
+
+www-commit: html
+ cd guile.html; \
+ cvs -d :ext:cvs.sv.gnu.org:/web/guile \
+ import -m 'make www-commit in doc/ref' guile/docs/master/guile.html gnu \
+ $(shell date "+D%Y%m%d%H%M%S")