-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaketiming2.sh
executable file
·38 lines (34 loc) · 1.28 KB
/
maketiming2.sh
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
31
32
33
34
35
36
37
38
#!/bin/bash
PROG=timingTests
EXE=TestTiming
OFLAG="2" SZC=0 SZCFLAGS=() OPTS=()
for o in "$@"; do
case "$o" in
-Rcode|-Rheap|-Rstack|-Rlink|-fopt=*) SZCFLAGS+=("$o");;
-szc) SZC=1;;
-O*) OFLAG="${o#-O}";;
-i) PROG=iterTests EXE=TestIter;;
*) OPTS+=("$o");;
esac
done
OPTS+=("-O$OFLAG")
SRCDIR="$(dirname $(readlink -f "$0" | sed 's=^/net/home/=/home/='))"
if [ $SZC -ne 0 -o "${#SZCFLAGS[@]}" -gt 0 ]; then
shift
[ "${#SZCFLAGS[@]}" -le 0 ] && SZCFLAGS=(-Rheap -Rstack -Rlink)
CXX="szc -lang=c++ -v -fopt=$OFLAG ${SZCFLAGS[*]}"
else
CXX=$(root-config --cxx)
fi
EXEOUT=$(readlink -e "$EXE")
[ -z "$EXEOUT" ] && EXEOUT=$EXE
[ -f "$BUILD_DIR/lib/libgtestd.a" ] && gtest="gtestd" || gtest="gtest"
CXXFLAGS="$(root-config --cflags) -I$SRCDIR -DNO_DICT=1"
LDFLAGS="$(root-config --ldflags --libs) -lROOTTPython -O2 -L$BUILD_DIR/lib -l$gtest"
set -x
mkdir -p obj
rm -f $EXEOUT obj/$PROG
$CXX -c -o obj/$PROG.o "$SRCDIR/test/$PROG.cxx" $CXXFLAGS "${OPTS[@]}" || exit
$CXX -c -o obj/gtest_main.o "$BUILD_DIR/_deps/googletest-src/googletest/src/gtest_main.cc" $CXXFLAGS "${OPTS[@]}" || exit
$CXX -o obj/$PROG obj/gtest_main.o obj/$PROG.o $LDFLAGS || exit
mv obj/$PROG $EXEOUT