Index: p/src/kot/Makefile
===================================================================
--- app/src/kot/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
+++ 	(revision )
@@ -1,9 +1,0 @@
-
-kot:
-
-copy:
-ifdef UTT_BIN_DIR
-	cp kot ${UTT_BIN_DIR}
-endif
-
-clean:
Index: p/src/kot/kot
===================================================================
--- app/src/kot/kot	(revision 20b4e44e7537762f6aceb72b039f6e8f8a50e201)
+++ 	(revision )
@@ -1,102 +1,0 @@
-#!/usr/bin/perl
-
-#package:	UAM Text Tools
-#component:	kot
-#version:	1.0
-#author:	Tomasz Obrebski
-
-use strict;
-use Getopt::Long;
-use File::HomeDir;
-
-my $help=0;
-my $gap_fill="\n-----\n";
-my $spaces=0;
-
-my $systemconfigfile='/usr/local/etc/utt/kot.conf';
-#my $userconfigfile="$ENV{'HOME'}/.utt/kot.conf";
-my $userconfigfile=home()."/.utt/kot.conf";
-
-#read configuration files###########################
-my $file;
-foreach $file ($systemconfigfile, $userconfigfile){
-  if(open(CONFIG, $file)){
-  	while (<CONFIG>) {
-  		chomp;
-      		s/#.*//;
-	      	s/^\s+//;
-      		s/\s+$//;
-    		next unless length;
-    		my ($name, $value) = split(/\s*=\s*/, $_, 2);
-    		if(($name eq "gap-fill")or($name eq "g")){
-			$gap_fill=$value;
-    		}
-    		elsif(($name eq "spaces")or($name eq "s")){
-			$spaces=1;
-		}
-    		elsif(($name eq "help")or($name eq "h")){
-			$help=1;
-    		}
-
-	}
-  	close CONFIG;
-  }
-}
-#########################################################
-
-GetOptions("gap-fill|g=s" => \$gap_fill,
-	   "spaces|r" => \$spaces,
-	   "help|h" => \$help);
-
-if($help)
-{
-    print <<'END'
-Usage: ser [OPTIONS] [file ..]
-
-Options:
-   --gap-fill -g                  Help.
-   --spaces -r
-   --define=FILE                  Read macrodefinitions from FILE.
-   --flex-template=FILE           Read flex code template from FILE.
-   --only-matching -m		  Print only fragments matching PATTERN.
-   --flex                         Print only the generated flex code and exit.
-END
-;
-    exit 0;
-}
-
-
-$gap_fill =~ s/\\t/\t/g;
-$gap_fill =~ s/\\n/\n/g;
-$gap_fill =~ s/\\r/\r/g;
-$gap_fill =~ s/\\f/\f/g;
-
-my $prevend=-1;
-my $count=0;
-
-while(<>)
-{
-    my ($start,$len,$type,$form) = /^\s*(\d+)\s+(\d+)\s+(\S+)\s+(\S+)/;
-
-    if($start > $prevend)
-    {
-	print $gap_fill unless $count++ == 0;
-    }
-
-    $prevend=$start+$len;
-
-    next if $len==0;# || $form eq "*";
-
-    $form =~ s/\\\*/*/g;
-
-    if($type eq 'S' && ! $spaces)
-    {
-	$form =~ s/_/ /g;
-	$form =~ s/\\t/\t/g;
-	$form =~ s/\\n/\n/g;
-	$form =~ s/\\r/\r/g;
-	$form =~ s/\\f/\f/g;
-    }
-
-    print $form;
-}
Index: auto/output/Makefile
===================================================================
--- auto/output/Makefile	(revision e4cec26b9f4157c18cc9809b9570c3f2eb14cc03)
+++ auto/output/Makefile	(revision 3a2ae91d9423fabcf92fcfb2b04614a3c5a3696a)
@@ -46,27 +46,42 @@
 VPATH = ./src
 
-PROGRAMS = tok sen fla gph
+PROGRAMS = tok sen fla gph kot
 
 TOK_OBJ_FILES = tok.o tok_cmdline.o
 TOK_FLEX_FILES = tok.l
 TOK_GGO_FILES = tok_cmdline.ggo
+tok: \$(TOK_OBJ_FILES)
+tok.o: tok.c
 tok.o: tok_cmdline.h
+tok.c: tok.l
+tok_cmdline.o: tok_cmdline.c tok_cmdline.h
+tok_cmdline.c: tok_cmdline.ggo
+tok_cmdline.h: tok_cmdline.ggo
 
 SEN_OBJ_FILES = sen.o
 SEN_FLEX_FILES = sen.l
+sen: \$(SEN_OBJ_FILES)
+sen.o: sen.c
+sen.c: sen.l
 
 FLA_OBJ_FILES = fla.o
+fla: \$(FLA_OBJ_FILES)
+fla.o: fla.c
 
 GPH_PERL_FILES = gph.pl
+gph: \$(GPH_PERL_FILES)
+
+KOT_PERL_FILES = kot.pl
+kot: \$(KOT_PERL_FILES)
 
 CONFIG_FILES = src/config.h Makefile
 
 .SUFFIXES:
-.SUFFIXES: .l .y .h .c .o
+.SUFFIXES: .l .y .h .c .pl .o
 
-.INTERMEDIATE: \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
-.INTERMEDIATE: \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
-.INTERMEDIATE: \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
-.INTERMEDIATE: \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
+#.INTERMEDIATE: \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
+#.INTERMEDIATE: \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
+#.INTERMEDIATE: \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
+#.INTERMEDIATE: \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
 
 .PHONY: all
@@ -91,5 +106,7 @@
 	\$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
 	\$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
+	\$(RM) \$(SEN_OBJ_FILES)
 	\$(RM) \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
+	\$(RM) \$(FLA_OBJ_FILES)
 
 .PHONY: distclean
@@ -124,6 +141,4 @@
 	\$(CHMOD) a+x \$@
 
-tok: \$(TOK_OBJ_FILES)
-
 EOF
 
Index: src/kot.pl
===================================================================
--- src/kot.pl	(revision 3a2ae91d9423fabcf92fcfb2b04614a3c5a3696a)
+++ src/kot.pl	(revision 3a2ae91d9423fabcf92fcfb2b04614a3c5a3696a)
@@ -0,0 +1,102 @@
+#!/usr/bin/perl
+
+#package:	UAM Text Tools
+#component:	kot
+#version:	1.0
+#author:	Tomasz Obrebski
+
+use strict;
+use Getopt::Long;
+use File::HomeDir;
+
+my $help=0;
+my $gap_fill="\n-----\n";
+my $spaces=0;
+
+my $systemconfigfile='/usr/local/etc/utt/kot.conf';
+#my $userconfigfile="$ENV{'HOME'}/.utt/kot.conf";
+my $userconfigfile=home()."/.utt/kot.conf";
+
+#read configuration files###########################
+my $file;
+foreach $file ($systemconfigfile, $userconfigfile){
+  if(open(CONFIG, $file)){
+  	while (<CONFIG>) {
+  		chomp;
+      		s/#.*//;
+	      	s/^\s+//;
+      		s/\s+$//;
+    		next unless length;
+    		my ($name, $value) = split(/\s*=\s*/, $_, 2);
+    		if(($name eq "gap-fill")or($name eq "g")){
+			$gap_fill=$value;
+    		}
+    		elsif(($name eq "spaces")or($name eq "s")){
+			$spaces=1;
+		}
+    		elsif(($name eq "help")or($name eq "h")){
+			$help=1;
+    		}
+
+	}
+  	close CONFIG;
+  }
+}
+#########################################################
+
+GetOptions("gap-fill|g=s" => \$gap_fill,
+	   "spaces|r" => \$spaces,
+	   "help|h" => \$help);
+
+if($help)
+{
+    print <<'END'
+Usage: ser [OPTIONS] [file ..]
+
+Options:
+   --gap-fill -g                  Help.
+   --spaces -r
+   --define=FILE                  Read macrodefinitions from FILE.
+   --flex-template=FILE           Read flex code template from FILE.
+   --only-matching -m		  Print only fragments matching PATTERN.
+   --flex                         Print only the generated flex code and exit.
+END
+;
+    exit 0;
+}
+
+
+$gap_fill =~ s/\\t/\t/g;
+$gap_fill =~ s/\\n/\n/g;
+$gap_fill =~ s/\\r/\r/g;
+$gap_fill =~ s/\\f/\f/g;
+
+my $prevend=-1;
+my $count=0;
+
+while(<>)
+{
+    my ($start,$len,$type,$form) = /^\s*(\d+)\s+(\d+)\s+(\S+)\s+(\S+)/;
+
+    if($start > $prevend)
+    {
+	print $gap_fill unless $count++ == 0;
+    }
+
+    $prevend=$start+$len;
+
+    next if $len==0;# || $form eq "*";
+
+    $form =~ s/\\\*/*/g;
+
+    if($type eq 'S' && ! $spaces)
+    {
+	$form =~ s/_/ /g;
+	$form =~ s/\\t/\t/g;
+	$form =~ s/\\n/\n/g;
+	$form =~ s/\\r/\r/g;
+	$form =~ s/\\f/\f/g;
+    }
+
+    print $form;
+}
