~vbursian/research-assistant/intervers

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash 
dirname=`dirname $0`
cd $dirname/..
echo "Cleaning "$PWD

if ( [ "$1" == "exe" ] ) || ( [ "$2" == "exe" ] ) || ( [ "$3" == "exe" ] ) ; then
  echo "removing executives"
  rm -f {bin,bin-debug}/{RA,rap,libRA,librap,install,test,tst}*
  [ -e bin ] && rmdir bin
  if [ -e bin ]; then
    echo  "!!!!!!!!!!!!!! Cannot delete bin: it is not empty"
    echo Press Enter...
    read
  fi 
  [ -e bin-debug ] && rmdir bin-debug
  if [ -e bin-debug ]; then
    echo  "!!!!!!!!!!!!!! Cannot delete bin-debug: it is not empty"
    echo Press Enter...
    read
  fi 
fi

if ( [ "$1" == "user" ] ) || ( [ "$2" == "user" ] ) || ( [ "$3" == "user" ] ) ; then
  echo "removing user settings"
  rm -f {./,*/,*/*/}*.pro.user
fi

if ( [ "$1" == "make" ] ) || ( [ "$2" == "make" ] ) || ( [ "$3" == "make" ] ) ; then
  echo "removing make files etc."
  rm -f {bin,bin-debug}/*.a
  rm -R -f build
  rm -f {./,*/,*/*/}{Makefile,Makefile.Debug,Makefile.Release,object_script.*}
fi

echo "removing garbage"
rm -f {./,*/,*/*/}{*~,*.bak}

echo "Done"
sleep 5
#echo "Press Enter..."
#read