diff --git a/bin/rebuild-lisp.sh b/bin/rebuild-lisp.sh index d6aa6e93facdb39ece404641660b8fe9ebccb4f8..1e49d01742a177b1e5e770d6f1a2834e2d200524 100755 --- a/bin/rebuild-lisp.sh +++ b/bin/rebuild-lisp.sh @@ -1,14 +1,34 @@ #!/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