3 use ExtUtils::MakeMaker;
5 my %tables = (EUC_JP => ['euc-jp.ucm',
6 # 'euc-kr.ucm', 'euc-cn.ucm'
13 NAME => "Encode::EUC_JP",
14 VERSION_FROM => 'EUC_JP.pm',
15 OBJECT => '$(O_FILES)',
17 COMPRESS => 'gzip -9f',
19 DIST_DEFAULT => 'all tardist',
31 my $x = $self->{'OBJ_EXT'};
32 # Add the table O_FILES
33 foreach my $e (keys %tables)
37 $self->{'O_FILES'} = [sort keys %o];
40 foreach my $table (keys %tables) {
41 $xs{"$table.xs"} = "$table.c";
42 foreach my $ext (qw($(OBJ_EXT) .xs .c .h .def .fnm)) {
43 push (@files,$table.$ext);
46 $self->{'XS_FILES'} = {%xs};
47 $self->{'clean'}{'FILES'} .= join(' ',@files);
54 my $dir = $self->catdir($self->updir,'Encode');
55 my $str = "# Encode\$(OBJ_EXT) depends on .h and .def files not .c files - but all written by compile\n";
56 $str .= 'Encode$(OBJ_EXT) :';
57 foreach my $table (keys %tables)
62 my $compile = $self->catfile($self->updir,'compile');
63 foreach my $table (keys %tables)
66 my $lengthsofar = length($str);
68 $str .= "$table.xs : $compile Makefile.PL";
69 foreach my $file (@{$tables{$table}})
71 $str .= $continuator.' '.$self->catfile($dir,$file);
72 if ( length($str)-$lengthsofar > 128*$numlines )
74 $continuator .= " \\\n\t";
80 $str .= "\n\t\$(PERL) $compile -o \$\@ -f $table.fnm\n\n";
81 open (FILELIST, ">$table.fnm")
82 || die "Could not open $table.fnm: $!";
83 foreach my $file (@{$tables{$table}})
85 print FILELIST $self->catfile($dir,$file) . "\n";