1 use ExtUtils::MakeMaker;
3 my %tables = (iso8859 => ['ascii.ucm', 'cp1250.ucm', 'koi8-r.ucm' ],
4 EBCDIC => ['cp1047.ucm','cp37.ucm','posix-bc.ucm'],
5 Symbols => ['symbol.ucm','dingbats.ucm'],
9 while (defined(my $file = readdir(ENC)))
11 if ($file =~ /8859.*\.ucm/)
13 push(@{$tables{iso8859}},$file);
21 VERSION_FROM => 'Encode.pm',
22 OBJECT => '$(O_FILES)',
24 COMPRESS => 'gzip -9f',
26 DIST_DEFAULT => 'all tardist',
38 # Find existing O_FILES
39 foreach my $f (@{$self->{'O_FILES'}})
43 my $x = $self->{'OBJ_EXT'};
44 # Add the table O_FILES
45 foreach my $e (keys %tables)
49 # Trick case-blind filesystems.
50 delete $o{'encode'.$x};
53 $self->{'O_FILES'} = [sort keys %o];
55 foreach my $table (keys %tables)
57 foreach my $ext (qw($(OBJ_EXT) .c .h .def .fnm))
59 push (@files,$table.$ext);
62 $self->{'clean'}{'FILES'} .= join(' ',@files);
69 my $dir = $self->catdir($self->curdir,'Encode');
70 my $str = "# Encode\$(OBJ_EXT) depends on .h and .def files not .c files - but all written by compile\n";
71 $str .= 'Encode$(OBJ_EXT) :';
72 foreach my $table (keys %tables)
77 foreach my $table (keys %tables)
80 my $lengthsofar = length($str);
82 $str .= "$table.c : compile Makefile.PL";
83 foreach my $file (@{$tables{$table}})
85 $str .= $continuator.' '.$self->catfile($dir,$file);
86 if ( length($str)-$lengthsofar > 128*$numlines )
88 $continuator .= " \\\n\t";
94 $str .= "\n\t\$(PERL) compile -o \$\@ -f $table.fnm\n\n";
95 open (FILELIST, ">$table.fnm")
96 || die "Could not open $table.fnm: $!";
97 foreach my $file (@{$tables{$table}})
99 print FILELIST $self->catfile($dir,$file) . "\n";