Commit 8fda7ef6 authored by Mathieu Faverge's avatar Mathieu Faverge

Don't need to compile and configure otf and tau each time you compile vite

parent 3cebc01f
......@@ -50,22 +50,46 @@ WHICH=`which which 2>/dev/null`
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
makefile="Makefile"
# Default values
#
# External libraries default values
#
# OTF
with_otf=1
otfdir="../externals/otf/otflib"
otfincdir="$otfdir"
otflibdir="$otfdir/lib/libotf.a"
otfmakecmd="( cd ../externals/otf && ./configure && make && cd ../../trunk )"
otfcleancmd="( cd ../externals/otf && make clean && cd ../../trunk )"
otfdir="$PWD/externals/otf"
otfincdir="$otfdir/otflib/"
otflibdir="$otfdir/otflib/.libs"
otfmake="
otf : $otflibdir/libotf.a
( cd $otfdir && ./configure && make )
otfclean :
( cd $otfdir && make clean )
"
otfnotinc="
otf :
otfclean :
"
# TAU
with_tau=1
taudir="../externals/tau"
taudir="$PWD/externals/tau"
tauincdir="$taudir/include"
taulibdir="$taudir/src/TraceInput"
taumakecmd="( cd ../externals/tau/src/TraceInput/ && make && cd ../../../../trunk )"
taucleancmd="( cd ../externals/tau/src/TraceInput/ && make clean && cd ../../../../trunk )"
qtcolordir="../externals/qtcolorpicker"
taumake="
tau :
( cd $taulibdir && make )
tauclean :
( cd $taulibdir && make clean )
"
taunotinc="
tau :
tauclean :
"
# QTColor
qtcolordir="$PWD/externals/qtcolorpicker"
qtcolorincdir="$qtcolordir/src"
qtcolorsrcdir="$qtcolordir/src"
......@@ -169,50 +193,43 @@ while [ 0 -lt $# ]; do
;;
--disable_otf) # otf support
with_otf=0;
otfmakecmd=
otfcleancmd=
;;
--otf_dir=*) # otf directory
otfdir=`echo $OPT | awk -F"--otf_dir=" '{print $2}'`
otfincdir="$otfdir/include"
otflibdir="$otfdir/lib/libotf.a"
otfmakecmd=
otfcleancmd=
with_otf=2;
otfdir=`echo $OPT | awk -F"--otf_dir=" '{print $2}'`
otfincdir="$otfdir/include"
otflibdir="$otfdir/lib"
;;
--otf_incdir=*) # otf include directory
otfincdir=`echo $OPT | awk -F"--otf_incdir=" '{print $2}'`
otfmakecmd=
otfcleancmd=
with_otf=2;
otfincdir=`echo $OPT | awk -F"--otf_incdir=" '{print $2}'`
;;
--otf_libdir=*)
with_otf=2;
otflibdir=`echo $OPT | awk -F"--otf_libdir=" '{print $2}'`
otfmakecmd=
otfcleancmd=
;;
--disable_tau) # tau support
with_tau=0;
taumakecmd=
taucleancmd=
;;
--tau_dir=*) # tau directory
taudir=`echo $OPT | awk -F"--tau_dir=" '{print $2}'`
tauincdir="$taudir/include"
taulibdir="$taudir/lib"
taudir=`echo $OPT | awk -F"--tau_dir=" '{print $2}'`
tauincdir="$taudir/include"
taulibdir="$taudir/lib"
;;
--tau_incdir=*) # tau include directory
tauincdir=`echo $OPT | awk -F"--tau_incdir=" '{print $2}'`
tauincdir=`echo $OPT | awk -F"--tau_incdir=" '{print $2}'`
;;
--tau_libdir=*)
taulibdir=`echo $OPT | awk -F"--tau_libdir=" '{print $2}'`
;;
# Internal options (Don't appear in --help)
# Internal options (Don't appear in --help)
--qtcolor_dir=*) # qtcol directory
qtcolordir=`echo $OPT | awk -F"--qtcolor_dir=" '{print $2}'`
qtcolorincdir="$qtcolordir/include"
qtcolorlibdir="$qtcolordir/lib"
qtcolordir=`echo $OPT | awk -F"--qtcolor_dir=" '{print $2}'`
qtcolorincdir="$qtcolordir/include"
qtcolorlibdir="$qtcolordir/lib"
;;
--qtcolor_incdir=*) # qtcolor include directory
qtcolorincdir=`echo $OPT | awk -F"--qtcolor_incdir=" '{print $2}'`
qtcolorincdir=`echo $OPT | awk -F"--qtcolor_incdir=" '{print $2}'`
;;
--qtcolor_libdir=*)
qtcolorlibdir=`echo $OPT | awk -F"--qtcolor_libdir=" '{print $2}'`
......@@ -230,7 +247,7 @@ while [ 0 -lt $# ]; do
done
#end the qmake options
if [ $config_specified = 1 ]; then
if [ $config_specified -eq 1 ]; then
config="$config\"";
else
config="$config release\"";
......@@ -241,23 +258,37 @@ fi
#
# OTF
if [ $with_otf = 1 ]; then
defines="$defines WITH_OTF"
sources="$sources parser/ParserOTF.cpp parser/ParserEventOTF.cpp parser/ParserDefinitionOTF.cpp"
headers="$headers parser/ParserOTF.hpp parser/ParserEventOTF.hpp parser/ParserDefinitionOTF.hpp"
includepath="$includepath $otfincdir"
libs="$libs $otflibdir"
if [ $with_otf -ge 1 ]; then
if [ $with_otf = 2 ] && [ ! -f "$otflibdir/libotf.a" ]; then
echo "ERROR: OTF library not found in $otflibdir"
echo "Please specify the correct directory with --otf_dir=dir or use the one provided by ViTE"
exit;
else
defines="$defines WITH_OTF"
sources="$sources parser/ParserOTF.cpp parser/ParserEventOTF.cpp parser/ParserDefinitionOTF.cpp"
headers="$headers parser/ParserOTF.hpp parser/ParserEventOTF.hpp parser/ParserDefinitionOTF.hpp"
includepath="$includepath $otfincdir"
libs="$libs -L$otflibdir -lotf"
fi
fi
# TAU
if [ $with_tau = 1 ]
then
defines="$defines WITH_TAU"
sources="$sources parser/ParserTau.cpp"
headers="$headers parser/ParserTau.hpp parser/TauStructs.hpp"
includepath="$includepath $tauincdir"
libs="$libs -L$taulibdir -lTAU_traceinput"
# libs="$libs -L$taulibdir -lTAU_tf"
if [ $with_tau -ge 1 ]; then
if [ $with_tau = 2 ] && [ ! -f "$taulibdir/libTAU_tf.a" ]; then
echo "ERROR: TAU library not found in $taulibdir"
echo "Please specify the correct directory with --tau_dir=dir or use the one provided by ViTE"
exit;
else
defines="$defines WITH_TAU"
sources="$sources parser/ParserTau.cpp"
headers="$headers parser/ParserTau.hpp parser/TauStructs.hpp"
includepath="$includepath $tauincdir"
if [ $with_tau -eq 1 ]; then
libs="$libs -L$taulibdir -lTAU_traceinput"
else
libs="$libs -L$taulibdir -lTAU_tf"
fi
fi
fi
# QT Color Picker
......@@ -267,7 +298,6 @@ includepath="$includepath $qtcolorincdir"
#
# End External libraries
#
defines="$defines\"";
libs="$libs\"";
includepath="$includepath\"";
......@@ -331,9 +361,7 @@ cat > "$makefile" <<EOF
include Makefile.in
all:
$otfmakecmd
$taumakecmd
all: otf tau
( cd src && \$(QMAKECMD) $project $options)
( cd src && \$(MAKECMD) )
@echo " "
......@@ -354,8 +382,6 @@ plugins:
( cd plugins && VITEDIR=\$(VITEDIR) $MAKE )
clean:
$otfcleancmd
$taucleancmd
( cd plugins && VITEDIR=\$(VITEDIR) $MAKE clean )
( cd src && $MAKE clean )
\$(RM) log.txt
......@@ -363,14 +389,14 @@ clean:
@echo "Cleaned!"
@echo " "
cleanall: clean
cleanall: clean
( cd plugins && VITEDIR=\$(VITEDIR) $MAKE cleanall )
$MAKE -C \${DOCSDIR}/user_manual cleanall
$MAKE -C \${DOCSDIR}/technical_manual cleanall
@( cd \${DOCSDIR} && rm -rf html/ latex/)
@( cd bin/ && \$(RM) vite)
distclean: cleanall
distclean: cleanall cleantau cleanotf
( cd plugins && VITEDIR=\$(VITEDIR) $MAKE distclean )
\$(RM) Makefile
\$(RM) src/Makefile
......@@ -379,16 +405,49 @@ distclean: cleanall
EOF
if [ $with_otf -eq 1 ]; then
cat >> "$makefile" <<EOF
otf : $otflibdir/libotf.a
$otflibdir/libotf.a:
( cd $otfdir && ./configure && make )
otfclean :
( cd $otfdir && make clean )
EOF
else
cat >> "$makefile" <<EOF
otf :
otfclean :
EOF
fi
if [ $with_tau -eq 1 ]; then
cat >> "$makefile" <<EOF
tau : $taulibdir/libTAU_traceinput.a
$taulibdir/libTAU_traceinput.a:
( cd $taulibdir && make )
tauclean :
( cd $taulibdir && make clean )
EOF
else
cat >> "$makefile" <<EOF
tau :
tauclean :
EOF
fi
# basename erase the path of acces of the command
MAKE=`basename $MAKE`
if [ $with_otf = 1 ]; then
if [ $with_otf -ge 1 ]; then
echo OTF support [OK]
else
echo OTF support [DISABLE]
fi
if [ $with_tau = 1 ]; then
if [ $with_tau -ge 1 ]; then
echo TAU support [OK]
else
echo TAU spport [DISABLE]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment