-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.sh
executable file
·62 lines (52 loc) · 1.61 KB
/
compile.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
shopt -s nullglob
current_path=`pwd -P`
if [[ $current_path == *TriDAS* ]]; then
export BUILD_HOME=`echo $current_path | sed -r 's|(TriDAS).*$|\1|'`
elif [[ $current_path == *local/data/odmb_ucsb* ]]; then
export BUILD_HOME=/home/cscme11/TriDAS
else
export BUILD_HOME=`dirname ${current_path}`/TriDAS
fi
export BUILD_SUPPORT=build
export XDAQ_ROOT=/opt/xdaq
export XDAQ_OS=linux
export XDAQ_PLATFORM=x86_64_cc7
echo
echo "Environment variables:"
echo " BUILD_HOME = $BUILD_HOME"
echo " BUILD_SUPPORT = $BUILD_SUPPORT"
echo " XDAQ_ROOT = $XDAQ_ROOT"
echo " XDAQ_OS = $XDAQ_OS"
echo " XDAQ_PLATFORM = $XDAQ_PLATFORM"
echo " XDAQ_DOCUMENT_ROOT = $XDAQ_DOCUMENT_ROOT"
echo " ROOTSYS = $ROOTSYS"
echo " LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
echo
tmp_file_build="makefile_errors_and_warnings_temporary_collision_free_long_unambiguous_name_build.log"
tmp_file_install="makefile_errors_and_warnings_temporary_collision_free_long_unambiguous_name_install.log"
rm -f core.*
make -j -k 2> >(tee $tmp_file_build >&2)
make -j -k install 2> >(tee $tmp_file_install >&2)
echo
if [[ -s $tmp_file_build || -s $tmp_file_install ]] ; then
echo
echo "ERRORS AND WARNINGS:"
if [[ -s $tmp_file_build ]] ; then
cat $tmp_file_build >&2
fi
if [[ -s $tmp_file_install ]] ; then
cat $tmp_file_install >&2
fi
rm -rf $tmp_file_build
rm -rf $tmp_file_install
echo
exit 1
else
echo
echo "Compiled successfully without errors or warnings!"
echo
rm -rf $tmp_file_build
rm -rf $tmp_file_install
exit 0
fi