2
0

turbo_build.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. arg=$1 ; shift
  2. prefix=`cat config.log | grep ^prefix=\' | awk -F \' '{print $2}'`
  3. if [ -z $prefix ] ; then
  4. prefix="/usr/local/freeswitch"
  5. fi
  6. unset VERBOSE
  7. switch_srcdir=`pwd`
  8. if [ -z $MAKE ] ; then
  9. MAKE=make
  10. fi
  11. if [ -z $arg ] ; then
  12. echo "Cleaning tree...."
  13. $MAKE clean modwipe 2>&1 > /dev/null
  14. echo "Building core...."
  15. $MAKE -j freeswitch 2>&1 > /dev/null
  16. MODS=`cat modules.conf | grep -v \#`
  17. for i in $MODS ; do
  18. MOD_NAME=`echo $i | sed -e 's|^.*/||'`
  19. MOD_DIR=`if test -d $switch_srcdir/src/mod/$i ; then echo $switch_srcdir/src/mod/$i ; else echo $i ; fi;`
  20. touch /tmp/$MOD_NAME.tmp
  21. $0 $MOD_NAME $MOD_DIR
  22. done
  23. echo "Building mods...."
  24. while [ 1 = 1 ] ; do
  25. x=0
  26. for i in $MODS ; do
  27. if [ -f /tmp/$MOD_NAME.tmp ] ; then
  28. x=$[$x+1];
  29. fi
  30. done
  31. if [ $x = 0 ] ; then
  32. echo Build finished. Making install
  33. $MAKE -j install 2>&1 > /dev/null
  34. echo done
  35. exit;
  36. fi
  37. sleep 1
  38. done
  39. exit
  40. fi
  41. if [ ! $arg = "bg" ] ; then
  42. $0 bg $arg $@ &
  43. exit
  44. fi
  45. MOD_NAME=$1 ; shift
  46. MOD_DIR=$1 ; shift
  47. #echo "Making module in $MOD_NAME..."
  48. if [ -f $MOD_DIR/Makefile ] ; then
  49. cd $MOD_DIR && BASE=$switch_srcdir $MAKE -j 2>&1 > /dev/null
  50. else
  51. cd $MOD_DIR && BASE=$switch_srcdir $MAKE -j -f $switch_srcdir/build/modmake.rules 2>&1 > /dev/null
  52. fi
  53. #echo "Finished making module in $MOD_NAME"
  54. sleep 1
  55. rm /tmp/$MOD_NAME.tmp