#!/bin/csh -f
#
# domake-verify:  make 'unstripe' and 'lutest' for checking LU results
#
# this needs to be run from the 'run' directory
#
set usage='domake-verify dirname...'
#
# Part of
#              The STARFISH Parallel file-system simulator
#        (Simulation Tool for Advanced Research in File Systems)
# 
#                               David Kotz
#                           Dartmouth College
#                              Version 3.0
#                              October 1996
#                          dfk@cs.dartmouth.edu

if ($#argv == 0) then
    echo "$usage"
    exit 1
endif

# where the compilation takes place
set compile=build

foreach dir ($*)
   echo $dir
   rm -f $dir/unstripe $dir/lutest

   # copy only the param files that differ
   foreach pf ($dir/*.param)
       cmp -s $pf $compile/$pf:t || cp $pf $compile/$pf:t && echo copied $pf:t
   end

   domake $compile lutest unstripe && mv $compile/lutest $compile/unstripe $dir/
end

echo check:
foreach dir ($*)
    if (! -x $dir/unstripe) echo missing $dir/unstripe
    if (! -x $dir/lutest) echo missing $dir/lutest
end
