mk 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. # Copyright 2015-2016 bill-auger <https://github.com/bill-auger/av-caster/issues>
  3. #
  4. # This file is part of the AvCaster program.
  5. #
  6. # AvCaster is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License version 3
  8. # as published by the Free Software Foundation.
  9. #
  10. # AvCaster is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with AvCaster. If not, see <http://www.gnu.org/licenses/>.
  17. # enable logging (n=verbosity)
  18. export GST_DEBUG=4
  19. # comment this to log to screen
  20. export GST_DEBUG_NO_COLOR=1 && export GST_DEBUG_FILE=debug.log # log to file
  21. # enable graphviz
  22. export DOT_DIR=/code/dot
  23. export GST_DEBUG_DUMP_DOT_DIR=$DOT_DIR
  24. # compiler flags
  25. export CFLAGS='-Werror=return-type'
  26. # file output
  27. VIDEOS_DIR=/home/bill/vids
  28. OUTPUT_NAME="AvCaster"
  29. OUTPUT_FILE=$OUTPUT_NAME.flv
  30. # validate specified build configuration
  31. if [ "$CONFIG" == "Debug" ] ; then BINARY=./build/av-caster-dbg ; TARGET="Debug" ;
  32. else BINARY=./build/av-caster ; TARGET="Release" ;
  33. fi
  34. # build project
  35. echo "Building $TARGET target"
  36. CONFIG=$TARGET cd Builds/Makefile && make -j 2
  37. (($?)) && echo "Build succeeded - Launching '$BINARY $*'" && "$BINARY $*"
  38. # convert dot graphs to images
  39. if [ -d $DOT_DIR ]
  40. then cd $DOT_DIR
  41. rm *.png 2> /dev/null
  42. for graph_dot_file in `ls *.dot 2> /dev/null`
  43. do echo "found dot graph $graph_dot_file"
  44. graph_png_file=${graph_dot_file%%.dot}.png
  45. dot -Tpng $graph_dot_file > $graph_png_file && rm $graph_dot_file
  46. [ -f $graph_png_file ] && echo "created graph image $graph_png_file"
  47. done
  48. fi
  49. # playback file output
  50. if [ -d $VIDEOS_DIR -a -f $OUTPUT_FILE ]
  51. then cd $VIDEOS_DIR
  52. filesize=`ls -s $OUTPUT_FILE`
  53. echo "output file exists $filesize"
  54. ((${filesize:0:1})) && mplayer $OUTPUT_FILE 2&> /dev/null
  55. rm $OUTPUT_NAME*
  56. fi