#!/usr/bin/perl # benchmake # # Written by Paul Caskey on 20 Jan 1997. # Compiles Al Aburto's suite of benchmarks. # See also benchunpack, benchfrob, and benchrun. # # I always run the entire suite of benchmarks with a "standard" set of # compiler options which I know work well on my system. Usually this is # a basic optimization flag like -O plus the required -DUNIX. Then, if # I have time, I go in by hand and start tweaking. # # This script does the massive make with the standard options. If you # have a few different optimization methods, I recommend using benchmake # plus benchrun to run the entire suite with each set of flags, and save # each one to a different output file for easy comparison. # # A "benchmake clean" is desparately needed, but I'm too lazy to hack # it, so I just "rm -r bench ; benchunpack ; benchfrob" every time. # # Just modify the "flags" line below and goferit. It'll probably crash. # I haven't written this to be universally portable. Sorry if it causes # you more grief than just doing it all by hand. Give it a shot. $flags = "CC=cc -O -DUNIX"; ########################################################### $| = 1; chdir("bench") || die; foreach $dir (`/bin/ls -F | grep /\$`) { chop($dir); # newline chop($dir); # slash chdir($dir) || die; print "Making $dir\n"; if ($dir =~ /dhry$/) { print `make "$flags" dhry11`; print `make "$flags" dhry21`; } elsif ($dir =~ /mm$/) { print `make "$flags -DN=500"`; } else { print `make "$flags"`; } $stripfiles = `file * | grep executable | awk -F: '{ print \$1; }'`; print `strip $stripfiles`; chdir("..") || die; }