#! /usr/bash


if [ "$1" ==  '1' ] ; then
    target="brsaneconfig"
    ccflag1="-DBRSANESUFFIX=1 "
elif [ "$1" ==  '2' ] ; then
    target="brsaneconfig2"
    ccflag1="-DBRSANESUFFIX=2 "
else
    echo "USAGE mk_brsaneconfig [1/2] [-D](build with debug option)"
    exit 0
fi


if [ "$2" = '-D' ] || [ "$2" = '-d' ];then
  ccflag2="-g -o -DMKCONFIG -idirafter ../backend_src"
else
  ccflag2="-Wall -O0 -DMKCONFIG -idirafter ../backend_src"
fi


if [ "$1" = "-d" ];then
echo "gcc  $ccflag1 $ccflag2  -o $target brsaneconfig.c ../backend_src/brother_advini.c"
gcc  $ccflag1 $ccflag2  -o $target brsaneconfig.c ../backend_src/brother_advini.c  
else
echo "gcc  $ccflag1 $ccflag2  -o $target brsaneconfig.c ../backend_src/brother_advini.c"
gcc  $ccflag1 $ccflag2  -o $target brsaneconfig.c ../backend_src/brother_advini.c  
fi



