home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / GCC / GERLIB_DEV08B.LHA / gerlib / amiga_lib / support / genglue.p < prev    next >
Encoding:
Text File  |  1993-12-12  |  374 b   |  22 lines

  1. $state = 0;
  2.  
  3. next_line: while (<STDIN>) {
  4.   if (/.even/) {
  5.     close (OUTY) if $state == 2;
  6.     $state = 1;
  7.   }
  8.   elsif (/.globl _(\w+)/) {
  9.     $state = 2;
  10.     if (! open (OUTY, ">$1.s")) {
  11.       print STDERR "Can't open $1.s, $!\n"; 
  12.       $state = 0;
  13.       next next_line;
  14.     }
  15.     print OUTY ".text; .even; $_\n";
  16.   }
  17.   elsif ($state == 2) {
  18.     print OUTY "$_";
  19.   }
  20. }
  21.  
  22.