mainpage.txt \
        ${MAN3} \
        data/m17n-config.txt data/m17n-db.txt data/exprog.txt \
-       data/dbformat.txt data/dbdata.txt fdl.txt
+       data/dbformat.txt data/dbdata.txt data/dbtutorial.txt fdl.txt
 
 DBDATA = $(shell echo @M17NDB@/*.{dir,mim,flt,fst,tbl})
 DBIMAGE = $(shell echo images/*.png images/*.eps)
        @AWK@ -f utils/dbdata.awk @M17NDB@/mdb.dir > $@
 
 data/dbformat.txt: ${DBFORMAT} utils/dbformat.sh
-       utils/dbformat.sh ${DBFORMAT}/*.txt > $@
+       utils/dbformat.sh ${DBFORMAT} > $@
+
+data/dbtutorial.txt: ${DBFORMAT} utils/dbtutorial.sh
+       utils/dbtutorial.sh ${DBFORMAT} > $@
 
 data/m17n-config.txt: @M17NLIB@/m17n-config.in
        sed -n -e '/\/\*\*\*/,/\*\// p' < $< > $@
 
 <ul>
 EOF
 
-for f in $*; do
+for f in $1/*.txt; do
   case $f in
   *.ja.txt) ;;
+  *-tut.txt) ;;
   *) cat $f | grep '@page' | sed -e 's/@page mdb\([^ ]*\)/<li> @ref mdb\1 "\1" --/';;
   esac
 done
 <ul>
 EOF
 
-for f in $*; do
+for f in $1/*.txt; do
   case $f in
+  *-tut.txt) ;;
   *.ja.txt) cat $f | grep '@page' | sed -e 's/@page mdb\([^ ]*\)/<li> @ref mdb\1 "\1" --/';;
   *) ;;
   esac
 */
 EOF
 
-cat $* | \
+
+for f in $1/*.txt; do
+  case $f in
+  *-tut.txt) ;;
+  *) cat $f | \
 sed -n -e '/\/\*\*\*/,/\*\// p' | \
 sed -e 's/@section/@subsection/' \
-    -e 's/@page/@section/'
+    -e 's/@page/@section/';;
+  esac
+done
 
 # Local Variables:
 # coding: euc-jp
 
--- /dev/null
+#!/bin/sh
+
+cat <<EOF
+/* -*- coding: utf-8; -*- */
+/*** @page m17nDBTutorial Tutorial for writing the m17n database
+
+This section contains tutorials for writing various database files of
+the m17n database.
+
+<ul>
+EOF
+
+for f in $1/*-tut.txt; do
+  cat $f | grep '@page' | sed -e 's/@page mdb\([^ ]*\)/<li> @ref mdb\1 "\1" --/'
+done
+
+cat <<EOF
+</ul>
+*/
+EOF
+
+for f in $1/*-tut.txt; do
+  sed -n -e '/\/\*\*\*/,/\*\// p' < $f| \
+  sed -e 's/@section/@subsection/' -e 's/@page/@section/' \
+      -e 's,\[\[,<span class="fragment">,g' -e 's,\]\],</span>,g' \
+      -e 's,<<,<span class="fragment">\<,g' -e 's,>>,\></span>,g'
+done
+
+# Local Variables:
+# coding: euc-jp
+# End: