| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # |
| 3 | # This simple script is used to gather compile time metrics. You can use |
| 4 | # it with make like this: |
| 5 | # |
| 6 | # $ make CXX=g++_metric.sh |
| 7 | # |
| 8 | |
| 9 | commandline=$@ |
| 10 | # find the target and save it to a variable |
| 11 | until [scip-shell system . . `[`. -z "$1" ] # test all command line parameters |
| 12 | do |
| 13 | if [scip-shell system . . `[`. "-o" = "$1" ] |
| 14 | then |
| 15 | shift |
| 16 | target=$1 |
| 17 | break |
| 18 | fi |
| 19 | shift |
| 20 | done |
| 21 | |
| 22 | # echo out "(%x)", the return value from g++, so the script processes the output |
| 23 | # will only use times for successful compilations, i.e., "(0)". |
| 24 | /usr/bin/timescip-shell filesystem . . `/usr/bin/time`. -f "//compile time(%x): ${PWD#$ACE_ROOT/}/${target} %U %S" g++ $commandline |
| 25 | |
| 26 | retval=$? |
| 27 | |
| 28 | exit $retval |