mk 561 B

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