mk 503 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. ROOT_DIR=`pwd`
  3. LOG_FILE="debug.log"
  4. if [ "$1" == "debug" ]
  5. then TARGET=release ; CMD="./bin/loopidity" ;
  6. else TARGET=debug ; CMD="gdb" ;
  7. fi
  8. [ "$1" == "clean" -o "$2" == "clean" ] && SHOULD_CLEAN=1
  9. trace() { echo ; echo $* ; }
  10. cd build
  11. (($SHOULD_CLEAN)) && trace "cleaning $TARGET build" && make clean CONFIG=$TARGET
  12. make CONFIG=$TARGET || exit
  13. trace "launching executable"
  14. $CMD
  15. trace "executable terminated"
  16. [ -f $LOG_FILE ] && trace "$LOG_FILE -->" && cat $LOG_FILE
  17. cd $ROOT_DIR