author | wenzelm |
Wed, 06 Apr 2011 21:55:41 +0200 | |
changeset 42262 | 4821a2a91548 |
parent 32390 | 468eff174a77 |
permissions | -rwxr-xr-x |
10555 | 1 |
#!/usr/bin/env bash |
2502 | 2 |
# |
9788 | 3 |
# Author: Markus Wenzel, TU Muenchen |
2502 | 4 |
# |
4456 | 5 |
# DESCRIPTION: apply make utility to all logics |
2502 | 6 |
|
4456 | 7 |
## diagnostics |
2502 | 8 |
|
10511 | 9 |
PRG="$(basename "$0")" |
2502 | 10 |
|
4456 | 11 |
function usage() |
12 |
{ |
|
13 |
echo |
|
28650 | 14 |
echo "Usage: isabelle $PRG [ARGS ...]" |
4456 | 15 |
echo |
32325 | 16 |
echo " Apply isabelle make to all components with IsaMakefile (passing ARGS)." |
4456 | 17 |
echo |
18 |
exit 1 |
|
19 |
} |
|
2502 | 20 |
|
13229 | 21 |
function fail() |
22 |
{ |
|
23 |
echo "$1" >&2 |
|
24 |
exit 2 |
|
25 |
} |
|
2502 | 26 |
|
32325 | 27 |
|
4456 | 28 |
## main |
29 |
||
30 |
[ "$1" = "-?" ] && usage |
|
2502 | 31 |
|
13235
c26fc3baeffc
fail not so early, but produce correct exit code in the end
kleing
parents:
13229
diff
changeset
|
32 |
FAIL="" |
c26fc3baeffc
fail not so early, but produce correct exit code in the end
kleing
parents:
13229
diff
changeset
|
33 |
|
10511 | 34 |
echo "Started at $(date) ($ML_IDENTIFIER on $(hostname))" |
18321
3414557c2dda
replaced lib/scripts/showtime by more advanced lib/scripts/timestart|stop.bash;
wenzelm
parents:
15845
diff
changeset
|
35 |
. "$ISABELLE_HOME/lib/scripts/timestart.bash" |
2502 | 36 |
|
32390
468eff174a77
function splitarray: splightly more abstract version that accomodates older bashes;
wenzelm
parents:
32325
diff
changeset
|
37 |
splitarray ":" "$ISABELLE_COMPONENTS"; COMPONENTS=("${SPLITARRAY[@]}") |
32325 | 38 |
|
39 |
for DIR in "${COMPONENTS[@]}" |
|
4456 | 40 |
do |
32325 | 41 |
if [ -f "$DIR/IsaMakefile" ]; then |
42 |
NAME="$(basename "$DIR")" |
|
43 |
( cd "$DIR"; "$ISABELLE_TOOL" make "$@" ) || FAIL="$FAIL$NAME " |
|
44 |
fi |
|
4456 | 45 |
done |
2502 | 46 |
|
4456 | 47 |
echo -n "Finished at "; date |
2502 | 48 |
|
18321
3414557c2dda
replaced lib/scripts/showtime by more advanced lib/scripts/timestart|stop.bash;
wenzelm
parents:
15845
diff
changeset
|
49 |
. "$ISABELLE_HOME/lib/scripts/timestop.bash" |
3414557c2dda
replaced lib/scripts/showtime by more advanced lib/scripts/timestart|stop.bash;
wenzelm
parents:
15845
diff
changeset
|
50 |
echo "$TIMES_REPORT" |
13235
c26fc3baeffc
fail not so early, but produce correct exit code in the end
kleing
parents:
13229
diff
changeset
|
51 |
|
13834 | 52 |
[ "$FAIL" = "" ] || fail "Logics ${FAIL}FAILED!" |