blob: 18ea340703dc6a40fb9d8179dc400dc353f2d31d [file] [log] [blame]
# clean script
# This file was developed by Reid Spencer and is distributed under the
# University of Illinois Open Source License. See LICENSE.TXT for details.
# This script allows easier cleaning of LLVM modules. Just specify the names
# of the modules on the command line and they and their dependencies will be
# cleaned. See the README.txt file.
# Get the shell function library
if test ! -z "$LLVM_TOP" ; then
if test -f "$LLVM_TOP/" ; then
. "$LLVM_TOP/"
echo "Your LLVM_TOP variable is not set to an llvm-top directory"
exit 1
elif test -f ./ ; then
. ./
elif test -f ../ ; then
. ../
echo Please run $0 from the llvm-top directory or a module directory.
exit 1
# Get the list of modules.
process_arguments "$@"
# Get the
get_module_dependencies $MODULES
for mod in $MODULE_DEPENDENCIES ; do
get_module_info $mod CleanCmd
if test ! -z "$MODULE_INFO_VALUE" ; then
msg 1 Cleaning module $mod
cd $LLVM_TOP/$mod
$MODULE_INFO_VALUE || die $? "Clean of module $mod failed."
msg 2 Module $mod has no CleanCmd in the ModuleInfo.txt
# Report what happened.
msg 1 Modules cleaned: "$MODULE_DEPENDENCIES".