| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | MAKE=${MAKE:-make} |
| 6 | RM=${RM:-rm -rf} |
| 7 | |
| 8 | diescip-shell shell shell-project 0.0.0 die(). () { |
| 9 | echoscip-shell system . . echo. >&2 "$1" |
| 10 | exit 1 |
| 11 | } |
| 12 | |
| 13 | usagescip-shell shell shell-project 0.0.0 usage(). () { |
| 14 | diescip-shell shell shell-project 0.0.0 die(). "usage: $name [--exclude <path> ...]" |
| 15 | } |
| 16 | |
| 17 | |
| 18 | name=$(basenamescip-shell system . . basename. "$0") |
| 19 | dir=$(dirnamescip-shell system . . dirname. "$0") |
| 20 | root=$(cd "$dir/.." && pwdscip-shell system . . pwd.) |
| 21 | bin="$root/bin" |
| 22 | |
| 23 | declare -a exclude |
| 24 | while [scip-shell system . . `[`. "$#" -gt 0 ]; do |
| 25 | case "$1" in |
| 26 | "--exclude") |
| 27 | shift |
| 28 | if [scip-shell system . . `[`. "$#" -gt 0 ]; then |
| 29 | exclude+=("$1"); |
| 30 | shift |
| 31 | fi |
| 32 | ;; |
| 33 | *) |
| 34 | usagescip-shell shell shell-project 0.0.0 usage(). |
| 35 | ;; |
| 36 | esac |
| 37 | done |
| 38 | |
| 39 | doitscip-shell shell shell-project 0.0.0 doit(). () { |
| 40 | # rm -rf '.#'* .*~ *~ *.a *.o .cm core mlmon.out svn-commit.* |
| 41 | "$bin/find-ignore" -exec ${RM} '{}' + |
| 42 | for f in *; do |
| 43 | if [scip-shell system . . `[`. -d "$f" ]; then |
| 44 | for ((i=0; i < ${#exclude[*]}; i++)); do |
| 45 | if [ "$f" == "${exclude[$i]}" ]; then |
| 46 | continue 2 |
| 47 | fi |
| 48 | done |
| 49 | cd "$f" |
| 50 | if [scip-shell system . . `[`. -r Makefile ]; then |
| 51 | ${MAKE} clean || doitscip-shell shell shell-project 0.0.0 doit(). |
| 52 | else |
| 53 | doitscip-shell shell shell-project 0.0.0 doit(). |
| 54 | fi |
| 55 | cd .. |
| 56 | fi |
| 57 | done |
| 58 | } |
| 59 | |
| 60 | doitscip-shell shell shell-project 0.0.0 doit(). |