2007-03-30 16:24:37 -04:00
|
|
|
arg=$1 ; shift
|
2009-02-10 17:57:54 -05:00
|
|
|
prefix=`cat config.log | grep ^prefix=\' | awk -F \' '{print $2}'`
|
|
|
|
if [ -z $prefix ] ; then
|
|
|
|
prefix="/usr/local/freeswitch"
|
|
|
|
fi
|
|
|
|
unset VERBOSE
|
2007-03-30 16:24:37 -04:00
|
|
|
switch_srcdir=`pwd`
|
|
|
|
if [ -z $MAKE ] ; then
|
|
|
|
MAKE=make
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z $arg ] ; then
|
2009-02-10 17:57:54 -05:00
|
|
|
echo "Cleaning tree...."
|
|
|
|
$MAKE clean modwipe 2>&1 > /dev/null
|
|
|
|
echo "Building core...."
|
|
|
|
$MAKE -j freeswitch 2>&1 > /dev/null
|
2007-03-30 16:24:37 -04:00
|
|
|
MODS=`cat modules.conf | grep -v \#`
|
|
|
|
for i in $MODS ; do
|
|
|
|
MOD_NAME=`echo $i | sed -e 's|^.*/||'`
|
|
|
|
MOD_DIR=`if test -d $switch_srcdir/src/mod/$i ; then echo $switch_srcdir/src/mod/$i ; else echo $i ; fi;`
|
|
|
|
touch /tmp/$MOD_NAME.tmp
|
|
|
|
$0 $MOD_NAME $MOD_DIR
|
|
|
|
done
|
2009-02-10 17:57:54 -05:00
|
|
|
echo "Building mods...."
|
2007-03-30 16:24:37 -04:00
|
|
|
while [ 1 = 1 ] ; do
|
|
|
|
x=0
|
|
|
|
for i in $MODS ; do
|
|
|
|
if [ -f /tmp/$MOD_NAME.tmp ] ; then
|
|
|
|
x=$[$x+1];
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ $x = 0 ] ; then
|
2007-04-05 10:57:20 -04:00
|
|
|
echo Build finished. Making install
|
2009-02-16 08:57:25 -05:00
|
|
|
$MAKE -j install 2>&1 > /dev/null
|
|
|
|
echo done
|
2007-03-30 16:24:37 -04:00
|
|
|
exit;
|
|
|
|
fi
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! $arg = "bg" ] ; then
|
|
|
|
$0 bg $arg $@ &
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
MOD_NAME=$1 ; shift
|
|
|
|
MOD_DIR=$1 ; shift
|
|
|
|
|
2009-02-10 17:57:54 -05:00
|
|
|
#echo "Making module in $MOD_NAME..."
|
2007-03-30 16:24:37 -04:00
|
|
|
if [ -f $MOD_DIR/Makefile ] ; then
|
2009-02-10 17:57:54 -05:00
|
|
|
cd $MOD_DIR && BASE=$switch_srcdir $MAKE -j 2>&1 > /dev/null
|
2007-03-30 16:24:37 -04:00
|
|
|
else
|
2009-02-10 17:57:54 -05:00
|
|
|
cd $MOD_DIR && BASE=$switch_srcdir $MAKE -j -f $switch_srcdir/build/modmake.rules 2>&1 > /dev/null
|
2007-03-30 16:24:37 -04:00
|
|
|
fi
|
|
|
|
|
2009-02-10 17:57:54 -05:00
|
|
|
#echo "Finished making module in $MOD_NAME"
|
2007-03-30 16:24:37 -04:00
|
|
|
sleep 1
|
|
|
|
rm /tmp/$MOD_NAME.tmp
|
|
|
|
|
|
|
|
|