summaryrefslogtreecommitdiff
path: root/ACE/bin/g++_metric.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/bin/g++_metric.sh')
-rwxr-xr-xACE/bin/g++_metric.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/ACE/bin/g++_metric.sh b/ACE/bin/g++_metric.sh
new file mode 100755
index 00000000000..93af97932a1
--- /dev/null
+++ b/ACE/bin/g++_metric.sh
@@ -0,0 +1,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