[project @ 1996-06-27 17:43:45 by partain]
authorpartain <unknown>
Thu, 27 Jun 1996 17:45:03 +0000 (17:45 +0000)
committerpartain <unknown>
Thu, 27 Jun 1996 17:45:03 +0000 (17:45 +0000)
partain 1.3 changes to 960626

glafp-utils/Makefile.BOOT
glafp-utils/msub/Jmakefile
glafp-utils/scripts/fastmake.prl
glafp-utils/scripts/mkdependC.prl
glafp-utils/scripts/runstdtest.prl

index de3ff7a..7ba6e16 100644 (file)
@@ -39,7 +39,7 @@ JMAKE_CMD = $(NEWTOP)$(JMAKE) -I$(NEWTOP)$(JMAKESRC) $(BOOTSTRAPCFLAGS) -DTopDir
 Makefile:: $(JMAKE)
 
 $(JMAKE):
-       @(cd $(JMAKESRC); if [ -f Makefile ]; then \
+       @(cd $(JMAKESRC) && if [ -f Makefile ]; then \
        echo "checking $@ in $(JMAKESRC) first..."; $(MAKE) all; else \
        echo "bootstrapping $@ from Makefile.BOOT in $(JMAKESRC) first..."; \
        $(MAKE) -f Makefile.BOOT BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS); fi; \
index 0550098..52c3bb7 100644 (file)
@@ -4,4 +4,4 @@ InstallBinaryTarget(msub,$(INSTBINDIR))
 
 CDependTarget( $(SRCS_C) )
 
-RunStdTest(msub001,msub,-f test.makefile testfile -o1 test.out)
+RunStdTest(msub001,msub,-o1 test.out -f test.makefile testfile)
index bcaac6b..730e6a4 100644 (file)
@@ -31,8 +31,12 @@ USE AT YOUR OWN RISK: you can make a big mess with this script!
 EOUSAGE
 
 $Makefile = 'Makefile';
-$Tmpfile  = "/tmp/Makefile$$";
-chop($Arch = `uname -a`);
+if ( $ENV{'TMPDIR'} ) { # where to make tmp file names
+    $Tmpfile = $ENV{'TMPDIR'} . "/Makefile$$";
+} else {
+    $Tmpfile  = "$(TMPDIR)/Makefile$$";
+    $ENV{'TMPDIR'} = '$(TMPDIR)'; # set the env var as well
+}
 $SleazyTouch = '/usr/5bin/touch';
 $DoTouch = 0;
 $Verbose = 0;
@@ -111,11 +115,8 @@ while ( $_ ) {
 close(INF);
 close(OUTF);
 
-if ($Arch ne "sun3") {
-    $Make = 'make JMAKE=jmake LIT2PGM=lit2pgm LIT2LATEX=lit2latex LIT2TEXI=lit2texi MKDEPENDLIT=mkdependlit MAKEINFO=makeinfo POSTMAKEINFO=postmakeinfo';
-} else {
-    $Make = 'make';
-}
+$Make = 'make JMAKE=jmake LIT2PGM=lit2pgm LIT2LATEX=lit2latex LIT2TEXI=lit2texi MKDEPENDLIT=mkdependlit MAKEINFO=makeinfo POSTMAKEINFO=postmakeinfo';
+
 print STDERR "$Make $MakeFlags -f $Tmpfile $Target; rm $Tmpfile\n" if $Verbose;
 
 system( "$Make $MakeFlags -f $Tmpfile $Target; rm $Tmpfile" );
index 272c0a8..cca167d 100644 (file)
@@ -9,7 +9,7 @@
 $Usage  = "usage: $Pgm: not done yet\n";
 
 $Status  = 0; # just used for exit() status
-$Verbose = '';
+$Verbose = 0;
 $Dashdashes_seen = 0;
 
 $Begin_magic_str = "# DO NOT DELETE: Beginning of C dependencies\n";
@@ -27,7 +27,7 @@ if ( ! $Makefile && -f 'makefile' ) {
     $Makefile = 'makefile';
 } elsif ( ! $Makefile && -f 'Makefile') {
     $Makefile = 'Makefile';
-} else {
+} elsif ( ! $Makefile) {
     die "$Pgm: no makefile or Makefile found\n";
 }
 
@@ -73,7 +73,6 @@ while (<OMKF>) { # copy the rest through
 }
 close(NMKF);
 close(OMKF);
-chmod 0444, 'Makefile';
 exit 0;
 
 sub mangle_command_line_args {
@@ -90,7 +89,7 @@ sub mangle_command_line_args {
 
        } elsif ($Dashdashes_seen != 1) { # not between -- ... --
            if ( /^-v$/ ) {
-               $Verbose        = '-v';
+               $Verbose++;
            } elsif ( /^-f/ ) {
                $Makefile       = &grab_arg_arg($_);
            } elsif ( /^-o/ ) {
index a6c964f..0c25109 100644 (file)
@@ -60,6 +60,10 @@ $ToRun = "./$ToRun" if $ToRun !~ /^\//;
 arg: while ($_ = $ARGV[0]) {
     shift(@ARGV);
     
+    /^--$/     && do { # let anything past after --
+                       push(@PgmArgs, @ARGV);
+                       last arg; };
+
     /^-v$/     && do { $Verbose = 1; next arg; };
     /^-O(.*)/  && do { push(@PgmArgs, &grab_arg_arg('-O',$1)); next arg; };
     /^-i(.*)/  && do { $PgmStdinFile = &grab_arg_arg('-i',$1);
@@ -145,7 +149,7 @@ if ( $SpixTiming eq 'yes' ) {
 
     open(SPIXNM, "nm -n $ToRunOrig |") || die "nm -n $ToRunOrig open failed!\n";
     spix: while (<SPIXNM>) {
-       if ( / T (_FreeMallocPtr|_([A-Za-z]+)Hook|_xmalloc|_mpz_get_si)$/ ) {
+       if ( / T +(_FreeMallocPtr|_([A-Za-z]+)Hook|_xmalloc|_mpz_get_si)$/ ) {
            $LastSpix = $1;
            last spix;
        }
@@ -320,16 +324,23 @@ sub process_stats_file {
        #NB: nearly the same as in GHC driver's -ghc-timing stuff
 
        open(STATS, $StatsFile) || die "Failed when opening $StatsFile\n";
-       local($tot_live) = 0; # for calculating avg residency
+
+       local($max_live)    = 0; 
+       local($tot_live)    = 0; # for calculating residency stuff
+       local($tot_samples) = 0;
 
        while (<STATS>) {
-           $tot_live += $1 if /^\s*\d+\s+\d+\s+\d+\.\d+\%\s+(\d+)\s+\d+\.\d+\%/;
+           if (! /Minor/ && /^\s*\d+\s+\d+\s+(\d+)\s+\d+\.\d+\%/ ) {
+               $max_live = $1 if $max_live < $1;
+               $tot_live += $1;
+               $tot_samples += 1;
+           }
 
            $BytesAlloc = $1 if /^\s*([0-9,]+) bytes allocated in the heap/;
 
-           if ( /^\s*([0-9,]+) bytes maximum residency .* (\d+) sample/ ) {
-               $MaxResidency = $1; $ResidencySamples = $2;
-           }
+#          if ( /^\s*([0-9,]+) bytes maximum residency .* (\d+) sample/ ) {
+#              $MaxResidency = $1; $ResidencySamples = $2;
+#          }
 
            $GCs = $1 if /^\s*([0-9,]+) garbage collections? performed/;
 
@@ -342,8 +353,10 @@ sub process_stats_file {
            }
        }
        close(STATS) || die "Failed when closing $StatsFile\n";
-       if ( defined($ResidencySamples) && $ResidencySamples > 0 ) {
-           $AvgResidency = int ($tot_live / $ResidencySamples) ;
+       if ( $tot_samples > 0 ) {
+           $ResidencySamples = $tot_samples;
+           $MaxResidency = $max_live;
+           $AvgResidency = int ($tot_live / $tot_samples) ;
        }
 
     } elsif ( $SysSpecificTiming eq 'hbc' ) {