#!/bin/bash

exp=$1
input=$2
copyto=$3
outdir=${copyto}

if [[ -z "$exp" ]] || [[ ! -a "$input" ]] || [[ -z "$copyto" ]]; then
  echo "USAGE: $0 [exp] [input file] [copy name]"
  exit 0
fi

make clean
cp $input $copyto

mkdir ../$outdir
cd ../$outdir
echo -n 'EXP = ' > Makefile
echo $exp >> Makefile
cat ~/compress/tools/expMakefile >> Makefile
make

