-
Notifications
You must be signed in to change notification settings - Fork 32
/
cleanit
executable file
·49 lines (42 loc) · 959 Bytes
/
cleanit
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
43
44
45
46
47
48
49
#!/usr/bin/env bash
function help()
{
echo "Options"
echo " -h|-? display this help message"
echo " -o <dir> output directory"
exit 1
}
while getopts ho:? arg
do
case $arg in
o ) OUTDIR=$OPTARG ;;
h ) help ;;
? ) help ;;
* ) echo "unrecognized option '$arg'" ; exit 1 ;;
esac
done
if [ -z "$OUTDIR" ]; then
OUTDIR=`pwd`
fi
# safety check
if [ -z "$OUTDIR" ]; then
echo "error getting pwd"
exit 1
fi
if [ "$OUTDIR" == "/" ]; then
echo "out dir is /, aborting"
exit 1
fi
# load GCCVER and BINVER
. ./toolvers
set -x
rm -f -- "$OUTDIR"/build.log
rm -rf -- "$OUTDIR"/build-*
rm -rf -- "$OUTDIR"/gcc-$GCCVER
rm -rf -- "$OUTDIR"/binutils-$BINVER
rm -rf -- "$OUTDIR"/gdb-$GDBVER
rm -rf -- "$OUTDIR"/gmp-$GMPVER
rm -rf -- "$OUTDIR"/mpc-$MPCVER
rm -rf -- "$OUTDIR"/mpfr-$MPFRVER
rm -f -- "$OUTDIR"/.extracted-stamp
# vim: ts=4 sw=4 expandtab