3 use ExtUtils::MakeMaker;
13 my @more_exe_files = qw(bin/enc2xs bin/piconv);
16 if ($arg eq "USE_SCRIPTS"){
17 push @exe_files, @more_exe_files;
23 EXE_FILES => \@exe_files,
24 VERSION_FROM => 'Encode.pm',
25 OBJECT => '$(O_FILES)',
27 COMPRESS => 'gzip -9f',
29 DIST_DEFAULT => 'all tardist',
42 # Find existing O_FILES
43 foreach my $f (@{$self->{'O_FILES'}})
47 my $x = $self->{'OBJ_EXT'};
48 # Add the table O_FILES
49 foreach my $e (keys %tables)
53 # Trick case-blind filesystems.
54 delete $o{'encode'.$x};
57 $self->{'O_FILES'} = [sort keys %o];
59 foreach my $table (keys %tables)
61 foreach my $ext (qw($(OBJ_EXT) .c .h _def.h .fnm))
63 push (@files,$table.$ext);
66 $self->{'clean'}{'FILES'} .= join(' ',@files);
73 my $dir = $self->catdir($self->curdir,'Encode');
74 my $str = "# Encode\$(OBJ_EXT) depends on .h and _def.h files not .c files - but all written by enc2xs\n";
75 $str .= 'Encode$(OBJ_EXT) :';
76 foreach my $table (keys %tables)
81 foreach my $table (keys %tables)
84 my $lengthsofar = length($str);
86 my $enc2xs = $self->catfile('bin', 'enc2xs');
87 $str .= "$table.c : $enc2xs Makefile.PL";
88 foreach my $file (@{$tables{$table}})
90 $str .= $continuator.' '.$self->catfile($dir,$file);
91 if ( length($str)-$lengthsofar > 128*$numlines )
93 $continuator .= " \\\n\t";
99 $str .= $^O eq 'VMS' # In VMS quote to preserve case
100 ? qq{\n\t\$(PERL) $enc2xs -"Q" -"O" -o \$\@ -f $table.fnm\n\n}
101 : qq{\n\t\$(PERL) $enc2xs -Q -O -o \$\@ -f $table.fnm\n\n};
102 open (FILELIST, ">$table.fnm")
103 || die "Could not open $table.fnm: $!";
104 foreach my $file (@{$tables{$table}})
106 print FILELIST $self->catfile($dir,$file) . "\n";