3 use ExtUtils::MakeMaker;
5 my %tables = (8859 => ['ascii.ucm', 'cp1250.ucm', 'koi8-r.ucm', 'jis0201.ucm' ],
6 EBCDIC => ['cp1047.ucm','cp37.ucm','posix-bc.ucm'],
7 Symbols => ['symbol.ucm','dingbats.ucm'],
10 opendir(ENC,'Encode');
11 while (defined(my $file = readdir(ENC)))
13 if ($file =~ /8859.*\.ucm/)
15 push(@{$tables{8859}},$file);
23 VERSION_FROM => 'Encode.pm',
24 OBJECT => '$(O_FILES)',
26 COMPRESS => 'gzip -9f',
28 DIST_DEFAULT => 'all tardist',
40 # Find existing O_FILES
41 foreach my $f (@{$self->{'O_FILES'}})
45 my $x = $self->{'OBJ_EXT'};
46 # Add the table O_FILES
47 foreach my $e (keys %tables)
51 # Trick case-blind filesystems.
52 delete $o{'encode'.$x};
55 $self->{'O_FILES'} = [sort keys %o];
57 foreach my $table (keys %tables)
59 foreach my $ext (qw($(OBJ_EXT) .c .h _def.h .fnm))
61 push (@files,$table.$ext);
64 $self->{'clean'}{'FILES'} .= join(' ',@files);
71 my $dir = $self->catdir($self->curdir,'Encode');
72 my $str = "# Encode\$(OBJ_EXT) depends on .h and _def.h files not .c files - but all written by compile\n";
73 $str .= 'Encode$(OBJ_EXT) :';
74 foreach my $table (keys %tables)
79 foreach my $table (keys %tables)
82 my $lengthsofar = length($str);
84 $str .= "$table.c : compile Makefile.PL";
85 foreach my $file (@{$tables{$table}})
87 $str .= $continuator.' '.$self->catfile($dir,$file);
88 if ( length($str)-$lengthsofar > 128*$numlines )
90 $continuator .= " \\\n\t";
96 $str .= $^O eq 'VMS' # In VMS quote to preserve case
97 ? qq{\n\t\$(PERL) compile -"Q" -"O" -o \$\@ -f $table.fnm\n\n}
98 : qq{\n\t\$(PERL) compile -Q -O -o \$\@ -f $table.fnm\n\n};
99 open (FILELIST, ">$table.fnm")
100 || die "Could not open $table.fnm: $!";
101 foreach my $file (@{$tables{$table}})
103 print FILELIST $self->catfile($dir,$file) . "\n";