Merge pull request #2240 from DOCGroup/revert-2239-jwi-pi23
[ACE_TAO.git] / ACE / bin / g++_metric.sh
blobc31b53c48c945cbfa633aad52f222500fc894fa9
1 #!/bin/sh
3 # This simple script is used to gather compile time metrics. You can use
4 # it with make like this:
6 # $ make CXX=g++_metric.sh
9 commandline=$@
10 # find the target and save it to a variable
11 until [ -z "$1" ] # test all command line parameters
13 if [ "-o" = "$1" ]
14 then
15 shift
16 target=$1
17 break
19 shift
20 done
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/time -f "//compile time(%x): ${PWD#$ACE_ROOT/}/${target} %U %S" g++ $commandline
26 retval=$?
28 exit $retval