summaryrefslogtreecommitdiff
path: root/ACE/bin/g++_metric.sh
blob: b24fc2bf355093f5d97e9cb50707cc6cab735426 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
#
# $Id$
#
# This simple script is used to gather compile time metrics.  You can use
# it with make like this:
#
#  $ make CXX=g++_metric.sh
#

commandline=$@
# find the target and save it to a variable
until [ -z "$1" ] # test all command line parameters
do
  if [ "-o" = "$1" ]
  then
    shift
    target=$1
    break
  fi
  shift
done

# echo out "(%x)", the return value from g++, so the script processes the output
#  will only use times for successful compilations, i.e., "(0)".
/usr/bin/time -f "//compile time(%x): ${PWD#$ACE_ROOT/}/${target} %U %S" g++ $commandline

retval=$?

exit $retval