Files
mercury/tools/cleanint
Zoltan Somogyi 47a1a02a92 Add vim modelines to most tools.
tools/add_cont_lines:
tools/appears:
tools/assemble:
tools/avg_frame_size:
tools/build_srcdist:
tools/cleanint:
tools/compare_frame_sizes:
tools/configure_mingw_cross:
tools/cont:
tools/ctor_rep_stats:
tools/cur_param:
tools/dd_speedtest:
tools/divide:
tools/extract_dd_stats:
tools/file_name_translation_stats:
tools/frame_sizes:
tools/gdbrun:
tools/half:
tools/info_stats.awk:
tools/linear:
tools/lmc.in:
tools/mai_stats:
tools/make_arena:
tools/next_param:
tools/not:
tools/optstages:
tools/type_ctor_stats:
    Add vim mode lines. Replace tabs with spaces.
2021-04-27 03:54:27 +10:00

53 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
# vim: ft=sh ts=4 sw=4 et
# Check whether there are any Mercury-compiler generated files in this
# directory that do not belong to Mercury modules in this directory.
# Report their names.
#
# The script assumes that the source for a module mod1.mod2.mod3 is stored
# in a file whose name is either fully qualified (e.g. mod1.mod2.mod3.m),
# or not qualified at all (e.g. mod3.m).
prefix=
while getopts p: flag
do
case $flag in
p) prefix="$OPTARG/"
;;
*) echo "usage: cleanint [-p prefix]"
exit 1
;;
esac
done
shift `expr $OPTIND - 1`
if test $# -gt 0
then
echo "usage: cleanint [-p prefix]"
exit 1
fi
for suffix in d dep int int2 int3 date date3 opt optdate trans_opt trans_opt_date err
do
for file in *.$suffix
do
# If there are no files with a given suffix,
# then avoid the ill-formed call to basename.
if test -f "$file"
then
base=`basename $file .$suffix`
if test ! -f "$base.m"
then
basebase=`echo $base | sed -e 's/.*\.//'`
if test ! -f "$basebase.m"
then
echo $prefix$file
fi
fi
fi
done
done
exit 0