3 use ExtUtils::MakeMaker;
5 my %tables = (EUC_JP => [
15 NAME => "Encode::EUC_JP",
16 VERSION_FROM => 'EUC_JP.pm',
17 OBJECT => '$(O_FILES)',
19 COMPRESS => 'gzip -9f',
21 DIST_DEFAULT => 'all tardist',
33 my $x = $self->{'OBJ_EXT'};
34 # Add the table O_FILES
35 foreach my $e (keys %tables)
39 $self->{'O_FILES'} = [sort keys %o];
42 foreach my $table (keys %tables) {
43 $xs{"$table.xs"} = "$table.c";
44 foreach my $ext (qw($(OBJ_EXT) .xs .c .h _def.h .fnm)) {
45 push (@files,$table.$ext);
48 $self->{'XS_FILES'} = {%xs};
49 $self->{'clean'}{'FILES'} .= join(' ',@files);
56 my $dir = $self->catdir($self->updir,'Encode');
57 my $str = "# Encode\$(OBJ_EXT) depends on .h and _def.h files not .c files - but all written by compile\n";
58 $str .= 'Encode$(OBJ_EXT) :';
59 foreach my $table (keys %tables)
64 foreach my $table (keys %tables)
66 $str .= "$table.c : $table.xs\n";
69 my $compile = $self->catfile($self->updir,'compile');
70 foreach my $table (keys %tables)
73 my $lengthsofar = length($str);
75 $str .= "$table.xs : $compile Makefile.PL";
76 foreach my $file (@{$tables{$table}})
78 $str .= $continuator.' '.$self->catfile($dir,$file);
79 if ( length($str)-$lengthsofar > 128*$numlines )
81 $continuator .= " \\\n\t";
87 $str .= "\n\t\$(PERL) $compile -o \$\@ -f $table.fnm\n\n";
88 open (FILELIST, ">$table.fnm")
89 || die "Could not open $table.fnm: $!";
90 foreach my $file (@{$tables{$table}})
92 print FILELIST $self->catfile($dir,$file) . "\n";