Commit b07a82ba authored by Raymond Toy's avatar Raymond Toy
Browse files

Add -M option to pass extra flags to make.

Use getopts to parse the options and also print slightly better error
messages.
parent 57bca190
#!/bin/sh
while getopts "M:h?" arg
do
case $arg in
M) MFLAGS="$OPTARG" ;;
h) usage ;;
\?) usage ;;
esac
done
usage()
{
echo "rebuild.-lisp.sh [-h?] [-M opts] target-directory"
echo " -h this help"
echo " -? this help"
echo " -M opts Options to pass to make"
}
shift `expr $OPTIND - 1`
if [ "$1" = "" ]
then
echo "Usage: $0 target-directory"
usage
exit 1
fi
if [ ! -d "$1" ]
then
echo "$1 isn't a directory"
echo "$1" must be a directory.
exit 2
fi
......@@ -23,4 +43,4 @@ fi
export MAKE
${MAKE} -C $TARGET/lisp clean && ${MAKE} -C $TARGET/lisp
${MAKE} -C $TARGET/lisp $MFLAGS clean && ${MAKE} -C $TARGET/lisp $MFLAGS
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment