#!/bin/bash
# Run this script for benchmark preparation

# This configh.sh script is located in the same directory as
# 01.FMM-YUK-U.tar.bz2 and 02.FMM-YUK-A.tar.bz2
echo								
echo
echo "Current directory is $PWD"				# setting main folder as env var
echo
echo "Setting '$PWD' as benchmark root directory"		# 
export bench_dir=$PWD
# echo $bench_dir
echo
echo
echo " If you prefer another path either set it in bash.rc"
echo " or move files and script to said folder" 
#tar -jxvf 01.FMM-YUK-U.tar.bz2					# extract tar in folder 01
#tar -jxvf 02.FMM-YUK-A.tar.bz2					# extract tar in folder 02
echo
echo

export bench_dir_01=$bench_dir/01.FMM-YUK-U			# setting folder 01 as env var
export bench_dir_02=$bench_dir/02.FMM-YUK-A			# setting folder 02 as env var
#echo $bench_dir_01
#echo $bench_dir_02

export additions=$bench_dir/additions				# setting folder additions as env var
cd $additions ; make all 					# 'make' additions folder
#echo $PWD
#ls
cd $bench_dir_01/source/; make clean				# make clean for bench folders
#echo $PWD			
cd $bench_dir_02/source/; make clean
#echo $PWD

cd $bench_dir ; chmod u+x generate.sh ; ./generate.sh		# over to generate.sh script

