2 use ExtUtils::MakeMaker;
11 my @exe_files = qw(bin/enc2xs
14 my @more_exe_files = qw(
17 my @pmlibdirs = qw(lib Encode);
19 if ($arg eq "MORE_SCRIPTS"){
20 push @exe_files, @more_exe_files;
22 if ($arg eq "INSTALL_UCM"){
23 push @pmlibdirs, "ucm";
29 EXE_FILES => \@exe_files,
30 VERSION_FROM => 'Encode.pm',
31 OBJECT => '$(O_FILES)',
33 COMPRESS => 'gzip -9f',
35 DIST_DEFAULT => 'all tardist',
39 PMLIBDIRS => \@pmlibdirs,
49 # Find existing O_FILES
50 foreach my $f (@{$self->{'O_FILES'}})
54 my $x = $self->{'OBJ_EXT'};
55 # Add the table O_FILES
56 foreach my $e (keys %tables)
60 # Trick case-blind filesystems.
61 delete $o{'encode'.$x};
64 $self->{'O_FILES'} = [sort keys %o];
66 foreach my $table (keys %tables)
68 foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm))
70 push (@files,$table.$ext);
73 $self->{'clean'}{'FILES'} .= join(' ',@files);
80 my $dir = $self->catdir($self->curdir,'ucm');
81 my $str = "# Encode\$(OBJ_EXT) depends on .h and .exh files not .c files - but all written by enc2xs\n";
82 $str .= 'Encode$(OBJ_EXT) :';
83 foreach my $table (keys %tables)
88 foreach my $table (keys %tables)
91 my $lengthsofar = length($str);
93 my $enc2xs = $self->catfile('bin', 'enc2xs');
94 $str .= "$table.c : $enc2xs Makefile.PL";
95 foreach my $file (@{$tables{$table}})
97 $str .= $continuator.' '.$self->catfile($dir,$file);
98 if ( length($str)-$lengthsofar > 128*$numlines )
100 $continuator .= " \\\n\t";
106 $str .= $^O eq 'VMS' # In VMS quote to preserve case
107 ? qq{\n\t\$(PERL) $enc2xs -"Q" -"O" -o \$\@ -f $table.fnm\n\n}
108 : qq{\n\t\$(PERL) $enc2xs -Q -O -o \$\@ -f $table.fnm\n\n};
109 open (FILELIST, ">$table.fnm")
110 || die "Could not open $table.fnm: $!";
111 foreach my $file (@{$tables{$table}})
113 print FILELIST $self->catfile($dir,$file) . "\n";