Mercurial > repos > rhope
comparison ctobinnotify @ 187:5e752cf2d6b1
Add versions of compile and ctobin scripts that have desktop notifications
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 07 Oct 2011 00:11:30 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
186:ba35ab624ec2 | 187:5e752cf2d6b1 |
---|---|
1 #!/bin/sh | |
2 | |
3 if test ! -f "$1.c"; then | |
4 echo "C file missing! Maybe you need to do a full compile?" | |
5 exit 1 | |
6 fi | |
7 | |
8 cp runtime/* build/ | |
9 cp "$1.c" build/ | |
10 cd build | |
11 bin=`echo $1 | sed s/\.rhope//` | |
12 | |
13 if test -f "$bin"; then | |
14 rm "$bin" | |
15 fi | |
16 | |
17 if test -z $CC; then | |
18 CC="gcc" | |
19 fi | |
20 | |
21 file=$1 | |
22 shift | |
23 echo "$CC -o $bin $@ $file.c blueprint.c context.c fixed_alloc.c object.c transaction.c net.c" | |
24 $CC -o $bin $@ "$file.c" blueprint.c context.c fixed_alloc.c object.c transaction.c net.c 2>&1 | tee cc_output.txt | |
25 | |
26 if test -f "$bin"; then | |
27 notify-send -i dialog-ok 'Compilation complete' "Compilation of $file to native code completed successfully" | |
28 else | |
29 cc_errors=`grep error cc_output.txt | head -n 3` | |
30 notify-send -i error 'Compilation failed' "Compilation of $file to native code from C failed. Details\n$cc_errors" | |
31 fi | |
32 cd .. | |
33 |