#! /bin/bash

#
# (C) Copyright IBM Corp. 2001
#
# $Id: BuildImages,v 1.8 2004/03/25 16:44:23 dgrove-oss Exp $
#
# This script will be the images needed by the Run-gather-dna script
#   Arguments:  directory to hold image directories
#                  ex BuildImages /u/hind/RVMSanityTests
#
# @author Michael Hind, Dec 1, 2001
#

# parent of build directories is command line argument to the script

if [[ $RVM_ROOT = "" ]]; then
   echo "\n***$0: please set your RVM_ROOT environment variable (eg. $HOME/jvmShadow)***\n"
   exit 1
fi

BUILDDIR=$1
 
IMAGES='FastBaseAdaptiveGenMS FastOpt0GenMS FastOpt1GenMS FastAdaptiveGenMS'

for image in $IMAGES
do
   rm -rf $BUILDDIR/$image
   export RVM_BUILD=$BUILDDIR/$image
   echo "Configuring $image"
   $RVM_ROOT/rvm/bin/jconfigure $image
   cd $BUILDDIR/$image
   echo "Building $image"
   ./jbuild >RVM.trace 2>&1
done
