#!/bin/csh -f
#
# domake-all:  make all the config directories
#
# this needs to be run from the source directory
#
# usage:  domake-all [dir]...
# if no dirs, then it does all configs/*
#
# 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 using configs/
    set dirs=(configs/*)
else
    set dirs=($*)
endif

# where the compilation takes place
set compile=build
# where the development-version compilation takes place
set develop=src/test


# first check the parameters in each directory
set problem=0
foreach dir ($dirs)
    checkparam $dir $develop
    if ($status == 1) set problem=1
end

if ($problem) exit 1

# then make sure the $compile directory is ready to compile
domake $compile links mydepend

# then compile each directory
foreach dir ($dirs)
    echo ----------------------------------------------------
    echo $dir
    echo ""

    if (-x $dir/proteus || -x $dir/proteus.gz) continue

    checkparam $dir $develop

    domake-one $dir #  &&  gzip $dir/proteus

    echo ""
end

echo check: 
domake-check $dirs
