#!/bin/csh -f
# Useful for calling makesim from emacs. 
# Put "domake dirname" on the "make" command line.
# This sets up the path, cds down into the dirname directory,
# and makes the links before making proteus.
#
# 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 < 1) then 
    echo 'usage: domake dirname [make args]'
    exit 1
endif

set proteus=/u/dfk/research/parallel/proteus/current
set path=($path $proteus/bin $proteus/local/bin)

echo cd "$1"
cd $1

if (! -r UserMake) ln -s ../Makefile UserMake

if ($#argv > 1) then 
    echo "makesim $argv[2-]"
    makesim $argv[2-]
else
    echo makesim proteus
    makesim proteus
endif
