Changeset 632 for script

Show
Ignore:
Timestamp:
03/13/05 07:02:07 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
1869
Message:

* even more cleanup on pugscc; now assume executable name base on the input file name

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • script/pugscc

    r631 r632  
    33use FindBin; 
    44use File::Copy; 
     5use File::Basename; 
    56 
    6 chdir "$FindBin::Bin/.."; 
     7if (!-e "src/Main.hs") { 
     8    chdir "$FindBin::Bin/.."; 
     9    if (!-e "src/Main.hs") { 
     10        die "$0: This script must be invoked in the Pugs source tree directory." 
     11    } 
     12} 
    713 
    814unlink "dump.ast"; 
     15 
     16my $out = 'a'; 
     17if (@ARGV and -e $ARGV[0]) { 
     18    $out = basename($ARGV[0]); 
     19    $out =~ s{\..*}{}; 
     20} 
     21 
    922system("pugs", -C => @ARGV); 
    1023exit 1 unless -e "dump.ast"; 
     
    1932close FH; 
    2033 
    21 my $out = ($^O eq 'MSWin32') ? "a.exe" : "a.out"; 
     34$out .= ($^O eq 'MSWin32') ? ".exe" : ".out"; 
    2235system("ghc", "-v0", "-o", $out, "--make", "-main-is", "mainCC", "-isrc", "src/MainCC.hs"); 
    2336unlink "src/MainCC.hs";