2021-11-14 12:14:41 +01:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
|
|
|
|
verbose=false
|
|
|
|
prefix=
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Help screen
|
|
|
|
#
|
|
|
|
help()
|
|
|
|
{
|
|
|
|
cat << OEF
|
2021-11-16 17:43:29 +01:00
|
|
|
Script for the uninstallation of the Vhex kernel's binutils.
|
2021-11-14 12:14:41 +01:00
|
|
|
|
|
|
|
Usage $0 [options...]
|
|
|
|
|
|
|
|
Configurations:
|
|
|
|
-h, --help Display this help
|
2021-11-16 17:43:29 +01:00
|
|
|
--verbose Display extra information during the uninstallation
|
2021-11-14 12:14:41 +01:00
|
|
|
--prefix=<PREFIX> Installation prefix
|
|
|
|
OEF
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
2021-11-16 17:43:29 +01:00
|
|
|
# Parse arguments
|
2021-11-14 12:14:41 +01:00
|
|
|
#
|
|
|
|
|
2021-11-16 17:43:29 +01:00
|
|
|
[[ $# -eq 0 ]] && help
|
|
|
|
|
2021-11-14 12:14:41 +01:00
|
|
|
for arg; do case "$arg" in
|
|
|
|
--help | -h) help;;
|
|
|
|
--verbose) verbose=true;;
|
|
|
|
--prefix=*) prefix=${arg#*=};;
|
|
|
|
*)
|
|
|
|
echo "error: unreconized argument '$arg', giving up." >&2
|
|
|
|
exit 1
|
|
|
|
esac; done
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Unistall step
|
|
|
|
#
|
|
|
|
|
|
|
|
TAG='<sh-elf-vhex-binutils>'
|
|
|
|
PREFIX="$prefix"
|
|
|
|
|
2021-11-16 17:43:29 +01:00
|
|
|
# Check that the configuration step has been effectuated
|
2021-11-15 17:04:56 +01:00
|
|
|
|
2021-12-09 10:30:44 +01:00
|
|
|
if [[ ! -d ../../build/binutils/bin ]]; then
|
2021-11-16 17:43:29 +01:00
|
|
|
echo "error: Are you sure to have configured binutils ? it seems that" >&2
|
|
|
|
echo " the build directory is missing..." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-11-15 17:04:56 +01:00
|
|
|
cd ../../build/binutils
|
|
|
|
|
2021-11-14 12:14:41 +01:00
|
|
|
# Remove symlinks
|
2021-11-16 17:43:29 +01:00
|
|
|
|
2021-11-14 12:14:41 +01:00
|
|
|
echo "$TAG Removing symlinks to binaries..."
|
|
|
|
for x in bin/*; do
|
|
|
|
rm "$PREFIX/$x"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Remove local files
|
2021-11-16 17:43:29 +01:00
|
|
|
|
2021-11-14 12:14:41 +01:00
|
|
|
echo "$TAG Removing installed files..."
|
2021-11-15 17:04:56 +01:00
|
|
|
rm -rf ../binutils
|