home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / Perl / RPC / !Perl / scripts / BinObjs next >
Text File  |  1998-07-14  |  445b  |  25 lines

  1. #! perl -w
  2. use RISCOS;
  3.  
  4. die "$0 <Objectprefix> <Sourceprefix> <Pattern>" if( $#ARGV < 1 );
  5.  
  6. $obj = shift;
  7. $prefix = shift;
  8. foreach ( @ARGV )
  9. {
  10.     foreach $source ( RISCOS::Filespec::globlist( "$prefix$_" ) )
  11.     {
  12.         $source = substr $source, length $prefix;
  13.  
  14.     $source =~ s/\.c\./\.o\./;
  15.     $source =~ s/\.s\./\.o\./;
  16.         
  17.     $source = $obj . $source;
  18.     if( -f $source )
  19.     {
  20.         print "$source\n";
  21.         unlink( "$source" ) or warn $!;
  22.     }
  23.     }
  24. }
  25.